home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / libs / prooflibrary_21 / includes / proof / proof.h < prev   
Encoding:
C/C++ Source or Header  |  1999-03-12  |  9.0 KB  |  200 lines

  1. #ifndef PROOF_H
  2. #define PROOF_H
  3.  
  4. /*
  5. **    $VER: proof.h 2.0 (2.3.99)
  6. **
  7. **    Public structures and defintions for proof.library.
  8. **
  9. **    Trailing values:
  10. **        B - Bit
  11. **        F - Flag (bit value)
  12. **        V - Value
  13. */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include "exec/types.h"
  17. #endif
  18.  
  19. #ifndef DOS_DOS_H
  20. #include <dos/dos.h>
  21. #endif
  22.  
  23. #ifndef UTILITY_TAGITEM_H
  24. #include <utility/tagitem.h>
  25. #endif
  26.  
  27. /*========================================================================*/
  28. /* ProofHeader - Version */
  29. #define PROOF_VERSION (1)
  30.  
  31. /* ProofHeader - BodyType */
  32. #define PHBV_CUSTOM 0 /* Data in PBDY is in a user defined format */
  33. #define PHBV_JFIF 1 /* Data in PBDY is in jfif format */
  34.  
  35. /*========================================================================*/
  36. /* ProofDescription  - ImageType */
  37. enum
  38. {
  39.     PDIV_UNKNOWN = 0, PDIV_ANIM, PDIV_BMP, PDIV_FAXX, PDIV_GIF, PDIV_ICON, PDIV_ILBM, PDIV_IFF24, PDIV_JPEG,
  40.     PDIV_MACPAINT, PDIV_PBM, PDIV_PCD, PDIV_PCX, PDIV_PICT, PDIV_PNG, PDIV_POSTSCRIPT, PDIV_TARGA,
  41.     PDIV_TIFF, PDIV_YCRCB, PDIV_YUVN, PDIV_SCREEN, PDIV_MPEG, PDIV_DATATYPE
  42. };
  43. // These MUST remain the same as image.library
  44.  
  45. /* ProofDescription - Format (bits/flags) */
  46. #define PDFB_PLANAR 0
  47. #define PDFB_CHUNKY 1
  48. #define PDFB_HAM6 2
  49. #define PDFB_HALFBRITE 3
  50. #define PDFB_HAM8 4
  51. #define PDFB_24BIT 5
  52. #define PDFB_PALETTE 6
  53. #define PDFB_GREY 7
  54.  
  55. #define PDFF_PLANAR (1L << PDFB_PLANAR) /* Image data is planar */
  56. #define PDFF_CHUNKY (1L << PDFB_CHUNKY) /* Image data is chunky */
  57. #define PDFF_HAM6 (1L << PDFB_HAM6) /* Image data is HAM6 */
  58. #define PDFF_HALFBRITE (1L << PDFB_HALFBRITE) /* Image data is HALFBRITE */
  59. #define PDFF_HAM8 (1L << PDFB_HAM8) /* Image data is HAM8 */
  60. #define PDFF_24BIT (1L << PDFB_24BIT) /* Image data is 24bit */
  61. #define PDFF_PALETTE (1L << PDFB_PALETTE) /* Image data is palette mapped */
  62. #define PDFF_GREY (1L << PDFB_GREY) /* Image data is greyscale */
  63.  
  64. /* Flags/Depth example:
  65.  
  66.     NOTE: for planar images, the depth is the number of planes, not the
  67.                 number of colours.
  68.  
  69.     PDFF_PLANAR and 2 == 4 colour planar image
  70.  
  71.     PDFF_PLANAR | PDFF_HAM8 and 8 == 256 colour planar image in HAM8 mode.
  72.  
  73.     PDFF_CHUNKY and 24 == 24 Bit RGB pixels.
  74.  
  75.     PDFF_CHUNKY and 18 == 18 Bit RGB pixels.
  76.  
  77.     PDFF_PLANAR and 24 == 24 Bit planar (IFF24).
  78.  
  79.     If PDFF_PALETTE is set, then the image is palette mapped, eg gif
  80.  
  81.     If PDFF_GREY is set, the the image is greyscale and not colour.
  82. */
  83.  
  84. /* Image category:
  85.     There are four groups.
  86.     There are 22 bits reserved for categories.
  87.     Each proof can be subscribed to ONE group and ANY number of categories.
  88. */
  89.  
  90. /*========================================================================*/
  91. /* Proof structure */
  92. struct Proof
  93. {
  94.     ULONG ptr; // Private!
  95. };
  96.  
  97. /*========================================================================*/
  98. /* ProofOwner */
  99. struct ProofOwner
  100. {
  101.     ULONG ptr; // Private!
  102. };
  103.  
  104. #define POWN_GROUP_NAME -1 /* Category number for a group name */
  105.  
  106. /*========================================================================*/
  107. /* Proof tag values */
  108. #define PFN_TB ( TAG_USER + 0x80000 )
  109.  
  110. /* ProofHeader tags */
  111. #define PFN_ProofWidth (PFN_TB + 1) /* Height of proof (0..255) [ISG] (UBYTE *, UBYTE) */
  112. #define PFN_ProofHeight (PFN_TB + 2) /* Width of proof (0..255) [ISG] (UBYTE *, UBYTE) */
  113. #define PFN_ProofAspectX (PFN_TB + 3) /* X:Y aspect ratio of proof [ISG] (WORD *, WORD) */
  114. #define PFN_ProofAspectY (PFN_TB + 4) /* X:Y aspect ratio of proof [ISG] (WORD *, WORD) */
  115. #define PFN_ProofQuestionable (PFN_TB + 5) /* Equivilant to PHDF_QUESTIONABLE [ISG] (BOOL *, BOOL) */
  116. #define PFN_ProofBodyType (PFN_TB + 6) /* Format to store proof image data [I] */
  117. #define PFN_ProofBodyFlags (PFN_TB + 7) /* Additional flags for BodyType [ISG] */
  118.  
  119. /* ProofDescription tags */
  120. #define PFN_ImageWidth (PFN_TB + 20) /* Height of original image [ISG] (ULONG *, ULONG) */
  121. #define PFN_ImageHeight (PFN_TB + 21) /* Width of original image [ISG] (ULONG *, ULONG) */
  122. #define PFN_ImageFileSize (PFN_TB + 22) /* File size of original image [ISG] (ULONG *, ULONG) */
  123. #define PFN_ImageType (PFN_TB + 23) /* Pass in an ImageType [ISG] (UBYTE *, UBYTE) */
  124. #define PFN_ImageDepth (PFN_TB + 24) /* Depth of original image [ISG] (UBYTE *, UBYTE) */
  125. #define PFN_ImageGroup (PFN_TB + 25) /* Pass in a group (0..3) [ISG] */
  126. #define PFN_ImageCategory (PFN_TB + 26) /* Pass in a category (22 bits) [ISG] */
  127. #define PFN_ImagePlanar (PFN_TB + 27) /* Equivilant to TDSL_PLANAR [ISG] */
  128. #define PFN_ImageChunky (PFN_TB + 28) /* Equivilant to TDSL_CHUNKY [ISG] */
  129. #define PFN_ImageHAM6 (PFN_TB + 29) /* Equivilant to TDSL_HAM6 [ISG] */
  130. #define PFN_ImageHalfBrite (PFN_TB + 30) /* Equivilant to TDSL_HALFBRITE [ISG] */
  131. #define PFN_ImageHAM8 (PFN_TB + 31) /* Equivilant to TDSL_HAM8 [ISG] */
  132. #define PFN_Image24Bit (PFN_TB + 32) /* Equivilant to TDSL_24BIT [ISG] */
  133. #define PFN_ImageFormat (PFN_TB + 33) /* Bulk definitions of ProofDescription->Format. Pass in PDFF_? values [ISG] (UBYTE *, UBYTE) */
  134. #define PFN_CategoryOwner (PFN_TB + 34) /* Category owner ID [ISG] (UBYTE *, UBYTE) */
  135.  
  136. /* LoadThumbnail() tags */
  137. #define PFN_AllowPhotoAlbum PFN_TB + 40 /* Allow photoalbum jpeg thumbnail compatibilty [] (BOOL) */
  138. #define PFN_TestProofByProtection PFN_TB + 41 /* If TRUE, use the protection bits to determine a proof file (negates PFN_AllowPhotoAlbum) [] (BOOL) */
  139.  
  140. /* SaveThumbnail() tags */
  141. #define PFN_ImageName PFN_TB + 50 /* DOS filename of original image [ISG] (char **, char *) */
  142. #define PFN_ImagePath PFN_TB + 51 /* Path of original image [ISG] (char **, char *) */
  143. #define PFN_ImagePathName PFN_TB + 52 /* Path and name of original image; combines ImageName and ImagePath tags [IS] (char *) */
  144. #define PFN_ProofPath PFN_TB + 53 /* Path to store proof [] */
  145. #define PFN_Comment PFN_TB + 54 /* Comment associated with the proof [ISG] (char **, char *) */
  146. #define PFN_DescriptionChunk PFN_TB + 55 /* Store a description chunk [] */
  147. #define PFN_RGBTripletBuffer PFN_TB + 56 /* Points to rgb triplet source buffer [] */
  148. #define PFN_CustomBuffer PFN_TB + 57 /* Points to source/dest buffer, for PHBV_CUSTOM [] (UBYTE **, UBYTE *) */
  149. #define PFN_CustomBufferSize PFN_TB + 58 /* Size in bytes of custom buffer, for PHBV_CUSTOM [] (ULONG *, ULONG) */
  150. #define PFN_JFIFQuality PFN_TB + 59 /* Quality of JFIF storage (passed onto jpeg.library) [] */
  151.  
  152. /* GetProofAttrs tags */
  153. #define PFN_ProofPathName PFN_TB + 70 /* Path and name of proof [G] (char **) */
  154. #define PFN_ProofVersion PFN_TB + 71 /* Version of proof structure [G] (UBYTE *) */
  155. #define PFN_ProofSaveable PFN_TB + 72 /* Is this proof saveable [G] (BOOL *) */
  156. #define PFN_TextImageType PFN_TB + 73 /* Returns pointer to a text descriptor of the original image [G] (char **) */
  157. #define PFN_TextImageDesc PFN_TB + 74 /* Copies into the supplied pointer a text descriptor of the image format [G] (char *) */
  158. #define PFN_ProofLinked PFN_TB + 75 /* Returns TRUE if the proof is linked [G] (BOOL *) */
  159.  
  160. /* Memory control tags */
  161. #define PFN_MemoryPool PFN_TB + 80 /* All de/allocs are on this memory pool [] (void *) */
  162.  
  163. /* Miscellaneous tags */
  164. #define PFN_UserData PFN_TB + 90 /* [ISG] Set/get user data */
  165.  
  166. /* ProofOwner tags */
  167. #define PFN_ProofOwnerID PFN_TB + 100 /* Owner ID of this ProofOwner structure [ISG] (UBYTE *, UBYTE) */
  168. #define PFN_ProofOwnerIdent PFN_TB + 101 /* An identification string for this ProofOwner structure [ISG] (char *, char **) */
  169. #define PFN_ProofOwnerName PFN_TB + 102 /* The filename to save into [] (char *) */
  170.  
  171. /*========================================================================*/
  172. /* Defined error return codes */
  173. #define PFERR_NONE 0 /* No error */
  174. #define PFERR_NOTPROOF 1 /* File is not a proof */
  175. #define PFERR_NOIFFPARSELIBRARY 2 /* iffparse.library isn't available */
  176. #define PFERR_NOIFFHANDLE 3 /* Can't allocate an IFF handle */
  177. #define PFERR_FILEEXISTS 4 /* Destination file already exists */
  178. #define PFERR_CANTCREATEFILE 5 /* Can't open destination file */
  179. #define PFERR_CANTCREATEIFFFILE 6 /* Can't attach IFF stream handler */
  180. #define PFERR_NOMEMORY 7 /* Can't allocate any memory */
  181. #define PFERR_CANTOPENFILE 8 /* Can't open the specified file */
  182. #define PFERR_BADIFFFORM 9 /* File has bad IFF structure - corrupted */
  183. #define PFERR_NOSOURCEBUFFER 10 /* No source buffer supplied */
  184. #define PFERR_NODESTBUFFER 11 /* No destination buffer pointer supplied */
  185. #define PFERR_NOTCUSTOM 16 /* Body data is not in a custom format */
  186. #define PFERR_CUSTOMBODY 17 /* Body data is in a custom format */
  187. #define PFERR_MISSINGTARGET 18 /* Missing or NULL target object in source taglist */
  188. #define PFERR_NOTLINKED 19 /* Proof does not contain a path link */
  189. #define PFERR_NOPROOFPTR 20 /* No proof pointer supplied */
  190. #define PFERR_CANTDECOMPRESS 21 /* Cant decompress the body data */
  191. #define PFERR_CANTCOMPRESS 22 /* Cant compress the body data */
  192. #define PFERR_NODESCRIPTOR 23 /* The proof hasnt got an image descriptor */
  193. #define PFERR_INCOMPATABLE 24 /* The original file is not save compatable  */
  194. #define PFERR_NOOWNERPTR 25 /* No proof owner pointer supplied */
  195. #define PFERR_NOTOWNER 26 /* File is not a proof owner file */
  196. #define PFERR_NOCATEGORYNAME 27 /* No category name supplied */
  197. #define PFERR_NOFREECATEGORY 28 /* No free category bits available in this group */
  198.  
  199. #endif /* PROOF_H */
  200.