Back to index

radiance  4R0+20100331
x11raster.h
Go to the documentation of this file.
00001 /* RCSid: $Id: x11raster.h,v 2.4 2004/03/28 20:33:14 schorsch Exp $ */
00002 /*
00003  * x11raster.h - header file for X routines using images.
00004  *
00005  *     3/1/90
00006  */
00007 #ifndef _RAD_X11RASTER_H_
00008 #define _RAD_X11RASTER_H_
00009 
00010 #ifdef __cplusplus
00011 extern "C" {
00012 #endif
00013 
00014 
00015 typedef struct {
00016        Display       *disp;                      /* the display */
00017        int    screen;                            /* the screen */
00018        Visual *visual;                    /* pointer to visual used */
00019        XImage *image;                            /* the X image */
00020        GC     gc;                         /* private graphics context */
00021        int    ncolors;                    /* number of colors */
00022        XColor *cdefs;                            /* color definitions */
00023        short  *pmap;                      /* inverse pixel mapping */
00024        unsigned long *pixels;             /* allocated table entries */
00025        Colormap      cmap;                /* installed color map */
00026        Pixmap pm;                         /* storage on server side */
00027 }      XRASTER;
00028 
00029 extern Colormap newcmap(Display    *disp, int    scrn, Visual  *vis);
00030 extern int init_rcolors(XRASTER    *xr, BYTE     cmap[][3]);
00031 extern unsigned long * map_rcolors(XRASTER       *xr, Window   w);
00032 extern Pixmap make_rpixmap(XRASTER *xr, Window   w);
00033 extern XRASTER * make_raster( Display     *disp, XVisualInfo   *vis,
00034        int    npixbits, char       *data, int    width, int height, int      bm_pad);
00035 extern void patch_raster(Drawable  d, int xsrc, int     ysrc,
00036        int    xdst, int     ydst, int     width, int    height, register XRASTER    *xr);
00037 extern void unmap_rcolors(XRASTER *xr);
00038 extern void free_rpixmap(XRASTER *xr);
00039 extern void free_raster(XRASTER *xr);
00040 
00041 #define put_raster(d,xdst,ydst,xr) patch_raster(d,0,0,xdst,ydst, \
00042                             (xr)->image->width,(xr)->image->height,xr)
00043 
00044 #ifdef __cplusplus
00045 }
00046 #endif
00047 #endif /* _RAD_X11RASTER_H_ */
00048