CMApplication.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:72k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       CMApplication.h
  3.  
  4.      Contains:   Color Matching Interfaces
  5.  
  6.      Version:    Technology: ColorSync 3.0
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1992-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMAPPLICATION__
  18. #define __CMAPPLICATION__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __QUICKDRAW__
  23. #include "Quickdraw.h"
  24. #endif
  25. #ifndef __FILES__
  26. #include "Files.h"
  27. #endif
  28. #ifndef __CMICCPROFILE__
  29. #include "CMICCProfile.h"
  30. #endif
  31. #ifndef __DISPLAYS__
  32. #include "Displays.h"
  33. #endif
  34. #ifndef __MACERRORS__
  35. #include "MacErrors.h"
  36. #endif
  37. #if TARGET_API_MAC_OS8
  38. #ifndef __PRINTING__
  39. #include "Printing.h"
  40. #endif
  41. #endif  /* TARGET_API_MAC_OS8 */
  42. #if TARGET_OS_WIN32
  43. #include "windows.h"
  44. #endif
  45. #if PRAGMA_ONCE
  46. #pragma once
  47. #endif
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. #if PRAGMA_IMPORT
  52. #pragma import on
  53. #endif
  54. #if PRAGMA_STRUCT_ALIGN
  55.     #pragma options align=mac68k
  56. #elif PRAGMA_STRUCT_PACKPUSH
  57.     #pragma pack(push, 2)
  58. #elif PRAGMA_STRUCT_PACK
  59.     #pragma pack(2)
  60. #endif
  61. enum {
  62.     kDefaultCMMSignature        = FOUR_CHAR_CODE('appl')
  63. };
  64. /* Macintosh 68K trap word */
  65. enum {
  66.     cmTrap                      = 0xABEE
  67. };
  68. /* PicComment IDs */
  69. enum {
  70.     cmBeginProfile              = 220,
  71.     cmEndProfile                = 221,
  72.     cmEnableMatching            = 222,
  73.     cmDisableMatching           = 223,
  74.     cmComment                   = 224
  75. };
  76. /* PicComment selectors for cmComment */
  77. enum {
  78.     cmBeginProfileSel           = 0,
  79.     cmContinueProfileSel        = 1,
  80.     cmEndProfileSel             = 2,
  81.     cmProfileIdentifierSel      = 3
  82. };
  83. /* Defines for version 1.0 CMProfileSearchRecord.fieldMask */
  84. enum {
  85.     cmMatchCMMType              = 0x00000001,
  86.     cmMatchApplProfileVersion   = 0x00000002,
  87.     cmMatchDataType             = 0x00000004,
  88.     cmMatchDeviceType           = 0x00000008,
  89.     cmMatchDeviceManufacturer   = 0x00000010,
  90.     cmMatchDeviceModel          = 0x00000020,
  91.     cmMatchDeviceAttributes     = 0x00000040,
  92.     cmMatchFlags                = 0x00000080,
  93.     cmMatchOptions              = 0x00000100,
  94.     cmMatchWhite                = 0x00000200,
  95.     cmMatchBlack                = 0x00000400
  96. };
  97. /* Defines for version 2.0 CMSearchRecord.searchMask */
  98. enum {
  99.     cmMatchAnyProfile           = 0x00000000,
  100.     cmMatchProfileCMMType       = 0x00000001,
  101.     cmMatchProfileClass         = 0x00000002,
  102.     cmMatchDataColorSpace       = 0x00000004,
  103.     cmMatchProfileConnectionSpace = 0x00000008,
  104.     cmMatchManufacturer         = 0x00000010,
  105.     cmMatchModel                = 0x00000020,
  106.     cmMatchAttributes           = 0x00000040,
  107.     cmMatchProfileFlags         = 0x00000080
  108. };
  109. /* deviceType values for ColorSync 1.0 Device Profile access */
  110. enum {
  111.     cmSystemDevice              = FOUR_CHAR_CODE('sys '),
  112.     cmGDevice                   = FOUR_CHAR_CODE('gdev')
  113. };
  114. /* Commands for CMFlattenUPP(...) */
  115. enum {
  116.     cmOpenReadSpool             = 1,
  117.     cmOpenWriteSpool            = 2,
  118.     cmReadSpool                 = 3,
  119.     cmWriteSpool                = 4,
  120.     cmCloseSpool                = 5
  121. };
  122. /* Flags for PostScript-related functions */
  123. enum {
  124.     cmPS7bit                    = 1,
  125.     cmPS8bit                    = 2
  126. };
  127. /* Flags for profile embedding functions */
  128. enum {
  129.     cmEmbedWholeProfile         = 0x00000000,
  130.     cmEmbedProfileIdentifier    = 0x00000001
  131. };
  132. /* Commands for CMAccessUPP(...) */
  133. enum {
  134.     cmOpenReadAccess            = 1,
  135.     cmOpenWriteAccess           = 2,
  136.     cmReadAccess                = 3,
  137.     cmWriteAccess               = 4,
  138.     cmCloseAccess               = 5,
  139.     cmCreateNewAccess           = 6,
  140.     cmAbortWriteAccess          = 7,
  141.     cmBeginAccess               = 8,
  142.     cmEndAccess                 = 9
  143. };
  144. /* Abstract data type for memory-based Profile */
  145. typedef struct OpaqueCMProfileRef*      CMProfileRef;
  146. /* Abstract data type for Profile search result */
  147. typedef struct OpaqueCMProfileSearchRef*  CMProfileSearchRef;
  148. /* Abstract data type for BeginMatching(...) reference */
  149. typedef struct OpaqueCMMatchRef*        CMMatchRef;
  150. /* Abstract data type for ColorWorld reference */
  151. typedef struct OpaqueCMWorldRef*        CMWorldRef;
  152. /* Caller-supplied flatten function */
  153. typedef CALLBACK_API( OSErr , CMFlattenProcPtr )(long command, long *size, void *data, void *refCon);
  154. /* Caller-supplied progress function for Bitmap & PixMap matching routines */
  155. typedef CALLBACK_API( Boolean , CMBitmapCallBackProcPtr )(long progress, void *refCon);
  156. /* Caller-supplied progress function for NCMMConcatInit & NCMMNewLinkProfile routines */
  157. typedef CALLBACK_API( Boolean , CMConcatCallBackProcPtr )(long progress, void *refCon);
  158. /* Caller-supplied filter function for Profile search */
  159. typedef CALLBACK_API( Boolean , CMProfileFilterProcPtr )(CMProfileRef prof, void *refCon);
  160. /* Caller-supplied function for profile access */
  161. typedef CALLBACK_API( OSErr , CMProfileAccessProcPtr )(long command, long offset, long *size, void *data, void *refCon);
  162. typedef STACK_UPP_TYPE(CMFlattenProcPtr)                        CMFlattenUPP;
  163. typedef STACK_UPP_TYPE(CMBitmapCallBackProcPtr)                 CMBitmapCallBackUPP;
  164. typedef STACK_UPP_TYPE(CMConcatCallBackProcPtr)                 CMConcatCallBackUPP;
  165. typedef STACK_UPP_TYPE(CMProfileFilterProcPtr)                  CMProfileFilterUPP;
  166. typedef STACK_UPP_TYPE(CMProfileAccessProcPtr)                  CMProfileAccessUPP;
  167. #if OPAQUE_UPP_TYPES
  168.     EXTERN_API(CMFlattenUPP)
  169.     NewCMFlattenUPP                (CMFlattenProcPtr        userRoutine);
  170.     EXTERN_API(CMBitmapCallBackUPP)
  171.     NewCMBitmapCallBackUPP         (CMBitmapCallBackProcPtr userRoutine);
  172.     EXTERN_API(CMConcatCallBackUPP)
  173.     NewCMConcatCallBackUPP         (CMConcatCallBackProcPtr userRoutine);
  174.     EXTERN_API(CMProfileFilterUPP)
  175.     NewCMProfileFilterUPP          (CMProfileFilterProcPtr  userRoutine);
  176.     EXTERN_API(CMProfileAccessUPP)
  177.     NewCMProfileAccessUPP          (CMProfileAccessProcPtr  userRoutine);
  178.     EXTERN_API(void)
  179.     DisposeCMFlattenUPP            (CMFlattenUPP            userUPP);
  180.     EXTERN_API(void)
  181.     DisposeCMBitmapCallBackUPP     (CMBitmapCallBackUPP     userUPP);
  182.     EXTERN_API(void)
  183.     DisposeCMConcatCallBackUPP     (CMConcatCallBackUPP     userUPP);
  184.     EXTERN_API(void)
  185.     DisposeCMProfileFilterUPP      (CMProfileFilterUPP      userUPP);
  186.     EXTERN_API(void)
  187.     DisposeCMProfileAccessUPP      (CMProfileAccessUPP      userUPP);
  188.     EXTERN_API(OSErr)
  189.     InvokeCMFlattenUPP             (long                    command,
  190.                                     long *                  size,
  191.                                     void *                  data,
  192.                                     void *                  refCon,
  193.                                     CMFlattenUPP            userUPP);
  194.     EXTERN_API(Boolean)
  195.     InvokeCMBitmapCallBackUPP      (long                    progress,
  196.                                     void *                  refCon,
  197.                                     CMBitmapCallBackUPP     userUPP);
  198.     EXTERN_API(Boolean)
  199.     InvokeCMConcatCallBackUPP      (long                    progress,
  200.                                     void *                  refCon,
  201.                                     CMConcatCallBackUPP     userUPP);
  202.     EXTERN_API(Boolean)
  203.     InvokeCMProfileFilterUPP       (CMProfileRef            prof,
  204.                                     void *                  refCon,
  205.                                     CMProfileFilterUPP      userUPP);
  206.     EXTERN_API(OSErr)
  207.     InvokeCMProfileAccessUPP       (long                    command,
  208.                                     long                    offset,
  209.                                     long *                  size,
  210.                                     void *                  data,
  211.                                     void *                  refCon,
  212.                                     CMProfileAccessUPP      userUPP);
  213. #else
  214.     enum { uppCMFlattenProcInfo = 0x00003FE0 };                     /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  215.     enum { uppCMBitmapCallBackProcInfo = 0x000003D0 };              /* pascal 1_byte Func(4_bytes, 4_bytes) */
  216.     enum { uppCMConcatCallBackProcInfo = 0x000003D0 };              /* pascal 1_byte Func(4_bytes, 4_bytes) */
  217.     enum { uppCMProfileFilterProcInfo = 0x000003D0 };               /* pascal 1_byte Func(4_bytes, 4_bytes) */
  218.     enum { uppCMProfileAccessProcInfo = 0x0000FFE0 };               /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  219.     #define NewCMFlattenUPP(userRoutine)                            (CMFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture())
  220.     #define NewCMBitmapCallBackUPP(userRoutine)                     (CMBitmapCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, GetCurrentArchitecture())
  221.     #define NewCMConcatCallBackUPP(userRoutine)                     (CMConcatCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMConcatCallBackProcInfo, GetCurrentArchitecture())
  222.     #define NewCMProfileFilterUPP(userRoutine)                      (CMProfileFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, GetCurrentArchitecture())
  223.     #define NewCMProfileAccessUPP(userRoutine)                      (CMProfileAccessUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, GetCurrentArchitecture())
  224.     #define DisposeCMFlattenUPP(userUPP)                            DisposeRoutineDescriptor(userUPP)
  225.     #define DisposeCMBitmapCallBackUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  226.     #define DisposeCMConcatCallBackUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  227.     #define DisposeCMProfileFilterUPP(userUPP)                      DisposeRoutineDescriptor(userUPP)
  228.     #define DisposeCMProfileAccessUPP(userUPP)                      DisposeRoutineDescriptor(userUPP)
  229.     #define InvokeCMFlattenUPP(command, size, data, refCon, userUPP)  (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppCMFlattenProcInfo, (command), (size), (data), (refCon))
  230.     #define InvokeCMBitmapCallBackUPP(progress, refCon, userUPP)    (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMBitmapCallBackProcInfo, (progress), (refCon))
  231.     #define InvokeCMConcatCallBackUPP(progress, refCon, userUPP)    (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMConcatCallBackProcInfo, (progress), (refCon))
  232.     #define InvokeCMProfileFilterUPP(prof, refCon, userUPP)         (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileFilterProcInfo, (prof), (refCon))
  233.     #define InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userUPP)  (OSErr)CALL_FIVE_PARAMETER_UPP((userUPP), uppCMProfileAccessProcInfo, (command), (offset), (size), (data), (refCon))
  234. #endif
  235. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  236. #define NewCMFlattenProc(userRoutine)                           NewCMFlattenUPP(userRoutine)
  237. #define NewCMBitmapCallBackProc(userRoutine)                    NewCMBitmapCallBackUPP(userRoutine)
  238. #define NewCMConcatCallBackProc(userRoutine)                    NewCMConcatCallBackUPP(userRoutine)
  239. #define NewCMProfileFilterProc(userRoutine)                     NewCMProfileFilterUPP(userRoutine)
  240. #define NewCMProfileAccessProc(userRoutine)                     NewCMProfileAccessUPP(userRoutine)
  241. #define CallCMFlattenProc(userRoutine, command, size, data, refCon) InvokeCMFlattenUPP(command, size, data, refCon, userRoutine)
  242. #define CallCMBitmapCallBackProc(userRoutine, progress, refCon) InvokeCMBitmapCallBackUPP(progress, refCon, userRoutine)
  243. #define CallCMConcatCallBackProc(userRoutine, progress, refCon) InvokeCMConcatCallBackUPP(progress, refCon, userRoutine)
  244. #define CallCMProfileFilterProc(userRoutine, prof, refCon)      InvokeCMProfileFilterUPP(prof, refCon, userRoutine)
  245. #define CallCMProfileAccessProc(userRoutine, command, offset, size, data, refCon) InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userRoutine)
  246. typedef long                            CMError;
  247. /* For 1.0 and 2.0 profile header variants */
  248. /* CMAppleProfileHeader */
  249. union CMAppleProfileHeader {
  250.     CMHeader                        cm1;
  251.     CM2Header                       cm2;
  252. };
  253. typedef union CMAppleProfileHeader      CMAppleProfileHeader;
  254. /* Param for CWConcatColorWorld(...) */
  255. struct CMConcatProfileSet {
  256.     UInt16                          keyIndex;                   /* Zero-based */
  257.     UInt16                          count;                      /* Min 1 */
  258.     CMProfileRef                    profileSet[1];              /* Variable. Ordered from Source -> Dest */
  259. };
  260. typedef struct CMConcatProfileSet       CMConcatProfileSet;
  261. /* NCMConcatProfileSpec Tags */
  262. enum {
  263.     kNoTransform                = 0,                            /* Not used */
  264.     kUseAtoB                    = 1,                            /* Use 'A2B*' tag from this profile or equivalent */
  265.     kUseBtoA                    = 2,                            /* Use 'B2A*' tag from this profile or equivalent */
  266.     kUseBtoB                    = 3,                            /* Use 'pre*' tag from this profile or equivalent */
  267.                                                                 /* For typical device profiles the following synonyms may be useful */
  268.     kDeviceToPCS                = kUseAtoB,                     /* Device Dependent to Device Independent */
  269.     kPCSToDevice                = kUseBtoA,                     /* Device Independent to Device Dependent */
  270.     kPCSToPCS                   = kUseBtoB,                     /* Independent, through device's gamut */
  271.     kUseProfileIntent           = (long)0xFFFFFFFF              /* For renderingIntent in NCMConcatProfileSpec    */
  272. };
  273. /* NCMConcatProfileSpec */
  274. struct NCMConcatProfileSpec {
  275.     UInt32                          renderingIntent;            /* renderingIntent override     */
  276.     UInt32                          transformTag;               /* transformTag, defined above    */
  277.     CMProfileRef                    profile;                    /* profile */
  278. };
  279. typedef struct NCMConcatProfileSpec     NCMConcatProfileSpec;
  280. /* NCMConcatProfileSet */
  281. struct NCMConcatProfileSet {
  282.     OSType                          cmm;                        /* e.g. 'KCMS', 'appl', ...  uniquely ids the cmm, or 0000 */
  283.     UInt32                          flags;                      /* specify quality, lookup only, no gamut checking ... */
  284.     UInt32                          flagsMask;                  /* which bits of 'flags' to use to override profile */
  285.     UInt32                          profileCount;               /* how many ProfileSpecs in the following set */
  286.     NCMConcatProfileSpec            profileSpecs[1];            /* Variable. Ordered from Source -> Dest */
  287. };
  288. typedef struct NCMConcatProfileSet      NCMConcatProfileSet;
  289. /* ColorSync color data types */
  290. struct CMRGBColor {
  291.     UInt16                          red;                        /* 0..65535 */
  292.     UInt16                          green;
  293.     UInt16                          blue;
  294. };
  295. typedef struct CMRGBColor               CMRGBColor;
  296. struct CMCMYKColor {
  297.     UInt16                          cyan;                       /* 0..65535 */
  298.     UInt16                          magenta;
  299.     UInt16                          yellow;
  300.     UInt16                          black;
  301. };
  302. typedef struct CMCMYKColor              CMCMYKColor;
  303. struct CMCMYColor {
  304.     UInt16                          cyan;                       /* 0..65535 */
  305.     UInt16                          magenta;
  306.     UInt16                          yellow;
  307. };
  308. typedef struct CMCMYColor               CMCMYColor;
  309. struct CMHLSColor {
  310.     UInt16                          hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  311.     UInt16                          lightness;                  /* 0..65535 */
  312.     UInt16                          saturation;                 /* 0..65535 */
  313. };
  314. typedef struct CMHLSColor               CMHLSColor;
  315. struct CMHSVColor {
  316.     UInt16                          hue;                        /* 0..65535. Fraction of circle. Red at 0 */
  317.     UInt16                          saturation;                 /* 0..65535 */
  318.     UInt16                          value;                      /* 0..65535 */
  319. };
  320. typedef struct CMHSVColor               CMHSVColor;
  321. struct CMLabColor {
  322.     UInt16                          L;                          /* 0..65535 maps to 0..100 */
  323.     UInt16                          a;                          /* 0..65535 maps to -128..127.996 */
  324.     UInt16                          b;                          /* 0..65535 maps to -128..127.996 */
  325. };
  326. typedef struct CMLabColor               CMLabColor;
  327. struct CMLuvColor {
  328.     UInt16                          L;                          /* 0..65535 maps to 0..100 */
  329.     UInt16                          u;                          /* 0..65535 maps to -128..127.996 */
  330.     UInt16                          v;                          /* 0..65535 maps to -128..127.996 */
  331. };
  332. typedef struct CMLuvColor               CMLuvColor;
  333. struct CMYxyColor {
  334.     UInt16                          capY;                       /* 0..65535 maps to 0..1 */
  335.     UInt16                          x;                          /* 0..65535 maps to 0..1 */
  336.     UInt16                          y;                          /* 0..65535 maps to 0..1 */
  337. };
  338. typedef struct CMYxyColor               CMYxyColor;
  339. struct CMGrayColor {
  340.     UInt16                          gray;                       /* 0..65535 */
  341. };
  342. typedef struct CMGrayColor              CMGrayColor;
  343. struct CMMultichannel5Color {
  344.     UInt8                           components[5];              /* 0..255 */
  345. };
  346. typedef struct CMMultichannel5Color     CMMultichannel5Color;
  347. struct CMMultichannel6Color {
  348.     UInt8                           components[6];              /* 0..255 */
  349. };
  350. typedef struct CMMultichannel6Color     CMMultichannel6Color;
  351. struct CMMultichannel7Color {
  352.     UInt8                           components[7];              /* 0..255 */
  353. };
  354. typedef struct CMMultichannel7Color     CMMultichannel7Color;
  355. struct CMMultichannel8Color {
  356.     UInt8                           components[8];              /* 0..255 */
  357. };
  358. typedef struct CMMultichannel8Color     CMMultichannel8Color;
  359. struct CMNamedColor {
  360.     UInt32                          namedColorIndex;            /* 0..a lot */
  361. };
  362. typedef struct CMNamedColor             CMNamedColor;
  363. union CMColor {
  364.     CMRGBColor                      rgb;
  365.     CMHSVColor                      hsv;
  366.     CMHLSColor                      hls;
  367.     CMXYZColor                      XYZ;
  368.     CMLabColor                      Lab;
  369.     CMLuvColor                      Luv;
  370.     CMYxyColor                      Yxy;
  371.     CMCMYKColor                     cmyk;
  372.     CMCMYColor                      cmy;
  373.     CMGrayColor                     gray;
  374.     CMMultichannel5Color            mc5;
  375.     CMMultichannel6Color            mc6;
  376.     CMMultichannel7Color            mc7;
  377.     CMMultichannel8Color            mc8;
  378.     CMNamedColor                    namedColor;
  379. };
  380. typedef union CMColor                   CMColor;
  381. struct CMProfileSearchRecord {
  382.     CMHeader                        header;
  383.     UInt32                          fieldMask;
  384.     UInt32                          reserved[2];
  385. };
  386. typedef struct CMProfileSearchRecord    CMProfileSearchRecord;
  387. typedef CMProfileSearchRecord *         CMProfileSearchRecordPtr;
  388. typedef CMProfileSearchRecordPtr *      CMProfileSearchRecordHandle;
  389. /* Search definition for 2.0 */
  390. struct CMSearchRecord {
  391.     OSType                          CMMType;
  392.     OSType                          profileClass;
  393.     OSType                          dataColorSpace;
  394.     OSType                          profileConnectionSpace;
  395.     UInt32                          deviceManufacturer;
  396.     UInt32                          deviceModel;
  397.     UInt32                          deviceAttributes[2];
  398.     UInt32                          profileFlags;
  399.     UInt32                          searchMask;
  400.     CMProfileFilterUPP              filter;
  401. };
  402. typedef struct CMSearchRecord           CMSearchRecord;
  403. /* CMMInfo structure */
  404. struct CMMInfo {
  405.     UInt32                          dataSize;                   /* Size of this structure - compatibility*/
  406.     OSType                          CMMType;                    /* Signature, e.g. 'KCMS'*/
  407.     OSType                          CMMMfr;                     /* Vendor, e.g. 'appl'*/
  408.     UInt32                          CMMVersion;                 /* cmm version number*/
  409.     unsigned char                   ASCIIName[32];              /* pascal string - name*/
  410.     unsigned char                   ASCIIDesc[256];             /* pascal string - description or copyright*/
  411.     UniCharCount                    UniCodeNameCount;           /* count of UniChars in following array*/
  412.     UniChar                         UniCodeName[32];            /* the name in UniCode chars*/
  413.     UniCharCount                    UniCodeDescCount;           /* count of UniChars in following array*/
  414.     UniChar                         UniCodeDesc[256];           /* the description in UniCode chars*/
  415. };
  416. typedef struct CMMInfo                  CMMInfo;
  417. /* GetCWInfo structures */
  418. struct CMMInfoRecord {
  419.     OSType                          CMMType;
  420.     long                            CMMVersion;
  421. };
  422. typedef struct CMMInfoRecord            CMMInfoRecord;
  423. struct CMCWInfoRecord {
  424.     UInt32                          cmmCount;
  425.     CMMInfoRecord                   cmmInfo[2];
  426. };
  427. typedef struct CMCWInfoRecord           CMCWInfoRecord;
  428. /* profile identifier structures */
  429. struct CMProfileIdentifier {
  430.     CM2Header                       profileHeader;
  431.     CMDateTime                      calibrationDate;
  432.     UInt32                          ASCIIProfileDescriptionLen;
  433.     char                            ASCIIProfileDescription[1]; /* variable length */
  434. };
  435. typedef struct CMProfileIdentifier      CMProfileIdentifier;
  436. typedef CMProfileIdentifier *           CMProfileIdentifierPtr;
  437. /* packing formats */
  438. enum {
  439.     cmNoColorPacking            = 0x0000,
  440.     cmWord5ColorPacking         = 0x0500,
  441.     cmWord565ColorPacking       = 0x0600,
  442.     cmLong8ColorPacking         = 0x0800,
  443.     cmLong10ColorPacking        = 0x0A00,
  444.     cmAlphaFirstPacking         = 0x1000,
  445.     cmOneBitDirectPacking       = 0x0B00,
  446.     cmAlphaLastPacking          = 0x0000,
  447.     cm8_8ColorPacking           = 0x2800,
  448.     cm16_8ColorPacking          = 0x2000,
  449.     cm24_8ColorPacking          = 0x2100,
  450.     cm32_8ColorPacking          = cmLong8ColorPacking,
  451.     cm40_8ColorPacking          = 0x2200,
  452.     cm48_8ColorPacking          = 0x2300,
  453.     cm56_8ColorPacking          = 0x2400,
  454.     cm64_8ColorPacking          = 0x2500,
  455.     cm32_16ColorPacking         = 0x2600,
  456.     cm48_16ColorPacking         = 0x2900,
  457.     cm64_16ColorPacking         = 0x2A00,
  458.     cm32_32ColorPacking         = 0x2700,
  459.     cmLittleEndianPacking       = 0x4000,
  460.     cmReverseChannelPacking     = 0x8000
  461. };
  462. /* colorspace masks */
  463. enum {
  464.     cmColorSpaceSpaceMask       = 0x0000007F,
  465.     cmColorSpaceAlphaMask       = 0x00000080,
  466.     cmColorSpaceSpaceAndAlphaMask = 0x000000FF,
  467.     cmColorSpacePackingMask     = 0x0000FF00,
  468.     cmColorSpaceReservedMask    = (long)0xFFFF0000
  469. };
  470. /* general colorspaces */
  471. enum {
  472.     cmNoSpace                   = 0,
  473.     cmRGBSpace                  = 1,
  474.     cmCMYKSpace                 = 2,
  475.     cmHSVSpace                  = 3,
  476.     cmHLSSpace                  = 4,
  477.     cmYXYSpace                  = 5,
  478.     cmXYZSpace                  = 6,
  479.     cmLUVSpace                  = 7,
  480.     cmLABSpace                  = 8,
  481.     cmReservedSpace1            = 9,
  482.     cmGraySpace                 = 10,
  483.     cmReservedSpace2            = 11,
  484.     cmGamutResultSpace          = 12,
  485.     cmNamedIndexedSpace         = 16,
  486.     cmMCFiveSpace               = 17,
  487.     cmMCSixSpace                = 18,
  488.     cmMCSevenSpace              = 19,
  489.     cmMCEightSpace              = 20,
  490.     cmAlphaSpace                = 0x80,
  491.     cmRGBASpace                 = cmRGBSpace + cmAlphaSpace,
  492.     cmGrayASpace                = cmGraySpace + cmAlphaSpace
  493. };
  494. /* supported CMBitmapColorSpaces - Each of the following is a */
  495. /* combination of a general colospace and a packing formats. */
  496. /* Each can also be or'd with cmReverseChannelPacking. */
  497. enum {
  498.     cmGray8Space                = cmGraySpace + cm8_8ColorPacking,
  499.     cmGrayA16Space              = cmGrayASpace + cm16_8ColorPacking,
  500.     cmGray16Space               = cmGraySpace,
  501.     cmGrayA32Space              = cmGrayASpace,
  502.     cmGray16LSpace              = cmGraySpace + cmLittleEndianPacking,
  503.     cmGrayA32LSpace             = cmGrayASpace + cmLittleEndianPacking,
  504.     cmRGB16Space                = cmRGBSpace + cmWord5ColorPacking,
  505.     cmRGB16LSpace               = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking,
  506.     cmRGB565Space               = cmRGBSpace + cmWord565ColorPacking,
  507.     cmRGB565LSpace              = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking,
  508.     cmRGB24Space                = cmRGBSpace + cm24_8ColorPacking,
  509.     cmRGB32Space                = cmRGBSpace + cm32_8ColorPacking,
  510.     cmRGB48Space                = cmRGBSpace + cm48_16ColorPacking,
  511.     cmRGB48LSpace               = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  512.     cmARGB32Space               = cmRGBASpace + cm32_8ColorPacking + cmAlphaFirstPacking,
  513.     cmARGB64Space               = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking,
  514.     cmARGB64LSpace              = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking + cmLittleEndianPacking,
  515.     cmRGBA32Space               = cmRGBASpace + cm32_8ColorPacking + cmAlphaLastPacking,
  516.     cmRGBA64Space               = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking,
  517.     cmRGBA64LSpace              = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking + cmLittleEndianPacking,
  518.     cmCMYK32Space               = cmCMYKSpace + cm32_8ColorPacking,
  519.     cmCMYK64Space               = cmCMYKSpace + cm64_16ColorPacking,
  520.     cmCMYK64LSpace              = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking,
  521.     cmHSV32Space                = cmHSVSpace + cmLong10ColorPacking,
  522.     cmHLS32Space                = cmHLSSpace + cmLong10ColorPacking,
  523.     cmYXY32Space                = cmYXYSpace + cmLong10ColorPacking,
  524.     cmXYZ24Space                = cmXYZSpace + cm24_8ColorPacking,
  525.     cmXYZ32Space                = cmXYZSpace + cmLong10ColorPacking,
  526.     cmXYZ48Space                = cmXYZSpace + cm48_16ColorPacking,
  527.     cmXYZ48LSpace               = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  528.     cmLUV32Space                = cmLUVSpace + cmLong10ColorPacking,
  529.     cmLAB24Space                = cmLABSpace + cm24_8ColorPacking,
  530.     cmLAB32Space                = cmLABSpace + cmLong10ColorPacking,
  531.     cmLAB48Space                = cmLABSpace + cm48_16ColorPacking,
  532.     cmLAB48LSpace               = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking,
  533.     cmGamutResult1Space         = cmOneBitDirectPacking + cmGamutResultSpace,
  534.     cmNamedIndexed32Space       = cm32_32ColorPacking + cmNamedIndexedSpace,
  535.     cmNamedIndexed32LSpace      = cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking,
  536.     cmMCFive8Space              = cm40_8ColorPacking + cmMCFiveSpace,
  537.     cmMCSix8Space               = cm48_8ColorPacking + cmMCSixSpace,
  538.     cmMCSeven8Space             = cm56_8ColorPacking + cmMCSevenSpace,
  539.     cmMCEight8Space             = cm64_8ColorPacking + cmMCEightSpace
  540. };
  541. typedef UInt32                          CMBitmapColorSpace;
  542. struct CMBitmap {
  543.     char *                          image;
  544.     long                            width;
  545.     long                            height;
  546.     long                            rowBytes;
  547.     long                            pixelSize;
  548.     CMBitmapColorSpace              space;
  549.     long                            user1;
  550.     long                            user2;
  551. };
  552. typedef struct CMBitmap                 CMBitmap;
  553. /* Classic Print Manager Stuff */
  554. #if TARGET_OS_MAC
  555. enum {
  556.     enableColorMatchingOp       = 12,
  557.     registerProfileOp           = 13
  558. };
  559. #endif  /* TARGET_OS_MAC */
  560. /* Profile Locations */
  561. enum {
  562.     CS_MAX_PATH                 = 256
  563. };
  564. enum {
  565.     cmNoProfileBase             = 0,
  566.     cmFileBasedProfile          = 1,
  567.     cmHandleBasedProfile        = 2,
  568.     cmPtrBasedProfile           = 3,
  569.     cmProcedureBasedProfile     = 4,
  570.     cmPathBasedProfile          = 5,
  571.     cmBufferBasedProfile        = 6
  572. };
  573. struct CMFileLocation {
  574.     FSSpec                          spec;
  575. };
  576. typedef struct CMFileLocation           CMFileLocation;
  577. struct CMHandleLocation {
  578.     Handle                          h;
  579. };
  580. typedef struct CMHandleLocation         CMHandleLocation;
  581. struct CMPtrLocation {
  582.     Ptr                             p;
  583. };
  584. typedef struct CMPtrLocation            CMPtrLocation;
  585. struct CMProcedureLocation {
  586.     CMProfileAccessUPP              proc;
  587.     void *                          refCon;
  588. };
  589. typedef struct CMProcedureLocation      CMProcedureLocation;
  590. struct CMPathLocation {
  591.     char                            path[256];
  592. };
  593. typedef struct CMPathLocation           CMPathLocation;
  594. struct CMBufferLocation {
  595.     void *                          buffer;
  596.     UInt32                          size;
  597. };
  598. typedef struct CMBufferLocation         CMBufferLocation;
  599. union CMProfLoc {
  600.     CMFileLocation                  fileLoc;
  601.     CMHandleLocation                handleLoc;
  602.     CMPtrLocation                   ptrLoc;
  603.     CMProcedureLocation             procLoc;
  604.     CMPathLocation                  pathLoc;
  605.     CMBufferLocation                bufferLoc;
  606. };
  607. typedef union CMProfLoc                 CMProfLoc;
  608. struct CMProfileLocation {
  609.     short                           locType;
  610.     CMProfLoc                       u;
  611. };
  612. typedef struct CMProfileLocation        CMProfileLocation;
  613. #if TARGET_OS_MAC
  614. enum {
  615.     cmOriginalProfileLocationSize = 72,
  616.     cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  617. };
  618. #else
  619. enum {
  620.     cmOriginalProfileLocationSize = 2 + CS_MAX_PATH,
  621.     cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
  622. };
  623. #endif  /* TARGET_OS_MAC */
  624. /* Struct and enums used for Profile iteration */
  625. enum {
  626.     cmProfileIterateDataVersion1 = 0x00010000,
  627.     cmProfileIterateDataVersion2 = 0x00020000
  628. };
  629. struct CMProfileIterateData {
  630.     UInt32                          dataVersion;                /* cmProfileIterateDataVersion2 */
  631.     CM2Header                       header;
  632.     ScriptCode                      code;
  633.     Str255                          name;
  634.     CMProfileLocation               location;
  635.     UniCharCount                    uniCodeNameCount;
  636.     UniChar *                       uniCodeName;
  637.     unsigned char *                 asciiName;
  638.     CMMakeAndModel *                makeAndModel;
  639. };
  640. typedef struct CMProfileIterateData     CMProfileIterateData;
  641. /* Caller-supplied callback function for Profile & CMM iteration */
  642. typedef CALLBACK_API( OSErr , CMProfileIterateProcPtr )(CMProfileIterateData *iterateData, void *refCon);
  643. typedef CALLBACK_API( OSErr , CMMIterateProcPtr )(CMMInfo *iterateData, void *refCon);
  644. typedef STACK_UPP_TYPE(CMProfileIterateProcPtr)                 CMProfileIterateUPP;
  645. typedef STACK_UPP_TYPE(CMMIterateProcPtr)                       CMMIterateUPP;
  646. #if OPAQUE_UPP_TYPES
  647.     EXTERN_API(CMProfileIterateUPP)
  648.     NewCMProfileIterateUPP         (CMProfileIterateProcPtr userRoutine);
  649.     EXTERN_API(CMMIterateUPP)
  650.     NewCMMIterateUPP               (CMMIterateProcPtr       userRoutine);
  651.     EXTERN_API(void)
  652.     DisposeCMProfileIterateUPP     (CMProfileIterateUPP     userUPP);
  653.     EXTERN_API(void)
  654.     DisposeCMMIterateUPP           (CMMIterateUPP           userUPP);
  655.     EXTERN_API(OSErr)
  656.     InvokeCMProfileIterateUPP      (CMProfileIterateData *  iterateData,
  657.                                     void *                  refCon,
  658.                                     CMProfileIterateUPP     userUPP);
  659.     EXTERN_API(OSErr)
  660.     InvokeCMMIterateUPP            (CMMInfo *               iterateData,
  661.                                     void *                  refCon,
  662.                                     CMMIterateUPP           userUPP);
  663. #else
  664.     enum { uppCMProfileIterateProcInfo = 0x000003E0 };              /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  665.     enum { uppCMMIterateProcInfo = 0x000003E0 };                    /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  666.     #define NewCMProfileIterateUPP(userRoutine)                     (CMProfileIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileIterateProcInfo, GetCurrentArchitecture())
  667.     #define NewCMMIterateUPP(userRoutine)                           (CMMIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMMIterateProcInfo, GetCurrentArchitecture())
  668.     #define DisposeCMProfileIterateUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  669.     #define DisposeCMMIterateUPP(userUPP)                           DisposeRoutineDescriptor(userUPP)
  670.     #define InvokeCMProfileIterateUPP(iterateData, refCon, userUPP)  (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileIterateProcInfo, (iterateData), (refCon))
  671.     #define InvokeCMMIterateUPP(iterateData, refCon, userUPP)       (OSErr)CALL_TWO_PARAMETER_UPP((userUPP), uppCMMIterateProcInfo, (iterateData), (refCon))
  672. #endif
  673. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  674. #define NewCMProfileIterateProc(userRoutine)                    NewCMProfileIterateUPP(userRoutine)
  675. #define NewCMMIterateProc(userRoutine)                          NewCMMIterateUPP(userRoutine)
  676. #define CallCMProfileIterateProc(userRoutine, iterateData, refCon) InvokeCMProfileIterateUPP(iterateData, refCon, userRoutine)
  677. #define CallCMMIterateProc(userRoutine, iterateData, refCon)    InvokeCMMIterateUPP(iterateData, refCon, userRoutine)
  678. /* Profile file and element access */
  679. EXTERN_API( CMError )
  680. CMNewProfile                    (CMProfileRef *         prof,
  681.                                  const CMProfileLocation * theProfile)                      FOURWORDINLINE(0x203C, 0x0008, 0x001B, 0xABEE);
  682. EXTERN_API( CMError )
  683. CMOpenProfile                   (CMProfileRef *         prof,
  684.                                  const CMProfileLocation * theProfile)                      FOURWORDINLINE(0x203C, 0x0008, 0x001C, 0xABEE);
  685. EXTERN_API( CMError )
  686. CMCloseProfile                  (CMProfileRef           prof)                               FOURWORDINLINE(0x203C, 0x0004, 0x001D, 0xABEE);
  687. EXTERN_API( CMError )
  688. CMUpdateProfile                 (CMProfileRef           prof)                               FOURWORDINLINE(0x203C, 0x0004, 0x0034, 0xABEE);
  689. EXTERN_API( CMError )
  690. CMCopyProfile                   (CMProfileRef *         targetProf,
  691.                                  const CMProfileLocation * targetLocation,
  692.                                  CMProfileRef           srcProf)                            FOURWORDINLINE(0x203C, 0x000C, 0x0025, 0xABEE);
  693. EXTERN_API( CMError )
  694. CMValidateProfile               (CMProfileRef           prof,
  695.                                  Boolean *              valid,
  696.                                  Boolean *              preferredCMMnotfound)               FOURWORDINLINE(0x203C, 0x000C, 0x0026, 0xABEE);
  697. EXTERN_API( CMError )
  698. CMGetProfileLocation            (CMProfileRef           prof,
  699.                                  CMProfileLocation *    theProfile)                         FOURWORDINLINE(0x203C, 0x0008, 0x003C, 0xABEE);
  700. EXTERN_API( CMError )
  701. NCMGetProfileLocation           (CMProfileRef           prof,
  702.                                  CMProfileLocation *    theProfile,
  703.                                  UInt32 *               locationSize)                       FOURWORDINLINE(0x203C, 0x000C, 0x0059, 0xABEE);
  704. EXTERN_API( CMError )
  705. CMFlattenProfile                (CMProfileRef           prof,
  706.                                  UInt32                 flags,
  707.                                  CMFlattenUPP           proc,
  708.                                  void *                 refCon,
  709.                                  Boolean *              preferredCMMnotfound)               FOURWORDINLINE(0x203C, 0x0014, 0x0031, 0xABEE);
  710. #if TARGET_OS_MAC
  711. EXTERN_API( CMError )
  712. CMUnflattenProfile              (FSSpec *               resultFileSpec,
  713.                                  CMFlattenUPP           proc,
  714.                                  void *                 refCon,
  715.                                  Boolean *              preferredCMMnotfound)               FOURWORDINLINE(0x203C, 0x0010, 0x0032, 0xABEE);
  716. #endif  /* TARGET_OS_MAC */
  717. EXTERN_API( CMError )
  718. CMGetProfileHeader              (CMProfileRef           prof,
  719.                                  CMAppleProfileHeader * header)                             FOURWORDINLINE(0x203C, 0x0008, 0x0039, 0xABEE);
  720. EXTERN_API( CMError )
  721. CMSetProfileHeader              (CMProfileRef           prof,
  722.                                  const CMAppleProfileHeader * header)                       FOURWORDINLINE(0x203C, 0x0008, 0x003A, 0xABEE);
  723. EXTERN_API( CMError )
  724. CMProfileElementExists          (CMProfileRef           prof,
  725.                                  OSType                 tag,
  726.                                  Boolean *              found)                              FOURWORDINLINE(0x203C, 0x000C, 0x001E, 0xABEE);
  727. EXTERN_API( CMError )
  728. CMCountProfileElements          (CMProfileRef           prof,
  729.                                  UInt32 *               elementCount)                       FOURWORDINLINE(0x203C, 0x0008, 0x001F, 0xABEE);
  730. EXTERN_API( CMError )
  731. CMGetProfileElement             (CMProfileRef           prof,
  732.                                  OSType                 tag,
  733.                                  UInt32 *               elementSize,
  734.                                  void *                 elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0020, 0xABEE);
  735. EXTERN_API( CMError )
  736. CMSetProfileElement             (CMProfileRef           prof,
  737.                                  OSType                 tag,
  738.                                  UInt32                 elementSize,
  739.                                  void *                 elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0023, 0xABEE);
  740. EXTERN_API( CMError )
  741. CMSetProfileElementSize         (CMProfileRef           prof,
  742.                                  OSType                 tag,
  743.                                  UInt32                 elementSize)                        FOURWORDINLINE(0x203C, 0x000C, 0x0038, 0xABEE);
  744. EXTERN_API( CMError )
  745. CMSetProfileElementReference    (CMProfileRef           prof,
  746.                                  OSType                 elementTag,
  747.                                  OSType                 referenceTag)                       FOURWORDINLINE(0x203C, 0x000C, 0x0035, 0xABEE);
  748. EXTERN_API( CMError )
  749. CMGetPartialProfileElement      (CMProfileRef           prof,
  750.                                  OSType                 tag,
  751.                                  UInt32                 offset,
  752.                                  UInt32 *               byteCount,
  753.                                  void *                 elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0036, 0xABEE);
  754. EXTERN_API( CMError )
  755. CMSetPartialProfileElement      (CMProfileRef           prof,
  756.                                  OSType                 tag,
  757.                                  UInt32                 offset,
  758.                                  UInt32                 byteCount,
  759.                                  void *                 elementData)                        FOURWORDINLINE(0x203C, 0x0014, 0x0037, 0xABEE);
  760. EXTERN_API( CMError )
  761. CMGetIndProfileElementInfo      (CMProfileRef           prof,
  762.                                  UInt32                 index,
  763.                                  OSType *               tag,
  764.                                  UInt32 *               elementSize,
  765.                                  Boolean *              refs)                               FOURWORDINLINE(0x203C, 0x0014, 0x0021, 0xABEE);
  766. EXTERN_API( CMError )
  767. CMGetIndProfileElement          (CMProfileRef           prof,
  768.                                  UInt32                 index,
  769.                                  UInt32 *               elementSize,
  770.                                  void *                 elementData)                        FOURWORDINLINE(0x203C, 0x0010, 0x0022, 0xABEE);
  771. EXTERN_API( CMError )
  772. CMRemoveProfileElement          (CMProfileRef           prof,
  773.                                  OSType                 tag)                                FOURWORDINLINE(0x203C, 0x0008, 0x0024, 0xABEE);
  774. EXTERN_API( CMError )
  775. CMGetScriptProfileDescription   (CMProfileRef           prof,
  776.                                  Str255                 name,
  777.                                  ScriptCode *           code)                               FOURWORDINLINE(0x203C, 0x000C, 0x003E, 0xABEE);
  778. EXTERN_API( CMError )
  779. CMGetProfileDescriptions        (CMProfileRef           prof,
  780.                                  char *                 aName,
  781.                                  UInt32 *               aCount,
  782.                                  Str255                 mName,
  783.                                  ScriptCode *           mCode,
  784.                                  UniChar *              uName,
  785.                                  UniCharCount *         uCount)                             FOURWORDINLINE(0x203C, 0x001A, 0x0067, 0xABEE);
  786. EXTERN_API( CMError )
  787. CMSetProfileDescriptions        (CMProfileRef           prof,
  788.                                  const char *           aName,
  789.                                  UInt32                 aCount,
  790.                                  ConstStr255Param       mName,
  791.                                  ScriptCode             mCode,
  792.                                  const UniChar *        uName,
  793.                                  UniCharCount           uCount)                             FOURWORDINLINE(0x203C, 0x001A, 0x0068, 0xABEE);
  794. EXTERN_API( CMError )
  795. CMCloneProfileRef               (CMProfileRef           prof)                               FOURWORDINLINE(0x203C, 0x0004, 0x0042, 0xABEE);
  796. EXTERN_API( CMError )
  797. CMGetProfileRefCount            (CMProfileRef           prof,
  798.                                  long *                 count)                              FOURWORDINLINE(0x203C, 0x0008, 0x0043, 0xABEE);
  799. EXTERN_API( CMError )
  800. CMProfileModified               (CMProfileRef           prof,
  801.                                  Boolean *              modified)                           FOURWORDINLINE(0x203C, 0x0008, 0x0044, 0xABEE);
  802. /* named Color access functions */
  803. EXTERN_API( CMError )
  804. CMGetNamedColorInfo             (CMProfileRef           prof,
  805.                                  UInt32 *               deviceChannels,
  806.                                  OSType *               deviceColorSpace,
  807.                                  OSType *               PCSColorSpace,
  808.                                  UInt32 *               count,
  809.                                  StringPtr              prefix,
  810.                                  StringPtr              suffix)                             FOURWORDINLINE(0x203C, 0x001C, 0x0046, 0xABEE);
  811. EXTERN_API( CMError )
  812. CMGetNamedColorValue            (CMProfileRef           prof,
  813.                                  StringPtr              name,
  814.                                  CMColor *              deviceColor,
  815.                                  CMColor *              PCSColor)                           FOURWORDINLINE(0x203C, 0x0010, 0x0047, 0xABEE);
  816. EXTERN_API( CMError )
  817. CMGetIndNamedColorValue         (CMProfileRef           prof,
  818.                                  UInt32                 index,
  819.                                  CMColor *              deviceColor,
  820.                                  CMColor *              PCSColor)                           FOURWORDINLINE(0x203C, 0x0010, 0x0048, 0xABEE);
  821. EXTERN_API( CMError )
  822. CMGetNamedColorIndex            (CMProfileRef           prof,
  823.                                  StringPtr              name,
  824.                                  UInt32 *               index)                              FOURWORDINLINE(0x203C, 0x000C, 0x0049, 0xABEE);
  825. EXTERN_API( CMError )
  826. CMGetNamedColorName             (CMProfileRef           prof,
  827.                                  UInt32                 index,
  828.                                  StringPtr              name)                               FOURWORDINLINE(0x203C, 0x000C, 0x004A, 0xABEE);
  829. /* General-purpose matching functions */
  830. EXTERN_API( CMError )
  831. NCWNewColorWorld                (CMWorldRef *           cw,
  832.                                  CMProfileRef           src,
  833.                                  CMProfileRef           dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0014, 0xABEE);
  834. EXTERN_API( CMError )
  835. CWConcatColorWorld              (CMWorldRef *           cw,
  836.                                  CMConcatProfileSet *   profileSet)                         FOURWORDINLINE(0x203C, 0x0008, 0x0015, 0xABEE);
  837. EXTERN_API( CMError )
  838. CWNewLinkProfile                (CMProfileRef *         prof,
  839.                                  const CMProfileLocation * targetLocation,
  840.                                  CMConcatProfileSet *   profileSet)                         FOURWORDINLINE(0x203C, 0x000C, 0x0033, 0xABEE);
  841. EXTERN_API( CMError )
  842. NCWConcatColorWorld             (CMWorldRef *           cw,
  843.                                  NCMConcatProfileSet *  profileSet,
  844.                                  CMConcatCallBackUPP    proc,
  845.                                  void *                 refCon)                             FOURWORDINLINE(0x203C, 0x0008, 0x0061, 0xABEE);
  846. EXTERN_API( CMError )
  847. NCWNewLinkProfile               (CMProfileRef *         prof,
  848.                                  const CMProfileLocation * targetLocation,
  849.                                  NCMConcatProfileSet *  profileSet,
  850.                                  CMConcatCallBackUPP    proc,
  851.                                  void *                 refCon)                             FOURWORDINLINE(0x203C, 0x000C, 0x0062, 0xABEE);
  852. EXTERN_API( void )
  853. CWDisposeColorWorld             (CMWorldRef             cw)                                 FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xABEE);
  854. EXTERN_API( CMError )
  855. CWMatchColors                   (CMWorldRef             cw,
  856.                                  CMColor *              myColors,
  857.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0002, 0xABEE);
  858. EXTERN_API( CMError )
  859. CWCheckColors                   (CMWorldRef             cw,
  860.                                  CMColor *              myColors,
  861.                                  UInt32                 count,
  862.                                  UInt32 *               result)                             FOURWORDINLINE(0x203C, 0x0010, 0x0003, 0xABEE);
  863. EXTERN_API( CMError )
  864. CWMatchBitmap                   (CMWorldRef             cw,
  865.                                  CMBitmap *             bitmap,
  866.                                  CMBitmapCallBackUPP    progressProc,
  867.                                  void *                 refCon,
  868.                                  CMBitmap *             matchedBitmap)                      FOURWORDINLINE(0x203C, 0x0010, 0x002C, 0xABEE);
  869. EXTERN_API( CMError )
  870. CWCheckBitmap                   (CMWorldRef             cw,
  871.                                  const CMBitmap *       bitmap,
  872.                                  CMBitmapCallBackUPP    progressProc,
  873.                                  void *                 refCon,
  874.                                  CMBitmap *             resultBitmap)                       FOURWORDINLINE(0x203C, 0x0014, 0x002D, 0xABEE);
  875. /* Quickdraw-specific matching */
  876. EXTERN_API( CMError )
  877. CWMatchPixMap                   (CMWorldRef             cw,
  878.                                  PixMap *               myPixMap,
  879.                                  CMBitmapCallBackUPP    progressProc,
  880.                                  void *                 refCon)                             FOURWORDINLINE(0x203C, 0x0010, 0x0004, 0xABEE);
  881. EXTERN_API( CMError )
  882. CWCheckPixMap                   (CMWorldRef             cw,
  883.                                  PixMap *               myPixMap,
  884.                                  CMBitmapCallBackUPP    progressProc,
  885.                                  void *                 refCon,
  886.                                  BitMap *               resultBitMap)                       FOURWORDINLINE(0x203C, 0x0014, 0x0007, 0xABEE);
  887. #if TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON
  888. EXTERN_API( CMError )
  889. NCMBeginMatching                (CMProfileRef           src,
  890.                                  CMProfileRef           dst,
  891.                                  CMMatchRef *           myRef)                              FOURWORDINLINE(0x203C, 0x000C, 0x0016, 0xABEE);
  892. EXTERN_API( void )
  893. CMEndMatching                   (CMMatchRef             myRef)                              FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xABEE);
  894. EXTERN_API( void )
  895. NCMDrawMatchedPicture           (PicHandle              myPicture,
  896.                                  CMProfileRef           dst,
  897.                                  Rect *                 myRect)                             FOURWORDINLINE(0x203C, 0x000C, 0x0017, 0xABEE);
  898. EXTERN_API( void )
  899. CMEnableMatchingComment         (Boolean                enableIt)                           FOURWORDINLINE(0x203C, 0x0002, 0x000D, 0xABEE);
  900. EXTERN_API( CMError )
  901. NCMUseProfileComment            (CMProfileRef           prof,
  902.                                  UInt32                 flags)                              FOURWORDINLINE(0x203C, 0x0008, 0x003B, 0xABEE);
  903. #endif  /* TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON */
  904. #if TARGET_OS_WIN32
  905. #if CALL_NOT_IN_CARBON
  906. EXTERN_API( CMError )
  907. CWMatchHBITMAP                  (CMWorldRef             cw,
  908.                                  HBITMAP                hBitmap,
  909.                                  CMBitmapCallBackUPP    progressProc,
  910.                                  void *                 refCon);
  911. #endif  /* CALL_NOT_IN_CARBON */
  912. #endif  /* TARGET_OS_WIN32 */
  913. EXTERN_API( CMError )
  914. CMCreateProfileIdentifier       (CMProfileRef           prof,
  915.                                  CMProfileIdentifierPtr  ident,
  916.                                  UInt32 *               size)                               FOURWORDINLINE(0x203C, 0x000C, 0x0041, 0xABEE);
  917. /* System Profile access */
  918. EXTERN_API( CMError )
  919. CMGetSystemProfile              (CMProfileRef *         prof)                               FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xABEE);
  920. EXTERN_API( CMError )
  921. CMSetSystemProfile              (const FSSpec *         profileFileSpec)                    FOURWORDINLINE(0x203C, 0x0004, 0x0019, 0xABEE);
  922. EXTERN_API( CMError )
  923. NCMSetSystemProfile             (const CMProfileLocation * profLoc)                         FOURWORDINLINE(0x203C, 0x0004, 0x0064, 0xABEE);
  924. EXTERN_API( CMError )
  925. CMGetDefaultProfileBySpace      (OSType                 dataColorSpace,
  926.                                  CMProfileRef *         prof)                               FOURWORDINLINE(0x203C, 0x0008, 0x005A, 0xABEE);
  927. EXTERN_API( CMError )
  928. CMSetDefaultProfileBySpace      (OSType                 dataColorSpace,
  929.                                  CMProfileRef           prof)                               FOURWORDINLINE(0x203C, 0x0008, 0x005B, 0xABEE);
  930. #if TARGET_OS_MAC
  931. EXTERN_API( CMError )
  932. CMGetProfileByAVID              (AVIDType               theAVID,
  933.                                  CMProfileRef *         prof)                               FOURWORDINLINE(0x203C, 0x0008, 0x005C, 0xABEE);
  934. EXTERN_API( CMError )
  935. CMSetProfileByAVID              (AVIDType               theAVID,
  936.                                  CMProfileRef           prof)                               FOURWORDINLINE(0x203C, 0x0008, 0x005D, 0xABEE);
  937. #endif  /* TARGET_OS_MAC */
  938. /* Profile Use enumerations */
  939. enum {
  940.     cmInputUse                  = FOUR_CHAR_CODE('inpt'),
  941.     cmOutputUse                 = FOUR_CHAR_CODE('outp'),
  942.     cmDisplayUse                = FOUR_CHAR_CODE('dply'),
  943.     cmProofUse                  = FOUR_CHAR_CODE('pruf')
  944. };
  945. /* Profile access by Use */
  946. EXTERN_API( CMError )
  947. CMGetDefaultProfileByUse        (OSType                 use,
  948.                                  CMProfileRef *         prof)                               FOURWORDINLINE(0x203C, 0x0008, 0x0069, 0xABEE);
  949. EXTERN_API( CMError )
  950. CMSetDefaultProfileByUse        (OSType                 use,
  951.                                  CMProfileRef           prof)                               FOURWORDINLINE(0x203C, 0x0008, 0x0079, 0xABEE);
  952. /* Profile Management */
  953. EXTERN_API( CMError )
  954. CMNewProfileSearch              (CMSearchRecord *       searchSpec,
  955.                                  void *                 refCon,
  956.                                  UInt32 *               count,
  957.                                  CMProfileSearchRef *   searchResult)                       FOURWORDINLINE(0x203C, 0x0010, 0x0027, 0xABEE);
  958. EXTERN_API( CMError )
  959. CMUpdateProfileSearch           (CMProfileSearchRef     search,
  960.                                  void *                 refCon,
  961.                                  UInt32 *               count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0028, 0xABEE);
  962. EXTERN_API( void )
  963. CMDisposeProfileSearch          (CMProfileSearchRef     search)                             FOURWORDINLINE(0x203C, 0x0004, 0x0029, 0xABEE);
  964. EXTERN_API( CMError )
  965. CMSearchGetIndProfile           (CMProfileSearchRef     search,
  966.                                  UInt32                 index,
  967.                                  CMProfileRef *         prof)                               FOURWORDINLINE(0x203C, 0x000C, 0x002A, 0xABEE);
  968. EXTERN_API( CMError )
  969. CMSearchGetIndProfileFileSpec   (CMProfileSearchRef     search,
  970.                                  UInt32                 index,
  971.                                  FSSpec *               profileFile)                        FOURWORDINLINE(0x203C, 0x000C, 0x002B, 0xABEE);
  972. EXTERN_API( CMError )
  973. CMProfileIdentifierFolderSearch (CMProfileIdentifierPtr  ident,
  974.                                  UInt32 *               matchedCount,
  975.                                  CMProfileSearchRef *   searchResult)                       FOURWORDINLINE(0x203C, 0x000C, 0x003F, 0xABEE);
  976. EXTERN_API( CMError )
  977. CMProfileIdentifierListSearch   (CMProfileIdentifierPtr  ident,
  978.                                  CMProfileRef *         profileList,
  979.                                  UInt32                 listSize,
  980.                                  UInt32 *               matchedCount,
  981.                                  CMProfileRef *         matchedList)                        FOURWORDINLINE(0x203C, 0x0014, 0x0040, 0xABEE);
  982. EXTERN_API( CMError )
  983. CMIterateColorSyncFolder        (CMProfileIterateUPP    proc,
  984.                                  UInt32 *               seed,
  985.                                  UInt32 *               count,
  986.                                  void *                 refCon)                             FOURWORDINLINE(0x203C, 0x0010, 0x0058, 0xABEE);
  987. EXTERN_API( CMError )
  988. NCMUnflattenProfile             (CMProfileLocation *    targetLocation,
  989.                                  CMFlattenUPP           proc,
  990.                                  void *                 refCon,
  991.                                  Boolean *              preferredCMMnotfound)               FOURWORDINLINE(0x203C, 0x0010, 0x0065, 0xABEE);
  992. /* Utilities */
  993. #if TARGET_OS_MAC
  994. EXTERN_API( CMError )
  995. CMGetColorSyncFolderSpec        (short                  vRefNum,
  996.                                  Boolean                createFolder,
  997.                                  short *                foundVRefNum,
  998.                                  long *                 foundDirID)                         FOURWORDINLINE(0x203C, 0x000C, 0x0011, 0xABEE);
  999. #endif  /* TARGET_OS_MAC */
  1000. #if TARGET_OS_WIN32 || TARGET_OS_UNIX
  1001. #if CALL_NOT_IN_CARBON
  1002. EXTERN_API( CMError )
  1003. CMGetColorSyncFolderPath        (Boolean                createFolder,
  1004.                                  char *                 lpBuffer,
  1005.                                  UInt32                 uSize);
  1006. #endif  /* CALL_NOT_IN_CARBON */
  1007. #endif  /* TARGET_OS_WIN32 || TARGET_OS_UNIX */
  1008. EXTERN_API( CMError )
  1009. CMGetCWInfo                     (CMWorldRef             cw,
  1010.                                  CMCWInfoRecord *       info)                               FOURWORDINLINE(0x203C, 0x0008, 0x001A, 0xABEE);
  1011. #if TARGET_API_MAC_OS8
  1012. #if CALL_NOT_IN_CARBON
  1013. EXTERN_API( CMError )
  1014. CMConvertProfile2to1            (CMProfileRef           profv2,
  1015.                                  CMProfileHandle *      profv1)                             FOURWORDINLINE(0x203C, 0x0008, 0x0045, 0xABEE);
  1016. #endif  /* CALL_NOT_IN_CARBON */
  1017. #endif  /* TARGET_API_MAC_OS8 */
  1018. EXTERN_API( CMError )
  1019. CMGetPreferredCMM               (OSType *               cmmType,
  1020.                                  Boolean *              preferredCMMnotfound)               FOURWORDINLINE(0x203C, 0x0008, 0x005E, 0xABEE);
  1021. EXTERN_API( CMError )
  1022. CMIterateCMMInfo                (CMMIterateUPP          proc,
  1023.                                  UInt32 *               count,
  1024.                                  void *                 refCon)                             FOURWORDINLINE(0x203C, 0x000C, 0x0063, 0xABEE);
  1025. EXTERN_API( CMError )
  1026. CMGetColorSyncVersion           (UInt32 *               version)                            FOURWORDINLINE(0x203C, 0x0004, 0x0066, 0xABEE);
  1027. EXTERN_API( CMError )
  1028. CMLaunchControlPanel            (UInt32                 flags);
  1029. /* ColorSpace conversion functions */
  1030. EXTERN_API( CMError )
  1031. CMConvertXYZToLab               (const CMColor *        src,
  1032.                                  const CMXYZColor *     white,
  1033.                                  CMColor *              dst,
  1034.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x0010, 0x004B, 0xABEE);
  1035. EXTERN_API( CMError )
  1036. CMConvertLabToXYZ               (const CMColor *        src,
  1037.                                  const CMXYZColor *     white,
  1038.                                  CMColor *              dst,
  1039.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x0010, 0x004C, 0xABEE);
  1040. EXTERN_API( CMError )
  1041. CMConvertXYZToLuv               (const CMColor *        src,
  1042.                                  const CMXYZColor *     white,
  1043.                                  CMColor *              dst,
  1044.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x0010, 0x004D, 0xABEE);
  1045. EXTERN_API( CMError )
  1046. CMConvertLuvToXYZ               (const CMColor *        src,
  1047.                                  const CMXYZColor *     white,
  1048.                                  CMColor *              dst,
  1049.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x0010, 0x004E, 0xABEE);
  1050. EXTERN_API( CMError )
  1051. CMConvertXYZToYxy               (const CMColor *        src,
  1052.                                  CMColor *              dst,
  1053.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x004F, 0xABEE);
  1054. EXTERN_API( CMError )
  1055. CMConvertYxyToXYZ               (const CMColor *        src,
  1056.                                  CMColor *              dst,
  1057.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0050, 0xABEE);
  1058. EXTERN_API( CMError )
  1059. CMConvertRGBToHLS               (const CMColor *        src,
  1060.                                  CMColor *              dst,
  1061.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0051, 0xABEE);
  1062. EXTERN_API( CMError )
  1063. CMConvertHLSToRGB               (const CMColor *        src,
  1064.                                  CMColor *              dst,
  1065.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0052, 0xABEE);
  1066. EXTERN_API( CMError )
  1067. CMConvertRGBToHSV               (const CMColor *        src,
  1068.                                  CMColor *              dst,
  1069.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0053, 0xABEE);
  1070. EXTERN_API( CMError )
  1071. CMConvertHSVToRGB               (const CMColor *        src,
  1072.                                  CMColor *              dst,
  1073.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0054, 0xABEE);
  1074. EXTERN_API( CMError )
  1075. CMConvertRGBToGray              (const CMColor *        src,
  1076.                                  CMColor *              dst,
  1077.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0055, 0xABEE);
  1078. EXTERN_API( CMError )
  1079. CMConvertXYZToFixedXYZ          (const CMXYZColor *     src,
  1080.                                  CMFixedXYZColor *      dst,
  1081.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0056, 0xABEE);
  1082. EXTERN_API( CMError )
  1083. CMConvertFixedXYZToXYZ          (const CMFixedXYZColor * src,
  1084.                                  CMXYZColor *           dst,
  1085.                                  UInt32                 count)                              FOURWORDINLINE(0x203C, 0x000C, 0x0057, 0xABEE);
  1086. /* PS-related */
  1087. EXTERN_API( CMError )
  1088. CMGetPS2ColorSpace              (CMProfileRef           srcProf,
  1089.                                  UInt32                 flags,
  1090.                                  CMFlattenUPP           proc,
  1091.                                  void *                 refCon,
  1092.                                  Boolean *              preferredCMMnotfound)               FOURWORDINLINE(0x203C, 0x0014, 0x002E, 0xABEE);
  1093. EXTERN_API( CMError )
  1094. CMGetPS2ColorRenderingIntent    (CMProfileRef           srcProf,
  1095.                                  UInt32                 flags,
  1096.                                  CMFlattenUPP           proc,
  1097.                                  void *                 refCon,
  1098.                                  Boolean *              preferredCMMnotfound)               FOURWORDINLINE(0x203C, 0x0014, 0x002F, 0xABEE);
  1099. EXTERN_API( CMError )
  1100. CMGetPS2ColorRendering          (CMProfileRef           srcProf,
  1101.                                  CMProfileRef           dstProf,
  1102.                                  UInt32                 flags,
  1103.                                  CMFlattenUPP           proc,
  1104.                                  void *                 refCon,
  1105.                                  Boolean *              preferredCMMnotfound)               FOURWORDINLINE(0x203C, 0x0018, 0x0030, 0xABEE);
  1106. EXTERN_API( CMError )
  1107. CMGetPS2ColorRenderingVMSize    (CMProfileRef           srcProf,
  1108.                                  CMProfileRef           dstProf,
  1109.                                  UInt32 *               vmSize,
  1110.                                  Boolean *              preferredCMMnotfound)               FOURWORDINLINE(0x203C, 0x0010, 0x003D, 0xABEE);
  1111. /* ColorSync 1.0 functions which have parallel 2.0 counterparts */
  1112. #if TARGET_API_MAC_OS8
  1113. #if CALL_NOT_IN_CARBON
  1114. EXTERN_API( CMError )
  1115. CWNewColorWorld                 (CMWorldRef *           cw,
  1116.                                  CMProfileHandle        src,
  1117.                                  CMProfileHandle        dst)                                FOURWORDINLINE(0x203C, 0x000C, 0x0000, 0xABEE);
  1118. EXTERN_API( CMError )
  1119. ConcatenateProfiles             (CMProfileHandle        thru,
  1120.                                  CMProfileHandle        dst,
  1121.                                  CMProfileHandle *      newDst)                             FOURWORDINLINE(0x203C, 0x000C, 0x000C, 0xABEE);
  1122. EXTERN_API( CMError )
  1123. CMBeginMatching                 (CMProfileHandle        src,
  1124.                                  CMProfileHandle        dst,
  1125.                                  CMMatchRef *           myRef)                              FOURWORDINLINE(0x203C, 0x000C, 0x000A, 0xABEE);
  1126. EXTERN_API( void )
  1127. CMDrawMatchedPicture            (PicHandle              myPicture,
  1128.                                  CMProfileHandle        dst,
  1129.                                  Rect *                 myRect)                             FOURWORDINLINE(0x203C, 0x000C, 0x0009, 0xABEE);
  1130. EXTERN_API( CMError )
  1131. CMUseProfileComment             (CMProfileHandle        profile)                            FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xABEE);
  1132. EXTERN_API( void )
  1133. CMGetProfileName                (CMProfileHandle        myProfile,
  1134.                                  CMIString *            IStringResult)                      FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xABEE);
  1135. EXTERN_API( long )
  1136. CMGetProfileAdditionalDataOffset (CMProfileHandle       myProfile)                          FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xABEE);
  1137. /* ProfileResponder functions */
  1138. EXTERN_API( CMError )
  1139. GetProfile                      (OSType                 deviceType,
  1140.                                  long                   refNum,
  1141.                                  CMProfileHandle        aProfile,
  1142.                                  CMProfileHandle *      returnedProfile)                    FOURWORDINLINE(0x203C, 0x0010, 0x0005, 0xABEE);
  1143. EXTERN_API( CMError )
  1144. SetProfile                      (OSType                 deviceType,
  1145.                                  long                   refNum,
  1146.                                  CMProfileHandle        newProfile)                         FOURWORDINLINE(0x203C, 0x000C, 0x0006, 0xABEE);
  1147. EXTERN_API( CMError )
  1148. SetProfileDescription           (OSType                 deviceType,
  1149.                                  long                   refNum,
  1150.                                  long                   deviceData,
  1151.                                  CMProfileHandle        hProfile)                           FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xABEE);
  1152. EXTERN_API( CMError )
  1153. GetIndexedProfile               (OSType                 deviceType,
  1154.                                  long                   refNum,
  1155.                                  CMProfileSearchRecordHandle  search,
  1156.                                  CMProfileHandle *      returnProfile,
  1157.                                  long *                 index)                              FOURWORDINLINE(0x203C, 0x0014, 0x0012, 0xABEE);
  1158. EXTERN_API( CMError )
  1159. DeleteDeviceProfile             (OSType                 deviceType,
  1160.                                  long                   refNum,
  1161.                                  CMProfileHandle        deleteMe)                           FOURWORDINLINE(0x203C, 0x000C, 0x0013, 0xABEE);
  1162. #endif  /* CALL_NOT_IN_CARBON */
  1163. #if OLDROUTINENAMES
  1164. /* constants */
  1165. typedef CMFlattenProcPtr                CMFlattenProc;
  1166. typedef CMBitmapCallBackProcPtr         CMBitmapCallBackProc;
  1167. typedef CMProfileFilterProcPtr          CMProfileFilterProc;
  1168. enum {
  1169.     CMTrap                      = cmTrap,
  1170.     CMBeginProfile              = cmBeginProfile,
  1171.     CMEndProfile                = cmEndProfile,
  1172.     CMEnableMatching            = cmEnableMatching,
  1173.     CMDisableMatching           = cmDisableMatching
  1174. };
  1175. /* 1.0 Error codes, for compatibility with older applications. 1.0 CMM's may return obsolete error codes */
  1176. enum {
  1177.     CMNoError                   = 0,                            /*    obsolete name, use noErr */
  1178.     CMProfileError              = cmProfileError,
  1179.     CMMethodError               = cmMethodError,
  1180.     CMMemFullError              = -172,                         /*    obsolete, 2.0 uses memFullErr */
  1181.     CMUnimplementedError        = -173,                         /*    obsolete, 2.0 uses unimpErr */
  1182.     CMParamError                = -174,                         /*    obsolete, 2.0 uses paramErr */
  1183.     CMMethodNotFound            = cmMethodNotFound,
  1184.     CMProfileNotFound           = cmProfileNotFound,
  1185.     CMProfilesIdentical         = cmProfilesIdentical,
  1186.     CMCantConcatenateError      = cmCantConcatenateError,
  1187.     CMCantXYZ                   = cmCantXYZ,
  1188.     CMCantDeleteProfile         = cmCantDeleteProfile,
  1189.     CMUnsupportedDataType       = cmUnsupportedDataType,
  1190.     CMNoCurrentProfile          = cmNoCurrentProfile
  1191. };
  1192. enum {
  1193.     qdSystemDevice              = cmSystemDevice,
  1194.     qdGDevice                   = cmGDevice
  1195. };
  1196. enum {
  1197.     kMatchCMMType               = cmMatchCMMType,
  1198.     kMatchApplProfileVersion    = cmMatchApplProfileVersion,
  1199.     kMatchDataType              = cmMatchDataType,
  1200.     kMatchDeviceType            = cmMatchDeviceType,
  1201.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer,
  1202.     kMatchDeviceModel           = cmMatchDeviceModel,
  1203.     kMatchDeviceAttributes      = cmMatchDeviceAttributes,
  1204.     kMatchFlags                 = cmMatchFlags,
  1205.     kMatchOptions               = cmMatchOptions,
  1206.     kMatchWhite                 = cmMatchWhite,
  1207.     kMatchBlack                 = cmMatchBlack
  1208. };
  1209. /* types */
  1210. typedef CMCMYKColor                     CMYKColor;
  1211. typedef CMWorldRef                      CWorld;
  1212. typedef long *                          CMGamutResult;
  1213. /* functions */
  1214. #define EndMatching(myRef)                                                      CMEndMatching(myRef)
  1215. #define EnableMatching(enableIt)                                                CMEnableMatchingComment(enableIt)
  1216. #define GetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID) CMGetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)
  1217. #define BeginMatching(src, dst, myRef)                                          CMBeginMatching(src, dst, myRef)
  1218. #define DrawMatchedPicture(myPicture, dst, myRect)                              CMDrawMatchedPicture(myPicture, dst, myRect)
  1219. #define UseProfile(profile)                                                     CMUseProfileComment(profile)
  1220. #define GetProfileName(myProfile, IStringResult)                                CMGetProfileName(myProfile, IStringResult)
  1221. #define GetProfileAdditionalDataOffset(myProfile)                               CMGetProfileAdditionalDataOffset(myProfile)
  1222. #endif  /* OLDROUTINENAMES */
  1223. /* Deprecated stuff*/
  1224. /* PrGeneral parameter blocks */
  1225. struct TEnableColorMatchingBlk {
  1226.     short                           iOpCode;
  1227.     short                           iError;
  1228.     long                            lReserved;
  1229.     THPrint                         hPrint;
  1230.     Boolean                         fEnableIt;
  1231.     SInt8                           filler;
  1232. };
  1233. typedef struct TEnableColorMatchingBlk  TEnableColorMatchingBlk;
  1234. struct TRegisterProfileBlk {
  1235.     short                           iOpCode;
  1236.     short                           iError;
  1237.     long                            lReserved;
  1238.     THPrint                         hPrint;
  1239.     Boolean                         fRegisterIt;
  1240.     SInt8                           filler;
  1241. };
  1242. typedef struct TRegisterProfileBlk      TRegisterProfileBlk;
  1243. #endif  /* TARGET_API_MAC_OS8 */
  1244. #if PRAGMA_STRUCT_ALIGN
  1245.     #pragma options align=reset
  1246. #elif PRAGMA_STRUCT_PACKPUSH
  1247.     #pragma pack(pop)
  1248. #elif PRAGMA_STRUCT_PACK
  1249.     #pragma pack()
  1250. #endif
  1251. #ifdef PRAGMA_IMPORT_OFF
  1252. #pragma import off
  1253. #elif PRAGMA_IMPORT
  1254. #pragma import reset
  1255. #endif
  1256. #ifdef __cplusplus
  1257. }
  1258. #endif
  1259. #endif /* __CMAPPLICATION__ */