home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ImageManager / Developer / libraries / ImageManager.h
C/C++ Source or Header  |  2000-01-27  |  5KB  |  277 lines

  1. #ifndef LIBRARIES_IMAGEMANAGER_H
  2. #define LIBRARIES_IMAGEMANAGER_H
  3. /*
  4. **    $VER: ImageManager.h 1.1 (27.01.00)
  5. */
  6.  
  7. #ifndef UTILITY_TAGITEM_H
  8. #include <utility/tagitem.h>
  9. #endif
  10.  
  11.  
  12. enum
  13. {
  14.     IMC_NewObject = 0x10000,
  15.     IMC_CustomObject,
  16.     IMC_EndChain
  17. };
  18.  
  19. enum
  20. {
  21.     IMV_ExtDecoder_Base        = TAG_USER +  0*256,
  22.     IMV_Base                        = TAG_USER +  1*256,
  23.     IMV_Container_Base        = TAG_USER +  2*256,
  24.     IMV_Decoder_Base            = TAG_USER +  3*256,
  25.     IMV_File_Base                = TAG_USER +  4*256,
  26.     IMV_FSDither_Base            = TAG_USER +  5*256,
  27.     IMV_OrderedDither_Base    = TAG_USER +  6*256,
  28.     IMV_Probe_Base                = TAG_USER +  7*256,
  29.     IMV_RandomDither_Base    = TAG_USER +  8*256,
  30.     IMV_Raster_Base            = TAG_USER +  9*256,
  31.     IMV_Remap_Base                = TAG_USER + 10*256,
  32.     IMV_ScaleX_Base            = TAG_USER + 11*256,
  33.     IMV_ScaleY_Base            = TAG_USER + 12*256,
  34.     IMV_Bitmap_Base            = TAG_USER + 13*256,
  35.  
  36.     IMV_NumberOfBases
  37. };
  38.  
  39. enum
  40. {
  41.     IMM_ExtDecoder_ReceiveData = IMV_ExtDecoder_Base,
  42.     IMM_ExtDecoder_NewFrame,
  43.     IMM_ExtDecoder_SendLine,
  44.     IMM_ExtDecoder_EndFrame,
  45.  
  46.     IMM_ExtDecoder_Error,
  47.     IMM_ExtDecoder_Warning,
  48.  
  49.     IMA_ExtDecoder_Gamma,                /* ULONG, gamma correction value */
  50.     IMA_ExtDecoder_BGColour,            /* 0x00RRGGBB - for PNG */
  51.  
  52.     IMA_ExtDecoder_ReducedProgressiveness,
  53.  
  54.     IMV_ExtDecoder_NumberOf
  55. };
  56.  
  57. enum
  58. {
  59.     IMA_Container_Screen = IMV_Container_Base,
  60.     IMA_Container_ColourCube,
  61.     IMA_Container_ReleaseColourCube,
  62.  
  63.     IMV_Container_NumberOf
  64. };
  65.  
  66. enum
  67. {
  68.     IMM_NewFrame = IMV_Base,
  69.     IMM_ReceiveData,
  70.     IMM_EndFrame,
  71.     IMM_Abort,
  72.  
  73.     IMA_Next,
  74.  
  75.     IMV_NumberOf
  76. };
  77.  
  78. enum
  79. {
  80.     IMM_FSDither_CacheLine = IMV_FSDither_Base,
  81.     IMM_FSDither_FreeCacheLine,
  82.     IMM_FSDither_NewErrorLine,
  83.     IMM_FSDither_FreeErrorLine,
  84.  
  85.     IMA_FSDither_ColourCube,
  86.  
  87.     IMV_FSDither_NumberOf
  88. };
  89.  
  90. enum
  91. {
  92.     IMA_Remap_ColourCube = IMV_Remap_Base,
  93.  
  94.     IMV_Remap_NumberOf
  95. };
  96.  
  97. enum
  98. {
  99.     IMA_Probe_NewFrameHook = IMV_Probe_Base,
  100.     IMA_Probe_ReceiveDataHook,
  101.     IMA_Probe_EndFrameHook,
  102.  
  103.     IMA_Probe_NunberOf
  104. };
  105.  
  106. enum
  107. {
  108.     IMM_File_Load = IMV_File_Base,
  109.  
  110.     IMA_File_BufferSize,
  111.  
  112.     IMV_File_NumberOf
  113. };
  114.  
  115. enum
  116. {
  117.     IMA_ScaleX_Width = IMV_ScaleX_Base,
  118.     IMA_ScaleX_Percent,
  119.  
  120.     IMA_ScaleX_NunberOf
  121. };
  122.  
  123. enum
  124. {
  125.     IMA_Raster_RastPort = IMV_Raster_Base,
  126.     IMA_Raster_Left,
  127.     IMA_Raster_Top,
  128.     IMA_Raster_Right,
  129.     IMA_Raster_Bottom,
  130.     IMA_Raster_OffsetX,
  131.     IMA_Raster_OffsetY,
  132.  
  133.     IMV_Raster_NumberOf
  134. };
  135.  
  136. enum
  137. {
  138.     IMA_ScaleY_Height = IMV_ScaleY_Base,
  139.     IMA_ScaleY_Percent,
  140.  
  141.     IMM_ScaleY_Interpolate,    /* Private */
  142.  
  143.     IMV_ScaleY_NunberOf
  144. };
  145.  
  146. enum
  147. {
  148.     IMA_Bitmap_Bitmap = IMV_Bitmap_Base,
  149.     IMA_Bitmap_Friend,
  150.  
  151.     IMV_Bitmap_NumberOf
  152. };
  153.  
  154. /* IMM_Error & IMM_Warning */
  155. struct IMP_ExtDecoder_Message
  156. {
  157.     ULONG MethodID;
  158.     STRPTR String;
  159.     APTR Parms;
  160. };
  161.  
  162. /* You're sent data with this method. */
  163. struct IMP_ExtDecoder_ReceiveData
  164. {
  165.     ULONG MethodID;
  166.     UBYTE *Buffer;
  167.     ULONG Length;
  168.     ULONG Flags;
  169. };
  170.  
  171. /* When you know the dimensions of the image
  172.    (or frame for animations) then you invoke
  173.    this method on yourself. */
  174. struct IMP_ExtDecoder_NewFrame
  175. {
  176.     ULONG MethodID;
  177.     ULONG Width, Height;
  178.     struct TagItem Tags; /* see below for definitions */
  179. };
  180.  
  181. enum
  182. {
  183.     NFA_Transparency = TAG_USER, /* see below */
  184.     NFA_Background, /* background colour of image */
  185.  
  186.     /* Following tags are for animations */
  187.     NFA_ScrWidth,
  188.     NFA_ScrHeight,
  189.     NFA_LeftOfs,
  190.     NFA_TopOfs,
  191.     NFA_FrameDelay,
  192.     NFA_FrameDisposal,
  193.     NFA_LoopCount,
  194.  
  195.     NFA_NumberOf
  196. };
  197.  
  198. enum
  199. {
  200.     TransparencyNONE = 0, /* The image does not contain transparent colours */
  201.     TransparencySINGLE,     /* The image has a monochrome mask ( A = 0x00 | 0xFF ) */
  202.     TransparencyALPHA         /* The image has a complex mask ( 0x00 <= A <= 0xFF ) */
  203. };
  204.  
  205. enum
  206. {
  207.     ProgressiveOmitNone = 0,
  208.     ProgressiveOmitIntermediate,
  209.     ProgressiveOmitAll
  210. };
  211.  
  212.  
  213. /* Whenever you have a line to output, you call this method */
  214. struct IMP_ExtDecoder_SendLine
  215. {
  216.     ULONG MethodID;
  217.     ULONG *LineBuffer;    /* Line buffer in RGBA format */
  218.     ULONG Y, Height;        /* Position and height of line - Height > 1 e.g. for interlaced GIFs */
  219.     ULONG Flags;            /* See below */
  220. };
  221.  
  222. #define IMB_ExtDecoder_SendLine_Draft         0   /* This line is just a rough draft, a new one will be outputed later, at same position */
  223. #define IMB_ExtDecoder_SendLine_KeepIntact    1   /* The owner of the buffer will need the line for further operations so make a copy if you need to destroy it */
  224.  
  225. #define IMF_ExtDecoder_SendLine_Draft        (1 << IMB_SendLine_Draft)
  226. #define IMF_ExtDecoder_SendLine_KeepIntact   (1 << IMB_SendLine_KeepIntact)
  227.  
  228. /* When the entire frame has been passed on then you invoke this method */
  229. struct IMP_ExtDecoder_EndFrame
  230. {
  231.     ULONG MethodID;
  232. };
  233.  
  234. struct IMP_NewFrame            { ULONG MethodID; ULONG Width, Height; struct TagItem *Tags; };
  235. struct IMP_EndFrame            { ULONG MethodID; };
  236. struct IMP_Abort                { ULONG MethodID; };
  237.  
  238. struct IMP_ReceiveData
  239. {
  240.     ULONG MethodID;
  241.     ULONG Type;
  242.     union
  243.     {
  244.         struct
  245.         {
  246.             UBYTE *Data;
  247.             ULONG Length;
  248.             ULONG Flags;
  249.         } Raw;
  250.  
  251.         struct
  252.         {
  253.             ULONG *RGBA;
  254.             LONG Width, Y, Height;
  255.             ULONG Flags;
  256.             UBYTE *Chunky;
  257.         } Pixels;
  258.     };
  259. };
  260.  
  261. enum
  262. {
  263.     IMV_ReceiveData_Type_Raw,
  264.     IMV_ReceiveData_Type_Pixels
  265. };
  266.  
  267. #define IMF_ReceiveData_Draft        (1 << 0)
  268. #define IMF_ReceiveData_KeepIntact   (1 << 1)
  269.  
  270. struct IMP_File_Load
  271. {
  272.     ULONG MethodID;
  273.     STRPTR Filename;
  274. };
  275.  
  276. #endif
  277.