home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Hardware / ICS / Programmer / Include / ics / ics.h next >
Encoding:
C/C++ Source or Header  |  1999-09-27  |  7.2 KB  |  233 lines

  1. /*
  2. **      main include file for ics.library
  3. **
  4. **      (C) Copyright 1997 Wolf Faust
  5. **      All Rights Reserved.
  6. */
  7.  
  8. #ifndef _ICS_ICS_H
  9. #define _ICS_ICS_H
  10.  
  11. #include <inttypes.h>
  12.  
  13. // Error values 1 up to (including) ICS_ERRMSGLIMIT should not be displayed by application as ICS library already noticed the user
  14. #define ICS_ERRMSGLIMIT 199
  15.  
  16.  
  17. //
  18. // Color spaces
  19. //
  20. // The following color spaces are supported.
  21. // Gray, RGB, CMYK, XYZ, Yxy, Lab, generic 3 channel color spaces where
  22. // the profiles defines how to interpret the 3 channels, named color spaces
  23. // which can either be indices into the space or have color names, and
  24. // multichannel spaces with 1 byte per channel upto MAX_COLOR_CHANNELS.
  25. //
  26.  
  27. #define MAX_COLOR_CHANNELS  8   /* maximum number of color channels supported (mainly, but not only) by HIFI colors */
  28.  
  29. struct GRAYCOLOR {
  30.     int16_t gray;
  31. };
  32.  
  33. struct UGRAYCOLOR {
  34.     uint16_t    gray;
  35. };
  36.  
  37. struct RGBCOLOR {
  38.     int16_t    red;
  39.     int16_t    green;
  40.     int16_t    blue;
  41. };
  42.  
  43. struct URGBCOLOR {
  44.     uint16_t    red;
  45.     uint16_t    green;
  46.     uint16_t    blue;
  47. };
  48.  
  49. struct CMYKCOLOR {
  50.     int16_t    cyan;
  51.     int16_t    magenta;
  52.     int16_t    yellow;
  53.     int16_t    black;
  54. };
  55.  
  56. struct UCMYKCOLOR {
  57.     uint16_t    cyan;
  58.     uint16_t    magenta;
  59.     uint16_t    yellow;
  60.     uint16_t    black;
  61. };
  62.  
  63. struct XYZCOLOR {
  64.     int16_t    X;
  65.     int16_t    Y;
  66.     int16_t    Z;
  67. };
  68.  
  69. struct YxyCOLOR {
  70.     int16_t    Y;
  71.     int16_t    x;
  72.     int16_t    y;
  73. };
  74.  
  75. struct LabCOLOR {
  76.     int16_t    L;
  77.     int16_t    a;
  78.     int16_t    b;
  79. };
  80.  
  81. struct GENERIC3CHANNEL {
  82.     int16_t    ch1;
  83.     int16_t    ch2;
  84.     int16_t    ch3;
  85. };
  86.  
  87. struct NAMEDCOLOR {
  88.     int32_t dwIndex;
  89.     PSTR      pName;
  90. };
  91.  
  92. struct HiFiCOLOR {
  93.     int8_t   channel[MAX_COLOR_CHANNELS];
  94. };
  95.  
  96. typedef void * HANDLE;
  97.  
  98. typedef HANDLE HTRANSFORM;      /* handle to color transform object */
  99.  
  100. typedef union tagCOLOR {
  101.     struct GRAYCOLOR        gray;
  102.     struct UGRAYCOLOR       ugray;
  103.     struct RGBCOLOR         rgb;
  104.     struct URGBCOLOR        urgb;
  105.     struct CMYKCOLOR        cmyk;
  106.     struct UCMYKCOLOR       ucmyk;
  107.     struct XYZCOLOR         XYZ;
  108.     struct YxyCOLOR         Yxy;
  109.     struct LabCOLOR         Lab;
  110.     struct GENERIC3CHANNEL  gen3ch;
  111.     struct NAMEDCOLOR       named;
  112.     struct HiFiCOLOR        hifi;
  113. } COLOR;
  114. typedef COLOR *PCOLOR, *LPCOLOR;
  115.  
  116. typedef enum {
  117.     COLOR_GRAY       =   1,
  118.     COLOR_UGRAY,
  119.     COLOR_RGB,
  120.     COLOR_URGB,
  121.     COLOR_XYZ,
  122.     COLOR_Yxy,
  123.     COLOR_Lab,
  124.     COLOR_3_CHANNEL,        // int16_t per channel
  125.     COLOR_CMYK,
  126.     COLOR_UCMYK,
  127.     COLOR_5_CHANNEL,        // BYTE per channel
  128.     COLOR_6_CHANNEL,        //      - do -
  129.     COLOR_7_CHANNEL,        //      - do -
  130.     COLOR_8_CHANNEL,        //      - do -
  131.     COLOR_NAMED,
  132.     COLOR_HiFi,
  133.     COLOR_JCh,              // CIECAM 97s JCh color (currently only used internaly by library)
  134. } COLORTYPE;
  135.  
  136. typedef COLORTYPE *PCOLORTYPE, *LPCOLORTYPE;
  137.  
  138. //
  139. // Rendering Intents
  140. //
  141.  
  142. #define INTENT_PERCEPTUAL               0
  143. #define INTENT_RELATIVE_COLORIMETRIC    1
  144. #define INTENT_SATURATION               2
  145. #define INTENT_ABSOLUTE_COLORIMETRIC    3
  146.  
  147. // Used by SetICSMode()
  148.  
  149. #define ICS_OFF   1
  150. #define ICS_ON    2
  151. #define ICS_QUERY 3
  152.  
  153. // Macros to retrieve CMYK values
  154. #define GetKValue(cmyk)      ((uint8_t)(cmyk))
  155. #define GetYValue(cmyk)      ((uint8_t)((cmyk)>> 8))
  156. #define GetMValue(cmyk)      ((uint8_t)((cmyk)>>16))
  157. #define GetCValue(cmyk)      ((uint8_t)((cmyk)>>24))
  158.  
  159. #define CMYK(c,m,y,k)       ((uint32_t)((((uint8_t)(k)|((int16_t)((uint8_t)(y))<<8))|(((int32_t)(uint8_t)(m))<<16))|(((int32_t)(uint8_t)(c))<<24)))
  160.  
  161. #define TAG_ICSUSER   ((ULONG)(1L<<31))
  162.  
  163.  
  164.  
  165. // Flags used for ICS_TransferDevices tag
  166. #define ICS_INPUT_DEVICE        0x0001    /* Transform from input (scanner) to device (monitor) profile color */
  167. #define ICS_DEVICE_DEVICE        0x0002    /* Transform from device to device profile color (default) */
  168.  
  169. // Flags used for ICS_TransferDevices tag
  170.  
  171. //
  172. // The TagItem ID's (ti_Tag values) for CreateIDCTransform() follow.
  173. // They are values in a TagItem array passed as extension/replacement
  174. // values for the data in the IDC.
  175. // 
  176.  
  177. // 
  178. // Global basic Tags used supported by various functions
  179. // 
  180.  
  181.  
  182. #define ICS_Dummy    (TAG_ICSUSER)    /* 0x80000000    */
  183.  
  184. #define ICS_TextAttr  (ICS_Dummy + 0x01)   /* struct TextAttr *, a mono spaced font for use in the ICS gui */
  185. #define ICS_Screen    (ICS_Dummy + 0x02)   /* struct Screen *, Open the gui on the given screen pointer    */
  186.  
  187.  
  188. // 
  189. // Tags used for CreateIDCTransform()
  190. // 
  191.  
  192. #define ICS_TransDummy    (TAG_ICSUSER+0x6000)    /* 0x80006000    */
  193.  
  194. #define ICS_TransferDevices     (ICS_TransDummy + 0x01)   /* Describes the source and destination device */
  195. #define ICS_ScanTLCGray         (ICS_TransDummy + 0x02)   /* uint16_t **, Disables TLC correction and the lib will return a (uint16_t *) to the TLC table in the given address so that you can apply the TLC table (download to scanner) */
  196. #define ICS_ScanTLCRed          (ICS_TransDummy + 0x03)   /* uint16_t **, Disables TLC correction and the lib will return a (uint16_t *) to the TLC table in the given address so that you can apply the TLC table (download to scanner) */
  197. #define ICS_ScanTLCGreen        (ICS_TransDummy + 0x04)   /* If specified, you must use all ICS_SCANTLCRED, ICS_SCANTLCGREEN, ICS_SCANTLCBLUE together. */
  198. #define ICS_ScanTLCBlue         (ICS_TransDummy + 0x05)
  199.  
  200.  
  201. // 
  202. // Tags used for ICSStatusWin()  (and CreateIDCTransform()) 
  203. // 
  204.  
  205. #define ICS_StatDummy    (TAG_ICSUSER+0x8000)    /* 0x80008000    */
  206.  
  207. #define ICS_StatusOpen  (ICS_StatDummy + 0x01)  /* struct Screen *, Open status window with given screen pointer */
  208. #define ICS_StatusKeep  (ICS_StatDummy + 0x02)  /* BOOL, this flag only makes sense during a CreateIDCTransform() call and leaves the status window open for further use after the lib call */
  209. #define ICS_StatusClose (ICS_StatDummy + 0x03)  /* close status window */
  210. #define ICS_StatusTitle (ICS_StatDummy + 0x04)  /* PSTR, window title of status window */
  211. #define ICS_StatusText  (ICS_StatDummy + 0x05)  /* PSTR, text of status window */
  212. #define ICS_StatusProgress      (ICS_StatDummy + 0x06)  /* uint32_t, percentage complete value */
  213. #define ICS_StatusCheck         (ICS_StatDummy + 0x07)  /* percentage complete value */
  214. #define ICS_StatusDisableAbort  (ICS_StatDummy + 0x08)  /* BOOL, set to true if abort gadget is disabled */
  215. #define ICS_StatusAbortPtr      (ICS_StatDummy + 0x09)  /* uint32_t *, ics stores non-zero if user wants abort into var specified by given pointer */
  216. #define ICS_StatusActivate      (ICS_StatDummy + 0x0a)  /* BOOL, set to true to make the status window the active window */
  217.  
  218.  
  219. // 
  220. // Tags used for CreateIDC()
  221. // 
  222.  
  223. #define ICS_ICDDummy    (TAG_ICSUSER+0xa000)    /* 0x8000a000    */
  224.  
  225. #define ICS_APPNAME                (ICS_ICDDummy + 0x01)   /* const PSTR, name of calling application                   */
  226. #define ICS_APPNAMEVERSION  (ICS_ICDDummy + 0x02)   /* uint32_t, version of calling application                  */
  227. #define ICS_APPICSVERSION      (ICS_ICDDummy + 0x03)   /* uint32_t, version of ICS library application was made for */
  228. #define ICS_PREFSFILE          (ICS_ICDDummy + 0x04)   /* const PSTR, complete filename and path with ICS preferences file to load for this IDC handle */
  229. #define ICS_USE               (ICS_ICDDummy + 0x05)   /* PRIVATE - DO NOT USE. Set data to NULL */
  230. #define ICS_SAVE               (ICS_ICDDummy + 0x06)   /* PRIVATE - DO NOT USE. Set data to NULL */
  231.  
  232. #endif /* _ICS_ICS_H */
  233.