home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / datatypes / animationclass.h next >
C/C++ Source or Header  |  1993-10-15  |  7KB  |  232 lines

  1. #ifndef    DATATYPES_ANIMATIONCLASS_H
  2. #define    DATATYPES_ANIMATIONCLASS_H
  3. /*
  4. **  $VER: animationclass.h 40.1 (4.5.93)
  5. **  Includes Release 40.15
  6. **
  7. **  Interface definitions for DataType animation objects.
  8. **
  9. **  (C) Copyright 1992-1993 Commodore-Amiga, Inc.
  10. **    All Rights Reserved
  11. */
  12.  
  13. #ifndef    UTILITY_TAGITEM_H
  14. #include <utility/tagitem.h>
  15. #endif
  16.  
  17. #ifndef    DATATYPES_DATATYPESCLASS_H
  18. #include <datatypes/datatypesclass.h>
  19. #endif
  20.  
  21. #ifndef    DATATYPES_PICTURECLASS_H
  22. #include <datatypes/pictureclass.h>
  23. #endif
  24.  
  25. #ifndef    DATATYPES_SOUNDCLASS_H
  26. #include <datatypes/soundclass.h>
  27. #endif
  28.  
  29. #ifndef    LIBRARIES_IFFPARSE_H
  30. #include <libraries/iffparse.h>
  31. #endif
  32.  
  33. /*****************************************************************************/
  34.  
  35. #define    ANIMATIONDTCLASS        "animation.datatype"
  36.  
  37. /*****************************************************************************/
  38.  
  39. /* Animation attributes */
  40. #define    ADTA_Dummy        (DTA_Dummy + 600)
  41. #define    ADTA_ModeID        PDTA_ModeID
  42. #define    ADTA_KeyFrame        PDTA_BitMap
  43.     /* (struct BitMap *) Key frame (first frame) bitmap */
  44.  
  45. #define    ADTA_ColorRegisters    PDTA_ColorRegisters
  46. #define    ADTA_CRegs        PDTA_CRegs
  47. #define    ADTA_GRegs        PDTA_GRegs
  48. #define    ADTA_ColorTable        PDTA_ColorTable
  49. #define    ADTA_ColorTable2    PDTA_ColorTable2
  50. #define    ADTA_Allocated        PDTA_Allocated
  51. #define    ADTA_NumColors        PDTA_NumColors
  52. #define    ADTA_NumAlloc        PDTA_NumAlloc
  53.  
  54. #define    ADTA_Remap        PDTA_Remap
  55.     /* (BOOL) : Remap animation (defaults to TRUE) */
  56.  
  57. #define    ADTA_Screen        PDTA_Screen
  58.     /* (struct Screen *) Screen to remap to */
  59.  
  60. #define    ADTA_NumSparse        PDTA_NumSparse
  61.     /* (UWORD) Number of colors used for sparse remapping */
  62.  
  63. #define    ADTA_SparseTable    PDTA_SparseTable
  64.     /* (UBYTE *) Pointer to a table of pen numbers indicating
  65.      * which colors should be used when remapping the image.
  66.      * This array must contain as many entries as there
  67.      * are colors specified with ADTA_NumSparse */
  68.  
  69. #define    ADTA_Width        (ADTA_Dummy + 1)
  70. #define    ADTA_Height        (ADTA_Dummy + 2)
  71. #define    ADTA_Depth        (ADTA_Dummy + 3)
  72. #define    ADTA_Frames        (ADTA_Dummy + 4)
  73.     /* (ULONG) Number of frames in the animation */
  74.  
  75. #define    ADTA_Frame        (ADTA_Dummy + 5)
  76.     /* (ULONG) Current frame */
  77.  
  78. #define    ADTA_FramesPerSecond    (ADTA_Dummy + 6)
  79.     /* (ULONG) Frames per second */
  80.  
  81. #define    ADTA_FrameIncrement    (ADTA_Dummy + 7)
  82.     /* (LONG) Amount to change frame by when fast forwarding or
  83.      * rewinding.  Defaults to 10. */
  84.  
  85. /* Sound attributes */
  86. #define    ADTA_Sample        SDTA_Sample
  87. #define    ADTA_SampleLength    SDTA_SampleLength
  88. #define    ADTA_Period        SDTA_Period
  89. #define    ADTA_Volume        SDTA_Volume
  90. #define    ADTA_Cycles        SDTA_Cycles
  91.  
  92. /*****************************************************************************/
  93.  
  94. #define ID_ANIM    MAKE_ID('A','N','I','M')
  95. #define ID_ANHD    MAKE_ID('A','N','H','D')
  96. #define ID_DLTA    MAKE_ID('D','L','T','A')
  97.  
  98. /*****************************************************************************/
  99.  
  100. /*  Required ANHD structure describes an ANIM frame */
  101. struct AnimHeader
  102. {
  103.     UBYTE     ah_Operation;    /*  The compression method:
  104.                      0    set directly (normal ILBM BODY),
  105.                      1    XOR ILBM mode,
  106.                      2    Long Delta mode,
  107.                      3    Short Delta mode,
  108.                      4    Generalized short/long Delta mode,
  109.                      5    Byte Vertical Delta mode
  110.                      6    Stereo op 5 (third party)
  111.                     74    (ascii 'J') reserved for Eric Graham's
  112.                     compression technique (details to be
  113.                     released later). */
  114.  
  115.     UBYTE     ah_Mask;    /* (XOR mode only - plane mask where each
  116.                    bit is set =1 if there is data and =0
  117.                    if not.) */
  118.  
  119.     UWORD     ah_Width;    /* (XOR mode only - width and height of the */
  120.     UWORD     ah_Height;    /* area represented by the BODY to eliminate */
  121.                 /* unnecessary un-changed data) */
  122.  
  123.  
  124.     WORD     ah_Left;    /* (XOR mode only - position of rectangular */
  125.     WORD     ah_Top;    /* area representd by the BODY) */
  126.  
  127.  
  128.     ULONG     ah_AbsTime;    /* Timing for a frame relative to the time
  129.                    the first frame was displayed, in
  130.                    jiffies (1/60 sec) */
  131.  
  132.     ULONG     ah_RelTime;    /* Timing for frame relative to time
  133.                    previous frame was displayed - in
  134.                    jiffies (1/60 sec) */
  135.  
  136.     UBYTE     ah_Interleave;    /* Indicates how may frames back this data is to
  137.                    modify.  0 defaults to indicate two frames back
  138.                    (for double buffering). n indicates n frames back.
  139.                    The main intent here is to allow values
  140.                    of 1 for special applications where
  141.                    frame data would modify the immediately
  142.                    previous frame. */
  143.  
  144.     UBYTE     ah_Pad0;    /* Pad byte, not used at present. */
  145.  
  146.     ULONG     ah_Flags;    /* 32 option bits used by options=4 and 5.
  147.                    At present only 6 are identified, but the
  148.                    rest are set =0 so they can be used to
  149.                    implement future ideas.  These are defined
  150.                    for option 4 only at this point.  It is
  151.                    recommended that all bits be set =0 for
  152.                    option 5 and that any bit settings
  153.                    used in the future (such as for XOR mode)
  154.                    be compatible with the option 4
  155.                    bit settings.   Player code should check
  156.                    undefined bits in options 4 and 5 to assure
  157.                    they are zero.
  158.  
  159.                    The six bits for current use are:
  160.  
  161.                     bit #    set =0            set =1
  162.                     ===============================================
  163.                     0        short data        long data
  164.                     1        set            XOR
  165.                     2        separate info        one info list
  166.                         for each plane        for all planes
  167.                     3        not RLC            RLC (run length coded)
  168.                     4        horizontal        vertical
  169.                     5        short info offsets    long info offsets
  170.                 */
  171.  
  172.     UBYTE     ah_Pad[16];    /* This is a pad for future use for future
  173.                    compression modes. */
  174. };
  175.  
  176. /*****************************************************************************/
  177.  
  178. #define    ADTM_Dummy        (0x700)
  179.  
  180. #define    ADTM_LOADFRAME        (0x701)
  181.     /* Used to load a frame of the animation */
  182.  
  183. #define    ADTM_UNLOADFRAME    (0x702)
  184.     /* Used to unload a frame of the animation */
  185.  
  186. #define    ADTM_START        (0x703)
  187.     /* Used to start the animation */
  188.  
  189. #define    ADTM_PAUSE        (0x704)
  190.     /* Used to pause the animation (don't reset the timer) */
  191.  
  192. #define    ADTM_STOP        (0x705)
  193.     /* Used to stop the animation */
  194.  
  195. #define    ADTM_LOCATE        (0x706)
  196.     /* Used to locate a frame in the animation (as set by a slider...) */
  197.  
  198. /*****************************************************************************/
  199.  
  200. /* ADTM_LOADFRAME, ADTM_UNLOADFRAME */
  201. struct adtFrame
  202. {
  203.     ULONG         MethodID;
  204.     ULONG         alf_TimeStamp;        /* Timestamp of frame to load */
  205.  
  206.     /* The following fields are filled in by the ADTM_LOADFRAME method, */
  207.     /* and are read-only for any other methods. */
  208.  
  209.     ULONG         alf_Frame;        /* Frame number */
  210.     ULONG         alf_Duration;        /* Duration of frame */
  211.  
  212.     struct BitMap    *alf_BitMap;        /* Loaded BitMap */
  213.     struct ColorMap    *alf_CMap;        /* Colormap, if changed */
  214.  
  215.     BYTE        *alf_Sample;        /* Sound data */
  216.     ULONG         alf_SampleLength;
  217.     ULONG         alf_Period;
  218.  
  219.     APTR         alf_UserData;        /* Used by load frame for extra data */
  220. };
  221.  
  222. /* ADTM_START, ADTM_PAUSE, ADTM_STOP, ADTM_LOCATE */
  223. struct adtStart
  224. {
  225.     ULONG         MethodID;
  226.     ULONG         asa_Frame;        /* Frame # to start at */
  227. };
  228.  
  229. /*****************************************************************************/
  230.  
  231. #endif    /* DATATYPES_ANIMATIONCLASS_H */
  232.