home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 274.lha / SimGen_Src / PICTURE.h < prev    next >
C/C++ Source or Header  |  1989-07-26  |  4KB  |  129 lines

  1. /*
  2.  * Picture Header file.
  3.  *
  4.  * Author: Gregg A. Tavares
  5.  *       : Echidna
  6.  *   Date: January 11, 1989
  7.  */
  8.  
  9. #ifndef PICTURE_H
  10. #define PICTURE_H
  11.  
  12. #include <exec/types.h>
  13. #include <graphics/rastport.h>
  14. #include "rectcopy.h"
  15.  
  16. /*
  17. ** TYPE: CycleRange
  18. **
  19. ** type to keep track of color cycling ranges like those used in DPaintII
  20. */
  21. typedef struct {
  22.    APTR        NextRange;
  23. /* CycleRange    *NextRange; */
  24.    WORD        pad1;   /* future exp - store 0 here */
  25.    WORD        rate;   /* 60/sec=16384, 30/sec=8192, 1/sec=16384/60=273 */
  26.    WORD        active; /* lo bit 0=no cycle, 1=yes; next bit 1=rvs */
  27.    UBYTE    low;    /* range lower */
  28.    UBYTE    high;   /* range upper */
  29.    } CycleRange;
  30.  
  31. /*
  32. ** TYPE: Picture
  33. **
  34. ** used to keep track of a picture or "image" with no transparency
  35. */
  36.  
  37. #define maxColorReg 32
  38.  
  39. typedef struct {
  40.     struct    RastPort    RastPort;    /* Rastport for Picture    */
  41.     struct    BitMap        BitMap;        /* BitMap for Picture    */
  42.     WORD            Left;        /* Hot Spot        */
  43.     WORD            Top;        /* Hot Spot        */
  44.     WORD            Width;        /* Width in pixels    */
  45.     WORD            Height;        /* Height in pixels    */
  46.     UBYTE            Depth;        /* Depth in BitPlanes    */
  47.     UBYTE            TransparentColor; /* ---        */
  48.     WORD            NumberOfColors;    /* Num of colors loaded */
  49.     UWORD            Colors[maxColorReg]; /* Colors        */
  50.     BOOL            CAMGFlag;    /* TRUE if CAMG found    */
  51.     ULONG            ViewModes;    /* ViewModes from CAMG    */
  52.     UBYTE            xAspect, yAspect; /* display aspect    */
  53.     WORD            pageWidth, pageHeight; /* page size    */
  54.     CycleRange        *CycleRanges;    /* Linked list of cycles*/
  55. } Picture;
  56.  
  57. #define    PicWidth(pic)        ((pic)->Width)
  58. #define    PicHeight(pic)        ((pic)->Height)
  59. #define    PicDepth(pic)        ((pic)->Depth)
  60. #define    PicColorMap(pic)    ((pic)->Colors)
  61. #define    PicColors(pic)        ((pic)->NumberOfColors)
  62. #define    PicHotX(pic)        ((pic)->Left)
  63. #define PicHotY(pic)        ((pic)->Top)
  64. #define PicValidModes(pic)    ((pic)->CAMGFlag)
  65. #define    PicViewModes(pic)    ((pic)->ViewModes)
  66. #define    PicCycleRanges(pic)    ((pic)->CycleRanges)
  67. #define PicTColor(pic)        ((pic)->TransparentColor)
  68.  
  69. /*
  70. ** TYPE: Shape
  71. **
  72. ** keeps track of a Shape, an image with transparency
  73. */
  74.  
  75. typedef struct {
  76.     struct RastPort    MaskRp;
  77.     struct BitMap    MaskBm;
  78.     Picture        *Pic;
  79. } Shape;
  80.  
  81. #define ShapePic(shape)            ((shape)->Pic)
  82. #define    ShapeWidth(shape)        (PicWidth((shape)->Pic))
  83. #define    ShapeHeight(shape)        (PicHeight((shape)->Pic))
  84. #define    ShapeDepth(shape)        (PicDepth((shape)->Pic)
  85. #define    ShapeColorMap(shape)        (PicColorMap((shape)->Pic))
  86. #define ShapeColors(shape)        (PicColors((shape)->Pic))
  87. #define    ShapeHotX(shape)        (PicHotX((shape)->Pic))
  88. #define ShapeHotY(shape)        (PicHotY((shape)->Pic))
  89. #define ShapeValidModes(shape)        (PicValidModes((shape)->Pic))
  90. #define ShapeViewModes(shape)        (PicViewModes((shape)->Pic))
  91. #define ShapeCycleRanges(shape)        (PicCycleRanges((shape)->Pic))
  92.  
  93. /*
  94. ** TYPE: NewImage
  95. **
  96. ** Passed to image loading function when loading a picture
  97. */
  98.  
  99. #define    NI_GETCYCLES    (1L << 0)
  100. #define NI_GETVIEWMODES    (1L << 1)
  101. #define NI_GETCOLORS    (1L << 2)
  102. #define NI_CREATEPIC    (1L << 3)
  103. #define NI_USEBITMAP    (1L << 4)
  104. #define NI_CLIPIMAGE    (1L << 5)
  105. #define NI_CREATESHAPE    (1L << 6)
  106.  
  107. typedef struct {
  108.     char    *Name;        /* filename of image            */
  109.     ULONG    Flags;        /* loading flags            */
  110.     APTR    ImagePtr;    /* Pointer to BitMap or RastPort    */
  111.     WORD    FLeft, FTop;    /* Position to load from        */
  112.     WORD    Left, Top;    /* Position to load at            */
  113.     WORD    Width, Height;    /* Amount to load            */
  114. } NewImage;
  115.  
  116. /*
  117. ** TYPE ImageRequest;
  118. **
  119. ** Used to request a list of images.
  120. */
  121. typedef struct {
  122. } ImageRequest;
  123.  
  124. extern    UWORD        *LoadPic ();
  125. extern    Picture        *CreatePic ();
  126. extern    Shape        *CreateShape ();
  127.  
  128. #endif
  129.