home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 199.lha / GimmeLib / picture.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-12-28  |  2.4 KB  |  89 lines

  1. #ifndef GIMMELIB_PICTURE_H
  2. #define GIMMELIB_PICTURE_H
  3.  
  4. #include "gimmelib/bitplane.h"
  5.  
  6. #ifdef I_AM_PICTURE
  7. #define Mk(a,b,c,d)     (((ULONG)(a)<<24) | ((ULONG)(b)<<16) \
  8.                 | ((ULONG)(c)<<8) | (ULONG)(d))
  9. #define EVEN(p)         ((p+1) & ~1)
  10.  
  11. #define ID_FORM     Mk('F', 'O', 'R', 'M')
  12. #define ID_ILBM     Mk('I', 'L', 'B', 'M')
  13. #define ID_BMHD     Mk('B', 'M', 'H', 'D')
  14. #define ID_CMAP     Mk('C', 'M', 'A', 'P')
  15. #define ID_DEST     Mk('D', 'E', 'S', 'T')
  16. #define ID_SPRT     Mk('S', 'P', 'R', 'T')
  17. #define ID_CAMG     Mk('C', 'A', 'M', 'G')
  18. #define ID_CRNG     Mk('C', 'R', 'N', 'G')
  19. #define ID_CCRT     Mk('C', 'C', 'R', 'T')
  20. #define ID_BODY     Mk('B', 'O', 'D', 'Y')
  21. #endif I_AM_PICTURE
  22.  
  23.  
  24. typedef UBYTE Masking;
  25.  
  26. #define mskNone     0
  27. #define mskHasMask    1
  28. #define mskHasTranCol    2
  29. #define mskLasso    3
  30.  
  31. typedef UBYTE Compression;
  32.  
  33. #define cmpNone     0
  34. #define cmpByteRun1    1
  35.  
  36. typedef struct _gim_bmh {
  37.     UWORD    w,h;            /* raster width, height */
  38.     WORD    x,y;            /* pixel position for this image */
  39.     UBYTE    nPlanes;        /* number of bit planes */
  40.     Masking masking;
  41.     Compression compression;
  42.     UBYTE    pad1;            /* unused */
  43.     UWORD    transparentColour;    /* transparent colour number */
  44.     UBYTE    xAspect, yAspect;    /* pixel aspect, a ratio width:height */
  45.     WORD    pageWidth, pageHeight;    /* source page size in pixels */
  46. } BitMapHeader;
  47.  
  48. typedef struct {
  49.     UBYTE red,green,blue;
  50. } ColourRegister;
  51.  
  52. typedef struct {
  53.     ColourRegister *luts;        /* pointer to look up table */
  54.     WORD numLuts;            /* number of luts entries */
  55. } LutTable;
  56.  
  57. typedef struct {
  58.     WORD x,y;            /* relative coordinates */
  59. } Point2D;
  60.  
  61. typedef struct {
  62.     UBYTE depth;            /* # of bitplanes in original source */
  63.     UBYTE pad1;            /* unused... put zero here */
  64.     UWORD planePick;        /* how to scatter src into dest */
  65.     UWORD planeOnOff;        /* default bitplane data for above */
  66.     UWORD planeMask;        /* which bitplanes to store into */
  67. } DestMerge;
  68.  
  69. typedef UWORD SpritePrecedence;     /* relative precedence, 0 is highest */
  70.  
  71.  
  72. typedef struct _gim_pic {
  73.     BitMapHeader    bmh;    /* info for this bitmap */
  74.     SHORT        xsize;    /* actual width in pixels */
  75.     void        *memhead;    /* memory-chain allocated for this picture */
  76.     struct BitMap   *bm;    /* pointer to bitmap struct */
  77.     struct ColorMap colormap;    /* actual instance; .ColorTable -> colours */
  78.     ULONG        myflags;    /* flags about the bitmap */
  79.     struct _gim_pic *next;    /* next picture (for future use) */
  80. } PICTURE;
  81.  
  82.  
  83. /***
  84.     flags for gimmePicture()
  85.     ==> see flags for gimmeBitPlanes() in <gimmelib/bitplane.h>
  86. ***/
  87.  
  88. #endif !GIMMELIB_PICTURE_H
  89.