home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Painting / HF-XIP40.LZX / XiPaint4.0 / Developer / Modules / libraries / multipic.h
Encoding:
C/C++ Source or Header  |  1994-11-23  |  9.0 KB  |  233 lines

  1.  
  2. /*
  3. **  This C include file was generated automatically
  4. **  from an assembly include file
  5. **  using I2H written by Henning Friedl.
  6. */
  7.  
  8. /* --------------------------------------------------------------------------- */
  9. /*  (v2) - this feature has been added in version 2 of multipic.library */
  10. /*  (v3) - this feature has been added in version 3 of multipic.library */
  11. /* --------------------------------------------------------------------------- */
  12. #define MULTIPIC_LIB_VERSION    (3)    /* the current version of multipic.library */
  13. /* --------------------------------------------------------------------------- */
  14. #define MP_TagBase    (TAG_USER+0x800)    /* Begin counting tags */
  15. /* --------------------------------------------------------------------------- */
  16. /* flags for MP_Open(): */
  17.  
  18. #define MPMODE_LOAD    (0)
  19. #define MPMODE_SAVE    (1)
  20. /* --------------------------------------------------------------------------- */
  21. /*  values for _pi_Type: */
  22. #define PFT_UNKNOWN    (0)    /* UNKNOWN image type, unable to load */
  23. #define PFT_ILBM    (1)    /* IFF ILBM */
  24. #define PFT_DEEP    (2)    /* IFF DEEP */
  25. #define PFT_BMP    (3)    /* BMP */
  26. #define PFT_RGB8    (4)    /* IFF RGB8 */
  27. #define PFT_RGBN    (5)    /* IFF RGBN */
  28. #define PFT_YUVN    (6)    /* IFF YUVN */
  29. #define PFT_VLAB    (7)    /* IFF VLAB, private VLab format */
  30. #define PFT_PGM    (8)    /* PGM */
  31. #define PFT_PPM    (9)    /* PPM */
  32. #define PFT_QRT    (10)    /* QRT */
  33. #define PFT_SUNRASTER    (11)    /* SUNRASTER */
  34. #define PFT_XIPAINT    (12)    /* XIPAINT, private VDPaint format */
  35. #define PFT_DATATYPE    (13)    /* see _pi_TypeName for current ascii identifier (v2) */
  36. #define PFT_PBM    (14)    /* IFF PBM (v2) */
  37. #define PFT_JPEG    (15)    /* JPEG (v2) */
  38.  
  39. /* values for _pi_Flags: */
  40. #define PIB_IFF    0
  41. #define PIF_IFF    0x00000001    /* image is stored in an IFF file format */
  42. #define PIB_PALETTE    1
  43. #define PIF_PALETTE    0x00000002    /* if set, a palette had been stored together */
  44. /*   with the image */
  45. #define PIB_TRUECOLOR    2
  46. #define PIF_TRUECOLOR    0x00000004    /* set if the image is true color */
  47. /* if at least one of PIF_PALETTE or */
  48. /*   PIF_TRUECOLOR is set, the image seems */
  49. /*   to be a color image. */
  50.  
  51. struct PicInfo {
  52.     LONG    pi_Flags;    /* see definitions above */
  53.     APTR    pi_FileName;    /* name of the file (provided to Open() ) */
  54.     APTR    pi_TypeName;    /* file type, ascii identifier */
  55.     WORD    pi_Type;    /* see PFT_xxx above */
  56. /* if this is PFT_UNKNOWN, multipic.library */
  57. /*   can not load the image (if it is one) */
  58.     WORD    pi_Width;    /* The width of the image. */
  59.     WORD    pi_Height;    /* The height of the image. */
  60.     WORD    pi_PageWidth;    /* The page width of the image. */
  61.     WORD    pi_PageHeight;    /* The page height of the image. */
  62.  
  63.     BYTE    pi_AspectX;    /* The X aspect of the image (0, if unknown) */
  64.     BYTE    pi_AspectY;    /* The Y aspect of the image (0, if unknown) */
  65.  
  66.     UWORD    pi_CMapEntries;    /* number of color values */
  67. /* 2..256 with 8 bit images */
  68. /* 0 or 256 with 24 bit true color images */
  69.     UWORD    pi_CMapSize_RGB;    /* memory size of the PT_RGB palette */
  70.     UWORD    pi_CMapSize_RRGGBB;    /* memory size of the PT_RRGGBB palette */
  71.     UWORD    pi_CMapSize_RGB4;    /* memory size of the PT_RGB4 palette */
  72.     UWORD    pi_CMapSize_RGB32;    /* memory size of the PT_RGB32 palette */
  73.     UWORD    pi_CMapSize_Res1;    /* currently always 0 */
  74.     UWORD    pi_CMapSize_Res2;    /* currently always 0 */
  75.  
  76.     UBYTE    pi_Depth;    /* 1..8,12,24,32 */
  77.     UBYTE    pi_BytesPerPixel;    /* 1, 3, 4 */
  78.  
  79.     UBYTE    pi_RedBits;    /* 1..8  \ */
  80.     UBYTE    pi_GreenBits;    /* 1..8   \ for TRUE-COLOR only */
  81.     UBYTE    pi_BlueBits;    /* 1..8   /   otherwise 0 */
  82.     UBYTE    pi_AlphaBits;    /* 1..8  / */
  83.     UBYTE    pi_Reserved1Bits;    /* currently always 0 */
  84.     UBYTE    pi_Reserved2Bits;    /* currently always 0 */
  85.  
  86.     UWORD    pi_LeftEdge;    /* (v3) */
  87.     UWORD    pi_TopEdge;    /* (v3) */
  88.  
  89. };
  90. /* --------------------------------------------------------------------------- */
  91. struct PicHandle {
  92.     ULONG    ph_Private;
  93. };
  94. /* --------------------------------------------------------------------------- */
  95. /*  values for MP_ReadPalette: */
  96.  
  97. #define PT_RGB    (0)
  98. #define PT_RRGGBB    (1)    /* not yet */
  99. #define PT_RGB4    (2)    /* not yet */
  100. #define PT_RGB32    (3)    /* not yet */
  101. /* --------------------------------------------------------------------------- */
  102. /*  Flags for BAT_Flags: */
  103. #define BAB_MERGEPALETTE    0
  104. #define BAF_MERGEPALETTE    0x00000001    /* recalculate 24 bit true color data */
  105. /*   if a palette is present */
  106. /*   currently not yet implemented */
  107.  
  108. /* --------------------------------------------------------------------------- */
  109. /* Tags for MP_SetBufferAttrs(): */
  110.  
  111. #define BAT_Inc    (MP_TagBase+1)
  112. #define BAT_RedInc    (MP_TagBase+2)
  113. #define BAT_GreenInc    (MP_TagBase+3)
  114. #define BAT_BlueInc    (MP_TagBase+4)
  115. #define BAT_AlphaInc    (MP_TagBase+5)
  116. #define BAT_DefaultAlphaValue    (MP_TagBase+6)
  117. #define BAT_Flags    (MP_TagBase+7)
  118. #define BAT_LeftEdge    (MP_TagBase+8)
  119. #define BAT_TopEdge    (MP_TagBase+9)
  120. #define BAT_Width    (MP_TagBase+10)
  121. #define BAT_Mod    (MP_TagBase+11)
  122. #define BAT_RedMod    (MP_TagBase+12)
  123. #define BAT_GreenMod    (MP_TagBase+13)
  124. #define BAT_BlueMod    (MP_TagBase+14)
  125. #define BAT_AlphaMod    (MP_TagBase+15)
  126. #define BAT_MergePalette    (MP_TagBase+16)    /* (default: off) (v3) */
  127.  
  128. /*  values for BAT_MergePalette: */
  129. #define MERGEPALETTEB_CMAP    0
  130. #define MERGEPALETTEF_CMAP    0x00000001    /* merge image data with CMAP */
  131. #define MERGEPALETTEB_CLUT    1
  132. #define MERGEPALETTEF_CLUT    0x00000002    /* merge image data with CLUT */
  133.  
  134. #define MERGEOFF    (0)    /* OBSOLETE, do not use */
  135. #define MERGECMAP    (MERGEPALETTEF_CMAP)    /* OBSOLETE, do not use */
  136. #define MERGECLUT    (MERGEPALETTEF_CLUT)    /* OBSOLETE, do not use */
  137. /* --------------------------------------------------------------------------- */
  138. /*  Tags for MP_SetImageAttrs(): */
  139.  
  140. #define IAT_Type    (MP_TagBase+51)    /* the desired file format (see PFT_xxx above) */
  141. /*   (overrides IAT_Key) */
  142. #define IAT_Width    (MP_TagBase+52)
  143. #define IAT_Height    (MP_TagBase+53)
  144. #define IAT_PageWidth    (MP_TagBase+54)    /* Default: IAT_Width */
  145. #define IAT_PageHeight    (MP_TagBase+55)    /* Default: IAT_Height */
  146. #define IAT_Depth    (MP_TagBase+56)
  147.  
  148. #define IAT_Crunch    (MP_TagBase+57)    /* BOOL: crunch mode, Default: TRUE (v2) */
  149. #define IAT_Key    (MP_TagBase+58)    /* pointer to ascii key of the desired */
  150. /*   file format (v2) */
  151. #define IAT_AspectX    (MP_TagBase+59)    /* Default: 1 (v2) */
  152. #define IAT_AspectY    (MP_TagBase+60)    /* Default: 1 (v2) */
  153.  
  154. #define IAT_LeftEdge    (MP_TagBase+61)    /* Default: 0 (v2) */
  155. #define IAT_TopEdge    (MP_TagBase+62)    /* Default: 0 (v2) */
  156.  
  157. #define IAT_RedBits    (MP_TagBase+63)    /* Default: 8 (v2) */
  158. #define IAT_GreenBits    (MP_TagBase+64)    /* Default: 8 (v2) */
  159. #define IAT_BlueBits    (MP_TagBase+65)    /* Default: 8 (v2) */
  160. #define IAT_AlphaBits    (MP_TagBase+66)    /* Default: 8 (v2) */
  161.  
  162. /* --------------------------------------------------------------------------- */
  163. /* values for _fi_Flags: */
  164.  
  165. #define FIB_LOAD    0
  166. #define FIF_LOAD    0x00000001    /* can load images (crunched, uncrunched or both) */
  167. #define FIB_LOADCRUNCHED    1
  168. #define FIF_LOADCRUNCHED    0x00000002    /* can load crunched images */
  169. #define FIB_LOADUNCRUNCHED    2
  170. #define FIF_LOADUNCRUNCHED    0x00000004    /* can load uncrunched images */
  171. #define FIB_SAVE    3
  172. #define FIF_SAVE    0x00000008    /* can save images (crunched, uncrunched or both) */
  173. #define FIB_SAVECRUNCHED    4
  174. #define FIF_SAVECRUNCHED    0x00000010    /* can save crunched images */
  175. #define FIB_SAVEUNCRUNCHED    5
  176. #define FIF_SAVEUNCRUNCHED    0x00000020    /* can save uncrunched images */
  177. #define FIB_LOSSY    6
  178. #define FIF_LOSSY    0x00000040    /* crunched images loose information (JPEG, ...) */
  179. #define FIB_TRUECOLOR    7
  180. #define FIF_TRUECOLOR    0x00000080    /* can load/save true color images */
  181. #define FIB_ALPHA    8
  182. #define FIF_ALPHA    0x00000100    /* supports alpha channel */
  183. #define FIB_PROPERTY    9
  184. #define FIF_PROPERTY    0x00000200    /* supports property chunks (v3) */
  185.  
  186. struct FormatInfo {
  187.     struct    Node Node;
  188. /* LN_NAME points to 'ILBM', 'BMP', ... */
  189.     BYTE    fi_Type;    /* see: PFT_xxx */
  190.     BYTE    fi_CrunchModes;    /* (v3) */
  191.     ULONG    fi_Flags;    /* see definitions above */
  192.     APTR    fi_TypeName;    /* ascii string (v3) */
  193.  
  194. };
  195. /* --------------------------------------------------------------------------- */
  196. /*  possible error codes: */
  197.  
  198. #define EC_OK    (0)
  199. #define EC_INTERNAL    (1)
  200. #define EC_DOS    (2)
  201.  
  202. #define EC_OUT_OF_MEMORY    (3)
  203. #define EC_COULD_NOT_GET_INFORMATION    (4)
  204. #define EC_NO_IFFPARSE_LIB    (5)
  205. #define EC_END_OF_FILE    (6)
  206. #define EC_PLANENUMBER_NOT_SUPPORTED    (7)
  207. #define EC_COMPRESSION_NOT_SUPPORTED    (8)
  208. #define EC_COMPRESSIONMODE_NOT_SUPPORTED    (9)
  209. #define EC_COMPRESSIONMODE_UNKNOWN    (10)
  210. #define EC_ALLOCIFF_FAILED    (11)
  211. #define EC_IFFERR_EOC    (12)
  212. #define EC_IFFERR_NO_SCOPE    (13)
  213. #define EC_IFFERR_READ    (14)
  214. #define EC_IFFERR_WRITE    (15)
  215. #define EC_IFFERR_SEEK    (16)
  216. #define EC_BAD_DATA    (17)
  217. #define EC_IFFERR_SYNTAX    (18)
  218. #define EC_IFFERR_NOT_IFF    (19)
  219. #define EC_IFFERR_NO_HOOK    (20)
  220. #define EC_SAVE_NOT_SUPPORTED    (21)
  221. #define EC_DATATYPE_FUNCTION_FAILED    (22)
  222. #define EC_NO_VLAB_LIB    (23)
  223. #define EC_BITMAPHEADER_NOT_FOUND    (24)
  224. #define EC_UNKNOWN_FILETYPE    (25)
  225. #define EC_BAD_PALETTE    (26)
  226. #define EC_BAD_IMAGEATTRS    (27)
  227. /* --------------------------------------------------------------------------- */
  228. /*  You may use this macro to call the functions in multipic.library. To avoid */
  229. /*  conflicts with existing functions, they have a slightly unusual name (MP_xxx). */
  230. /* --------------------------------------------------------------------------- */
  231.  
  232. /* --------------------------------------------------------------------------- */
  233.