XmHTML Programmers Manual: XmImage Structure
Author: Koen D'Hondt

### Name

> XmImage structure - XmImage Image definition.

### Description

> A XmImage structure is returned by the XmImageCreate and XmImageCreateFromInfo convenience routines.

> See XmImageInfo(3X) for more information about the dispose field in the XmImageFrame structure.

> The pixmap and clip fields in the XmImage structure can be used directly in calls to XCopyArea(3X).

### Structures

    	/* XmImage definition */

    	typedef struct{
    	    String file;                /* originating file                    */
    	    unsigned char type;         /* image type, see XmHTMLImageGetType  */
    	    Pixmap pixmap;              /* actual image                        */
    	    Pixmap clip;                /* for transparant pixmaps             */
    	    unsigned int options;       /* image option bits                   */
    	    int width;                  /* current image width, in pixels      */
    	    int height;                 /* current image height, in pixels     */
    	    int ncolors;                /* no of colors in this image          */
    	    int scolors;                /* specified no of colors              */
    	    int swidth;                 /* image width as read from image      */
    	    int sheight;                /* image height as read from image     */
    	    int depth;                  /* depth of this image                 */
    	    int npixels;                /* no of really allocated pixels       */
    	    GC gc;                      /* graphics context for rendering      */

    	    /* animation data */
    	    XmImageFrame *frames;       /* array of animation frames           */
    	    int nframes;                /* no of frames following              */
    	    int current_frame;          /* current frame count                 */
    	    int current_loop;           /* current loop count                  */
    	    int loop_count;             /* maximum loop count                  */
    	    XtIntervalId proc_id;       /* timer id for animations             */
    	    Widget w;                   /* image owner                         */
    	    XtAppContext context;       /* Application context for animations  */

    	    /* private data */
    	    struct _XColorContext *xcc; /* a lot of visual info                */
    	}XmImage;

    	/* XmImageFrame: animation frame definition */

    	typedef struct{
    	    int x;                  /* x position in logical screen        */
    	    int y;                  /* y position in logical screen        */
    	    int w;                  /* width of this particular frame      */
    	    int h;                  /* height of this particular frame     */
    	    int timeout;            /* timeout for the next frame          */
    	    unsigned char dispose;  /* previous frame disposal method      */
    	    Pixmap pixmap;          /* actual image                        */
    	    Pixmap clip;            /* image clipmask                      */
    	    Pixmap prev_state;      /* previous screen state               */
    	}XmImageFrame;

    	/*
    	 * XmImage options bits (defined in XmHTMLP.h).
    	 * There are more options defined but they are private to XmHTML.
    	 * The IMG_ISANIM and IMG_HASSTATE bits may not be touched when
    	 * they have been set.
    	 */

    	#define IMG_ISANIM          (1L<<4) /* is an animation                  */
    	#define IMG_FRAMEREFRESH    (1L<<5) /* animation is running             */
    	#define IMG_HASSTATE        (1L<<7) /* current state pixmap present     */

    	/* XmImage configuration flags */

    	#define ImageFSDither       (1L<<1) /* Floyd-Steinberg error correction */
    	#define ImageCreateGC       (1L<<2) /* create gc for image              */
    	#define ImageWorkSpace      (1L<<3) /* create animation workspace       */
    	#define ImageClipmask       (1L<<4) /* create clipmask                  */
    	#define ImageBackground     (1L<<5) /* substitute background pixel      */
    	#define ImageQuantize       (1L<<6) /* quantize image                   */
    	#define ImageMaxColors      (1L<<7) /* sets maximum colors              */
    	#define ImageGifDecodeProc  (1L<<8) /* gif lzw decoder function         */
    	#define ImageGifzCmd        (1L<<9) /* gif lzw uncompress command       */
    	#define ImageFrameSelect    (1L<<10)/* frame selection                  */
    	#define ImageScreenGamma    (1L<<11)/* gamma correction. JPEG/ PNG only */

    	/* XmImage configuration */

    	typedef struct{
    	    unsigned long flags;        /* XmImage configuration flags,    */
    	    int ncolors;                /* desired number of colors        */
    	    int which_frames;           /* animation frames selection flag */
    	    int bg_color;               /* transparent pixel               */
    	    String z_cmd;               /* gif uncompress command          */
    	    XmImageGifProc gif_proc;    /* external gif decoder            */
    	    float gamma;                /* gamma correction. JPEG/PNG only */
    	}XmImageConfig;

### See Also

> XmHTML(3X), XmImageCreate(3X), XmImageCreateFromInfo(3X), XmImageDestroy(3X), XmImageInfo(3X), XmHTMLGIFStream(3X)

XmHTML, October 7, 1997