load_img.h

Go to the documentation of this file.
00001 
00002 /* ------------------------------------------- */
00003 #define XIMG      0x58494D47
00004 
00005 /* Header of GEM Image Files   */
00006 typedef struct IMG_HEADER{
00007   short version;  /* Img file format version (1) */
00008   short length;   /* Header length in words  (8) */
00009   short planes;   /* Number of bit-planes    (1) */
00010   short pat_len;  /* length of Patterns      (2) */
00011   short pix_w;    /* Pixel width in 1/1000 mmm  (372)    */
00012   short pix_h;    /* Pixel height in 1/1000 mmm (372)    */
00013   short img_w;    /* Pixels per line (=(x+7)/8 Bytes)    */
00014   short img_h;    /* Total number of lines               */
00015   long  magic;    /* Contains "XIMG" if standard color   */
00016   short paltype;  /* palette type (0=RGB (short each)) */
00017   short *palette;       /* palette etc.                        */
00018   char *addr;     /* Address for the depacked bit-planes */
00019 } IMG_header;
00020 
00021 /* ------------------------------------------- */
00022 /* error codes */
00023 #define ERR_HEADER      1
00024 #define ERR_ALLOC       2
00025 #define ERR_FILE        3
00026 #define ERR_DEPACK      4
00027 #define ERR_COLOR       5
00028 
00029 /* saves the current colorpalette with col colors in palette */
00030 void get_colors(int handle, short *palette, int col);
00031 
00032 /* sets col colors from palette */
00033 void img_set_colors(int handle,short *palette, int col);
00034 
00035 /* converts MFDB  of size from standard to deviceformat (0 if succeded, else error). */
00036 int convert(MFDB *, long );
00037 
00038 /* transforms image in VDI-Device format */
00039 int transform_img(MFDB *);
00040 
00041 /* Loads & depacks IMG (0 if succeded, else error). */
00042 /* Bitplanes are one after another in address IMG_HEADER.addr. */
00043 int depack_img(char *, IMG_header *);
00044 
00045 /* Halves IMG in Device-format, dest memory has to be allocated*/
00046 int half_img(MFDB *,MFDB *);