home *** CD-ROM | disk | FTP | other *** search
/ Dream 57 / Amiga_Dream_57.iso / Amiga / Programmation / c / QuakeC / qtools0.2-src.lha / src / libqtools / ILBM.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-07-18  |  3.0 KB  |  110 lines

  1. #ifndef    ILBM_H
  2. #define    ILBM_H
  3.  
  4. /*
  5.  * ============================================================================
  6.  * structures
  7.  * ============================================================================
  8.  */
  9.  
  10. /* definitions for BMHD */
  11. struct BitMapHeader {
  12.   unsigned short w, h;
  13.   short x, y;
  14.   unsigned char nPlanes, masking, compression, pad1;
  15.   unsigned short transparentColor;
  16.   unsigned char xAspect, yAspect;
  17.   short pageWidth, pageHeight;
  18. };
  19.  
  20. #define mskNone                 0
  21. #define mskHasMask              1
  22. #define mskHasTransparentColor  2
  23. #define mskLasso                3
  24.  
  25. #define cmpNone                 0
  26. #define cmpByteRun1             1
  27.  
  28. /* definitions for CAMG */
  29. #define vmLACE                  0x0004                /* not used */
  30. #define vmEXTRA_HALFBRITE       0x0080
  31. #define vmHAM                    0x0800
  32. #define vmHIRES             0x8000                /* not used */
  33.  
  34. #define HAMCODE_CMAP               0                /* look up color in colormap */
  35. #define HAMCODE_BLUE               1                /* new blue component */
  36. #define HAMCODE_RED                2                /* new red component */
  37. #define HAMCODE_GREEN            3                /* new green component */
  38.  
  39. /* multipalette PCHG chunk definitions */
  40. struct PCHGHeader {
  41.   unsigned short Compression;
  42.   unsigned short Flags;
  43.   short StartLine;                        /* may be negative */
  44.   unsigned short LineCount;
  45.   unsigned short ChangedLines;
  46.   unsigned short MinReg;
  47.   unsigned short MaxReg;
  48.   unsigned short MaxChanges;
  49.   unsigned long TotalChanges;
  50. };
  51.  
  52. /* Compression modes */
  53. #define PCHG_COMP_NONE      0
  54. #define PCHG_COMP_HUFFMAN   1
  55.  
  56. /* Flags */
  57. #define PCHGF_12BIT         (1 << 0)                /* use SmallLineChanges */
  58. #define PCHGF_32BIT         (1 << 1)                /* use BigLineChanges */
  59. #define PCHGF_USE_ALPHA     (1 << 2)                /* meaningful only if PCHG_32BIT is on:
  60.                                  * use the Alpha channel info */
  61. struct PCHGCompHeader {
  62.   unsigned long CompInfoSize;
  63.   unsigned long OriginalDataSize;
  64. };
  65.  
  66. /*
  67.  * the next three structures are used internally by ilbmtoppm
  68.  * The PCHG BigLineChanges and SmallLineChanges are converted
  69.  * to these structures
  70.  */
  71. struct PaletteChange {
  72.   unsigned short Register;
  73.   pixval Alpha, Red, Green, Blue;
  74. };
  75.  
  76. struct LineChanges {
  77.   unsigned short Count;
  78.   PaletteChange *Palette;
  79. };
  80.  
  81. struct PCHGInfo {
  82.   PCHGHeader *PCHG;
  83.   unsigned char *LineMask;
  84.   LineChanges *Change;
  85.   PaletteChange *Palette;
  86.   pixval maxval;                        /* maxval of colors in Palette */
  87.   pixel *colormap;                        /* original colormap */
  88.   int colors;                            /* colors in colormap */
  89. };
  90.  
  91. #define    MAXBITPLANES    16
  92. typedef unsigned short rawtype;
  93.  
  94. #define MAXCMAPCOLORS   (1 << MAXPLANES)
  95. #define MAXCOLVAL       255                    /* max value of color component */
  96.  
  97. /*
  98.  * ============================================================================
  99.  * globals
  100.  * ============================================================================
  101.  */
  102.  
  103. /*
  104.  * ============================================================================
  105.  * prototypes
  106.  * ============================================================================
  107.  */
  108.  
  109. #endif
  110.