home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / xloadimg.zip / xloadimage.4.1 / pcx.h < prev    next >
Text File  |  1993-10-21  |  1KB  |  44 lines

  1. /* pcx.h:
  2.  *
  3.  * PCX header file
  4.  *
  5.  * Eckhard R"uggeberg 15.10.91
  6.  */
  7.  
  8. typedef struct {
  9.     byte Zred;
  10.     byte Zgreen;
  11.     byte Zblue;
  12. } PCXcolor;
  13.  
  14. typedef struct {
  15.     byte Zid;            /* Id byte : 0x0a = ZSoft Z    */
  16.     byte Zver;            /* Version :    0 = 2.5
  17.                             2 = 2.8 w palette
  18.                             3 = 2.8 w/o pal.
  19.                             5 = 3.0 */
  20.     byte Zenc;            /* Encoding :    0 = uncompressed, 
  21.                             1 = compressed    */
  22.     byte Zbpp;            /* Bits per pixel per plane, 
  23.                         recommended only 1 or 8 */
  24.     byte  Zxminlo; byte Zxminhi;    /* left  Border Pixel coord.    */
  25.     byte  Zyminlo; byte Zyminhi;    /* upper Border Pixel coord.    */
  26.     byte  Zxmaxlo; byte Zxmaxhi;    /* right Border Pixel coord.    */
  27.     byte  Zymaxlo; byte Zymaxhi;    /* lower Border Pixel coord.    */
  28.     short Zhres;            /* horiz. resolution, ignored    */
  29.     short Zvres;            /* vert.  resolution, ignored    */
  30.     PCXcolor Zcmap [16];        /* Colormap for 16-color pict.    */
  31.     byte  Zreserved;            
  32.     byte  Znplanes;            /* # of planes, recommended 1,4 */
  33.     byte  Zbprlo;      byte Zbprhi;    /* bytes per row (always even)    */
  34.     short  Zpalinfo;        /* Palette info, ignored    */
  35.     byte  Zfiller[58];        /* reserved Filler = 0        */
  36. } PCXHeader;
  37.  
  38. static PCXHeader *PCXH;            /* To avoid a parameter for all */
  39.                     /*             procedures */
  40. #define Word(LO,HI) (HI << 8) + LO    /* to swap bytes in a word    */
  41. #define PCX_MAGIC 0x0a            /* first byte in a PCX file    */
  42. #define PCX_MAPSTART 0x0c        /* Start of appended colormap    */
  43. #define PCXHsize 128            /* Size of PCX Header        */
  44.