Mac OS 9
CMApplication.h
Go to the documentation of this file.
1 
19 #ifndef __CMAPPLICATION__
20 #define __CMAPPLICATION__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __FILES__
27 #include <Files.h>
28 #endif
29 
30 #ifndef __CMICCPROFILE__
31 #include <CMICCProfile.h>
32 #endif
33 
34 #ifndef __MACERRORS__
35 #include <MacErrors.h>
36 #endif
37 
38 #ifndef __CMTYPES__
39 #include <CMTypes.h>
40 #endif
41 
42 #ifndef __CFSTRING__
43 #include <CFString.h>
44 #endif
45 
46 #ifndef __CFDICTIONARY__
47 #include <CFDictionary.h>
48 #endif
49 
50 #define _DECLARE_CS_QD_API_ 1
51 #ifndef __QUICKDRAW__
52 #include <Quickdraw.h>
53 #endif
54 
55 #if TARGET_API_MAC_OS8
56 #ifndef __PRINTING__
57 #include <Printing.h>
58 #endif
59 
60 #endif /* TARGET_API_MAC_OS8 */
61 
62 #if TARGET_OS_WIN32
63 #include <windows.h>
64 #endif
65 
66 #if PRAGMA_ONCE
67 #pragma once
68 #endif
69 
70 #ifdef __cplusplus
71 extern "C"
72 {
73 #endif
74 
75 #if PRAGMA_IMPORT
76 #pragma import on
77 #endif
78 
79 #if PRAGMA_STRUCT_ALIGN
80 #pragma options align = mac68k
81 #elif PRAGMA_STRUCT_PACKPUSH
82 #pragma pack(push, 2)
83 #elif PRAGMA_STRUCT_PACK
84 #pragma pack(2)
85 #endif
86 
87  enum
88  {
89  kDefaultCMMSignature = FOUR_CHAR_CODE('appl')
90  };
91 
92  /* Macintosh 68K trap word */
93  enum
94  {
95  cmTrap = 0xABEE
96  };
97 
98  /* PicComment IDs */
99  enum
100  {
101  cmBeginProfile = 220,
102  cmEndProfile = 221,
103  cmEnableMatching = 222,
104  cmDisableMatching = 223,
105  cmComment = 224
106  };
107 
108  /* PicComment selectors for cmComment */
109  enum
110  {
111  cmBeginProfileSel = 0,
112  cmContinueProfileSel = 1,
113  cmEndProfileSel = 2,
114  cmProfileIdentifierSel = 3
115  };
116 
117  /* Defines for version 1.0 CMProfileSearchRecord.fieldMask */
118  enum
119  {
120  cmMatchCMMType = 0x00000001,
121  cmMatchApplProfileVersion = 0x00000002,
122  cmMatchDataType = 0x00000004,
123  cmMatchDeviceType = 0x00000008,
124  cmMatchDeviceManufacturer = 0x00000010,
125  cmMatchDeviceModel = 0x00000020,
126  cmMatchDeviceAttributes = 0x00000040,
127  cmMatchFlags = 0x00000080,
128  cmMatchOptions = 0x00000100,
129  cmMatchWhite = 0x00000200,
130  cmMatchBlack = 0x00000400
131  };
132 
133  /* Defines for version 2.0 CMSearchRecord.searchMask */
134  enum
135  {
136  cmMatchAnyProfile = 0x00000000,
137  cmMatchProfileCMMType = 0x00000001,
138  cmMatchProfileClass = 0x00000002,
139  cmMatchDataColorSpace = 0x00000004,
140  cmMatchProfileConnectionSpace = 0x00000008,
141  cmMatchManufacturer = 0x00000010,
142  cmMatchModel = 0x00000020,
143  cmMatchAttributes = 0x00000040,
144  cmMatchProfileFlags = 0x00000080
145  };
146 
147  /* Flags for PostScript-related functions */
148  enum
149  {
150  cmPS7bit = 1,
151  cmPS8bit = 2
152  };
153 
154  /* Flags for profile embedding functions */
155  enum
156  {
157  cmEmbedWholeProfile = 0x00000000,
158  cmEmbedProfileIdentifier = 0x00000001
159  };
160 
161  /* Commands for CMFlattenUPP() */
162  enum
163  {
164  cmOpenReadSpool = 1,
165  cmOpenWriteSpool = 2,
166  cmReadSpool = 3,
167  cmWriteSpool = 4,
168  cmCloseSpool = 5
169  };
170 
171  /* Commands for CMAccessUPP() */
172  enum
173  {
174  cmOpenReadAccess = 1,
175  cmOpenWriteAccess = 2,
176  cmReadAccess = 3,
177  cmWriteAccess = 4,
178  cmCloseAccess = 5,
179  cmCreateNewAccess = 6,
180  cmAbortWriteAccess = 7,
181  cmBeginAccess = 8,
182  cmEndAccess = 9
183  };
184 
185  /* Use types for CMGet/SetDefaultProfileByUse() */
186  enum
187  {
188  cmInputUse = FOUR_CHAR_CODE('inpt'),
189  cmOutputUse = FOUR_CHAR_CODE('outp'),
190  cmDisplayUse = FOUR_CHAR_CODE('dply'),
191  cmProofUse = FOUR_CHAR_CODE('pruf')
192  };
193 
194  /* Union of 1.0 and 2.0 profile header variants */
196  {
197  CMHeader cm1;
198  CM2Header cm2;
199  };
201  /* CWConcatColorWorld() definitions */
203  {
204  UInt16 keyIndex; /* Zero-based */
205  UInt16 count; /* Min 1 */
206  CMProfileRef profileSet[1]; /* Variable. Ordered from Source -> Dest */
207  };
208  typedef struct CMConcatProfileSet CMConcatProfileSet;
209  /* NCWConcatColorWorld() definitions */
211  {
212  UInt32 renderingIntent; /* renderingIntent override */
213  UInt32 transformTag; /* transform enumerations defined below */
214  CMProfileRef profile; /* profile */
215  };
218  {
219  OSType cmm; /* e.g. 'KCMS', 'appl', ... uniquely ids the cmm, or 0000 */
220  UInt32 flags; /* specify quality, lookup only, no gamut checking ... */
221  UInt32 flagsMask; /* which bits of 'flags' to use to override profile */
222  UInt32 profileCount; /* how many ProfileSpecs in the following set */
224  profileSpecs[1]; /* Variable. Ordered from Source -> Dest */
225  };
227  enum
228  {
229  kNoTransform = 0, /* Not used */
230  kUseAtoB = 1, /* Use 'A2B*' tag from this profile or equivalent */
231  kUseBtoA = 2, /* Use 'B2A*' tag from this profile or equivalent */
232  kUseBtoB = 3, /* Use 'pre*' tag from this profile or equivalent */
233  /* For typical device profiles the following synonyms may be useful */
234  kDeviceToPCS = kUseAtoB, /* Device Dependent to Device Independent */
235  kPCSToDevice = kUseBtoA, /* Device Independent to Device Dependent */
236  kPCSToPCS = kUseBtoB, /* Independent, through device's gamut */
237  kUseProfileIntent =
238  (long)0xFFFFFFFF /* For renderingIntent in NCMConcatProfileSpec */
239  };
240 
241  /* ColorSync color data types */
242  struct CMRGBColor
243  {
244  UInt16 red; /* 0..65535 */
245  UInt16 green;
246  UInt16 blue;
247  };
248  typedef struct CMRGBColor CMRGBColor;
249  struct CMCMYKColor
250  {
251  UInt16 cyan; /* 0..65535 */
252  UInt16 magenta;
253  UInt16 yellow;
254  UInt16 black;
255  };
256  typedef struct CMCMYKColor CMCMYKColor;
257  struct CMCMYColor
258  {
259  UInt16 cyan; /* 0..65535 */
260  UInt16 magenta;
261  UInt16 yellow;
262  };
263  typedef struct CMCMYColor CMCMYColor;
264  struct CMHLSColor
265  {
266  UInt16 hue; /* 0..65535. Fraction of circle. Red at 0 */
267  UInt16 lightness; /* 0..65535 */
268  UInt16 saturation; /* 0..65535 */
269  };
270  typedef struct CMHLSColor CMHLSColor;
271  struct CMHSVColor
272  {
273  UInt16 hue; /* 0..65535. Fraction of circle. Red at 0 */
274  UInt16 saturation; /* 0..65535 */
275  UInt16 value; /* 0..65535 */
276  };
277  typedef struct CMHSVColor CMHSVColor;
278  struct CMLabColor
279  {
280  UInt16 L; /* 0..65535 maps to 0..100 */
281  UInt16 a; /* 0..65535 maps to -128..127.996 */
282  UInt16 b; /* 0..65535 maps to -128..127.996 */
283  };
284  typedef struct CMLabColor CMLabColor;
285  struct CMLuvColor
286  {
287  UInt16 L; /* 0..65535 maps to 0..100 */
288  UInt16 u; /* 0..65535 maps to -128..127.996 */
289  UInt16 v; /* 0..65535 maps to -128..127.996 */
290  };
291  typedef struct CMLuvColor CMLuvColor;
292  struct CMYxyColor
293  {
294  UInt16 capY; /* 0..65535 maps to 0..1 */
295  UInt16 x; /* 0..65535 maps to 0..1 */
296  UInt16 y; /* 0..65535 maps to 0..1 */
297  };
298  typedef struct CMYxyColor CMYxyColor;
299  struct CMGrayColor
300  {
301  UInt16 gray; /* 0..65535 */
302  };
303  typedef struct CMGrayColor CMGrayColor;
305  {
306  UInt8 components[5]; /* 0..255 */
307  };
310  {
311  UInt8 components[6]; /* 0..255 */
312  };
315  {
316  UInt8 components[7]; /* 0..255 */
317  };
320  {
321  UInt8 components[8]; /* 0..255 */
322  };
325  {
326  UInt32 namedColorIndex; /* 0..a lot */
327  };
328  typedef struct CMNamedColor CMNamedColor;
329  union CMColor
330  {
331  CMRGBColor rgb;
332  CMHSVColor hsv;
333  CMHLSColor hls;
334  CMXYZColor XYZ;
335  CMLabColor Lab;
336  CMLuvColor Luv;
337  CMYxyColor Yxy;
338  CMCMYKColor cmyk;
339  CMCMYColor cmy;
340  CMGrayColor gray;
345  CMNamedColor namedColor;
346  };
347  typedef union CMColor CMColor;
348  /* GetIndexedProfile() search definition */
350  {
352  UInt32 fieldMask;
353  UInt32 reserved[2];
354  };
358  /* CMNewProfileSearch() search definition */
360  {
361  OSType CMMType;
362  OSType profileClass;
363  OSType dataColorSpace;
364  OSType profileConnectionSpace;
365  UInt32 deviceManufacturer;
366  UInt32 deviceModel;
367  UInt32 deviceAttributes[2];
368  UInt32 profileFlags;
369  UInt32 searchMask;
370  CMProfileFilterUPP filter;
371  };
372  typedef struct CMSearchRecord CMSearchRecord;
373  /* CMMIterateUPP() structure */
374  struct CMMInfo
375  {
376  UInt32 dataSize; /* Size of this structure - compatibility*/
377  OSType CMMType; /* Signature, e.g. 'appl', 'HDM ' or 'KCMS'*/
378  OSType CMMMfr; /* Vendor, e.g. 'appl'*/
379  UInt32 CMMVersion; /* CMM version number*/
380  unsigned char ASCIIName[32]; /* pascal string - name*/
381  unsigned char ASCIIDesc[256]; /* pascal string - description or copyright*/
382  UniCharCount UniCodeNameCount; /* count of UniChars in following array*/
383  UniChar UniCodeName[32]; /* the name in UniCode chars*/
384  UniCharCount UniCodeDescCount; /* count of UniChars in following array*/
385  UniChar UniCodeDesc[256]; /* the description in UniCode chars*/
386  };
387  typedef struct CMMInfo CMMInfo;
388  /* GetCWInfo() structures */
390  {
391  OSType CMMType;
392  long CMMVersion;
393  };
394  typedef struct CMMInfoRecord CMMInfoRecord;
396  {
397  UInt32 cmmCount;
398  CMMInfoRecord cmmInfo[2];
399  };
400  typedef struct CMCWInfoRecord CMCWInfoRecord;
401  /* profile identifier structures */
403  {
404  CM2Header profileHeader;
405  CMDateTime calibrationDate;
406  UInt32 ASCIIProfileDescriptionLen;
407  char ASCIIProfileDescription[1]; /* variable length */
408  };
411  /* colorspace masks */
412  enum
413  {
414  cmColorSpaceSpaceMask = 0x0000003F,
415  cmColorSpacePremulAlphaMask = 0x00000040,
416  cmColorSpaceAlphaMask = 0x00000080,
417  cmColorSpaceSpaceAndAlphaMask = 0x000000FF,
418  cmColorSpacePackingMask = 0x0000FF00,
419  cmColorSpaceEncodingMask = 0x000F0000,
420  cmColorSpaceReservedMask = (long)0xFFF00000
421  };
422 
423  /* packing formats */
424  enum
425  {
426  cmNoColorPacking = 0x0000,
427  cmWord5ColorPacking = 0x0500,
428  cmWord565ColorPacking = 0x0600,
429  cmLong8ColorPacking = 0x0800,
430  cmLong10ColorPacking = 0x0A00,
431  cmAlphaFirstPacking = 0x1000,
432  cmOneBitDirectPacking = 0x0B00,
433  cmAlphaLastPacking = 0x0000,
434  cm8_8ColorPacking = 0x2800,
435  cm16_8ColorPacking = 0x2000,
436  cm24_8ColorPacking = 0x2100,
437  cm32_8ColorPacking = cmLong8ColorPacking,
438  cm40_8ColorPacking = 0x2200,
439  cm48_8ColorPacking = 0x2300,
440  cm56_8ColorPacking = 0x2400,
441  cm64_8ColorPacking = 0x2500,
442  cm32_16ColorPacking = 0x2600,
443  cm48_16ColorPacking = 0x2900,
444  cm64_16ColorPacking = 0x2A00,
445  cm32_32ColorPacking = 0x2700,
446  cmLittleEndianPacking = 0x4000,
447  cmReverseChannelPacking = 0x8000
448  };
449 
450  /* channel encoding format */
451  enum
452  {
453  cmSRGB16ChannelEncoding =
454  0x00010000 /* used for sRGB64 encoding ( ©3.12 format)*/
455  };
456 
457  /* general colorspaces */
458  enum
459  {
460  cmNoSpace = 0x0000,
461  cmRGBSpace = 0x0001,
462  cmCMYKSpace = 0x0002,
463  cmHSVSpace = 0x0003,
464  cmHLSSpace = 0x0004,
465  cmYXYSpace = 0x0005,
466  cmXYZSpace = 0x0006,
467  cmLUVSpace = 0x0007,
468  cmLABSpace = 0x0008,
469  cmReservedSpace1 = 0x0009,
470  cmGraySpace = 0x000A,
471  cmReservedSpace2 = 0x000B,
472  cmGamutResultSpace = 0x000C,
473  cmNamedIndexedSpace = 0x0010,
474  cmMCFiveSpace = 0x0011,
475  cmMCSixSpace = 0x0012,
476  cmMCSevenSpace = 0x0013,
477  cmMCEightSpace = 0x0014,
478  cmAlphaPmulSpace = 0x0040,
479  cmAlphaSpace = 0x0080,
480  cmRGBASpace = cmRGBSpace + cmAlphaSpace,
481  cmGrayASpace = cmGraySpace + cmAlphaSpace,
482  cmRGBAPmulSpace = cmRGBASpace + cmAlphaPmulSpace,
483  cmGrayAPmulSpace = cmGrayASpace + cmAlphaPmulSpace
484  };
485 
486  /* supported CMBitmapColorSpaces - Each of the following is a */
487  /* combination of a general colospace and a packing formats. */
488  /* Each can also be or'd with cmReverseChannelPacking. */
489  enum
490  {
491  cmGray8Space = cmGraySpace + cm8_8ColorPacking,
492  cmGray16Space = cmGraySpace,
493  cmGray16LSpace = cmGraySpace + cmLittleEndianPacking,
494  cmGrayA16Space = cmGrayASpace + cm16_8ColorPacking,
495  cmGrayA32Space = cmGrayASpace,
496  cmGrayA32LSpace = cmGrayASpace + cmLittleEndianPacking,
497  cmGrayA16PmulSpace = cmGrayAPmulSpace + cm16_8ColorPacking,
498  cmGrayA32PmulSpace = cmGrayAPmulSpace,
499  cmGrayA32LPmulSpace = cmGrayAPmulSpace + cmLittleEndianPacking,
500  cmRGB16Space = cmRGBSpace + cmWord5ColorPacking,
501  cmRGB16LSpace = cmRGBSpace + cmWord5ColorPacking + cmLittleEndianPacking,
502  cmRGB565Space = cmRGBSpace + cmWord565ColorPacking,
503  cmRGB565LSpace = cmRGBSpace + cmWord565ColorPacking + cmLittleEndianPacking,
504  cmRGB24Space = cmRGBSpace + cm24_8ColorPacking,
505  cmRGB32Space = cmRGBSpace + cm32_8ColorPacking,
506  cmRGB48Space = cmRGBSpace + cm48_16ColorPacking,
507  cmRGB48LSpace = cmRGBSpace + cm48_16ColorPacking + cmLittleEndianPacking,
508  cmARGB32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaFirstPacking,
509  cmARGB64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking,
510  cmARGB64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaFirstPacking +
511  cmLittleEndianPacking,
512  cmRGBA32Space = cmRGBASpace + cm32_8ColorPacking + cmAlphaLastPacking,
513  cmRGBA64Space = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking,
514  cmRGBA64LSpace = cmRGBASpace + cm64_16ColorPacking + cmAlphaLastPacking +
515  cmLittleEndianPacking,
516  cmARGB32PmulSpace =
517  cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaFirstPacking,
518  cmARGB64PmulSpace =
519  cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaFirstPacking,
520  cmARGB64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking +
521  cmAlphaFirstPacking + cmLittleEndianPacking,
522  cmRGBA32PmulSpace = cmRGBAPmulSpace + cm32_8ColorPacking + cmAlphaLastPacking,
523  cmRGBA64PmulSpace =
524  cmRGBAPmulSpace + cm64_16ColorPacking + cmAlphaLastPacking,
525  cmRGBA64LPmulSpace = cmRGBAPmulSpace + cm64_16ColorPacking +
526  cmAlphaLastPacking + cmLittleEndianPacking,
527  cmCMYK32Space = cmCMYKSpace + cm32_8ColorPacking,
528  cmCMYK64Space = cmCMYKSpace + cm64_16ColorPacking,
529  cmCMYK64LSpace = cmCMYKSpace + cm64_16ColorPacking + cmLittleEndianPacking,
530  cmHSV32Space = cmHSVSpace + cmLong10ColorPacking,
531  cmHLS32Space = cmHLSSpace + cmLong10ColorPacking,
532  cmYXY32Space = cmYXYSpace + cmLong10ColorPacking,
533  cmXYZ24Space = cmXYZSpace + cm24_8ColorPacking,
534  cmXYZ32Space = cmXYZSpace + cmLong10ColorPacking,
535  cmXYZ48Space = cmXYZSpace + cm48_16ColorPacking,
536  cmXYZ48LSpace = cmXYZSpace + cm48_16ColorPacking + cmLittleEndianPacking,
537  cmLUV32Space = cmLUVSpace + cmLong10ColorPacking,
538  cmLAB24Space = cmLABSpace + cm24_8ColorPacking,
539  cmLAB32Space = cmLABSpace + cmLong10ColorPacking,
540  cmLAB48Space = cmLABSpace + cm48_16ColorPacking,
541  cmLAB48LSpace = cmLABSpace + cm48_16ColorPacking + cmLittleEndianPacking,
542  cmGamutResult1Space = cmOneBitDirectPacking + cmGamutResultSpace,
543  cmNamedIndexed32Space = cm32_32ColorPacking + cmNamedIndexedSpace,
544  cmNamedIndexed32LSpace =
545  cm32_32ColorPacking + cmNamedIndexedSpace + cmLittleEndianPacking,
546  cmMCFive8Space = cm40_8ColorPacking + cmMCFiveSpace,
547  cmMCSix8Space = cm48_8ColorPacking + cmMCSixSpace,
548  cmMCSeven8Space = cm56_8ColorPacking + cmMCSevenSpace,
549  cmMCEight8Space = cm64_8ColorPacking + cmMCEightSpace
550  };
551 
552  typedef UInt32 CMBitmapColorSpace;
553  struct CMBitmap
554  {
555  char *image;
556  long width;
557  long height;
558  long rowBytes;
559  long pixelSize;
560  CMBitmapColorSpace space;
561  long user1;
562  long user2;
563  };
564  typedef struct CMBitmap CMBitmap;
565  /* CMConvertXYZToXYZ() definitions */
566 
567  typedef UInt32 CMChromaticAdaptation;
568  enum
569  {
570  cmUseDefaultChromaticAdaptation = 0,
571  cmLinearChromaticAdaptation = 1,
572  cmVonKriesChromaticAdaptation = 2,
573  cmBradfordChromaticAdaptation = 3
574  };
575 
576  /* Profile Locations */
577  enum
578  {
579  CS_MAX_PATH = 256
580  };
581 
582  enum
583  {
584  cmNoProfileBase = 0,
585  cmFileBasedProfile = 1,
586  cmHandleBasedProfile = 2,
587  cmPtrBasedProfile = 3,
588  cmProcedureBasedProfile = 4,
589  cmPathBasedProfile = 5,
590  cmBufferBasedProfile = 6
591  };
592 
594  {
595  FSSpec spec;
596  };
597  typedef struct CMFileLocation CMFileLocation;
599  {
600  Handle h;
601  };
602  typedef struct CMHandleLocation CMHandleLocation;
604  {
605  Ptr p;
606  };
607  typedef struct CMPtrLocation CMPtrLocation;
609  {
610  CMProfileAccessUPP proc;
611  void *refCon;
612  };
615  {
616  char path[256];
617  };
618  typedef struct CMPathLocation CMPathLocation;
620  {
621  void *buffer;
622  UInt32 size;
623  };
624  typedef struct CMBufferLocation CMBufferLocation;
625  union CMProfLoc
626  {
627  CMFileLocation fileLoc;
628  CMHandleLocation handleLoc;
629  CMPtrLocation ptrLoc;
630  CMProcedureLocation procLoc;
631  CMPathLocation pathLoc;
632  CMBufferLocation bufferLoc;
633  };
634  typedef union CMProfLoc CMProfLoc;
636  {
637  short locType;
638  CMProfLoc u;
639  };
640  typedef struct CMProfileLocation CMProfileLocation;
641 #if TARGET_OS_MAC
642  enum
643  {
644  cmOriginalProfileLocationSize = 72,
645  cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
646  };
647 
648 #else
649 enum
650 {
651  cmOriginalProfileLocationSize = 2 + CS_MAX_PATH,
652  cmCurrentProfileLocationSize = 2 + CS_MAX_PATH
653 };
654 
655 #endif /* TARGET_OS_MAC */
656 
657  /* Typedef for Profile MD5 message digest */
658 
659  typedef unsigned char CMProfileMD5[16];
660  typedef CMProfileMD5 *CMProfileMD5Ptr;
661  /* Struct and enums used for Profile iteration */
662  enum
663  {
664  cmProfileIterateDataVersion1 = 0x00010000,
665  cmProfileIterateDataVersion2 = 0x00020000, /* Added makeAndModel*/
666  cmProfileIterateDataVersion3 = 0x00030000 /* Added MD5 digest*/
667  };
668 
670  {
671  UInt32 dataVersion; /* cmProfileIterateDataVersion2 */
673  ScriptCode code;
674  Str255 name;
675  CMProfileLocation location;
676  UniCharCount uniCodeNameCount;
677  UniChar *uniCodeName;
678  unsigned char *asciiName;
679  CMMakeAndModel *makeAndModel;
680  CMProfileMD5 *digest;
681  };
683  /* Caller-supplied callback function for Profile & CMM iteration */
684  typedef CALLBACK_API(OSErr,
685  CMProfileIterateProcPtr)(CMProfileIterateData *iterateData,
686  void *refCon);
687  typedef CALLBACK_API(OSErr, CMMIterateProcPtr)(CMMInfo *iterateData,
688  void *refCon);
689  typedef STACK_UPP_TYPE(CMProfileIterateProcPtr) CMProfileIterateUPP;
690  typedef STACK_UPP_TYPE(CMMIterateProcPtr) CMMIterateUPP;
699  CMProfileIterateUPP
700  NewCMProfileIterateUPP(CMProfileIterateProcPtr userRoutine);
701 #if !OPAQUE_UPP_TYPES
702  enum
703  {
704  uppCMProfileIterateProcInfo = 0x000003E0
705  }; /* pascal 2_bytes Func(4_bytes, 4_bytes) */
706 #ifdef __cplusplus
707  inline CMProfileIterateUPP
708  NewCMProfileIterateUPP(CMProfileIterateProcPtr userRoutine)
709  {
710  return (CMProfileIterateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
711  uppCMProfileIterateProcInfo,
712  GetCurrentArchitecture());
713  }
714 #else
715 #define NewCMProfileIterateUPP(userRoutine) \
716  (CMProfileIterateUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
717  uppCMProfileIterateProcInfo, \
718  GetCurrentArchitecture())
719 #endif
720 #endif
721 
730  CMMIterateUPP
731  NewCMMIterateUPP(CMMIterateProcPtr userRoutine);
732 #if !OPAQUE_UPP_TYPES
733  enum
734  {
735  uppCMMIterateProcInfo = 0x000003E0
736  }; /* pascal 2_bytes Func(4_bytes, 4_bytes) */
737 #ifdef __cplusplus
738  inline CMMIterateUPP NewCMMIterateUPP(CMMIterateProcPtr userRoutine)
739  {
740  return (CMMIterateUPP)NewRoutineDescriptor(
741  (ProcPtr)(userRoutine), uppCMMIterateProcInfo, GetCurrentArchitecture());
742  }
743 #else
744 #define NewCMMIterateUPP(userRoutine) \
745  (CMMIterateUPP) NewRoutineDescriptor( \
746  (ProcPtr)(userRoutine), uppCMMIterateProcInfo, GetCurrentArchitecture())
747 #endif
748 #endif
749 
758  void
759  DisposeCMProfileIterateUPP(CMProfileIterateUPP userUPP);
760 #if !OPAQUE_UPP_TYPES
761 #ifdef __cplusplus
762  inline void DisposeCMProfileIterateUPP(CMProfileIterateUPP userUPP)
763  {
764  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
765  }
766 #else
767 #define DisposeCMProfileIterateUPP(userUPP) DisposeRoutineDescriptor(userUPP)
768 #endif
769 #endif
770 
779  void
780  DisposeCMMIterateUPP(CMMIterateUPP userUPP);
781 #if !OPAQUE_UPP_TYPES
782 #ifdef __cplusplus
783  inline void DisposeCMMIterateUPP(CMMIterateUPP userUPP)
784  {
785  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
786  }
787 #else
788 #define DisposeCMMIterateUPP(userUPP) DisposeRoutineDescriptor(userUPP)
789 #endif
790 #endif
791 
800  OSErr
802  CMProfileIterateUPP userUPP);
803 #if !OPAQUE_UPP_TYPES
804 #ifdef __cplusplus
805  inline OSErr InvokeCMProfileIterateUPP(CMProfileIterateData *iterateData,
806  void *refCon,
807  CMProfileIterateUPP userUPP)
808  {
809  return (OSErr)CALL_TWO_PARAMETER_UPP(userUPP, uppCMProfileIterateProcInfo,
810  iterateData, refCon);
811  }
812 #else
813 #define InvokeCMProfileIterateUPP(iterateData, refCon, userUPP) \
814  (OSErr) CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileIterateProcInfo, \
815  (iterateData), (refCon))
816 #endif
817 #endif
818 
827  OSErr
828  InvokeCMMIterateUPP(CMMInfo *iterateData, void *refCon, CMMIterateUPP userUPP);
829 #if !OPAQUE_UPP_TYPES
830 #ifdef __cplusplus
831  inline OSErr InvokeCMMIterateUPP(CMMInfo *iterateData, void *refCon,
832  CMMIterateUPP userUPP)
833  {
834  return (OSErr)CALL_TWO_PARAMETER_UPP(userUPP, uppCMMIterateProcInfo,
835  iterateData, refCon);
836  }
837 #else
838 #define InvokeCMMIterateUPP(iterateData, refCon, userUPP) \
839  (OSErr) CALL_TWO_PARAMETER_UPP((userUPP), uppCMMIterateProcInfo, \
840  (iterateData), (refCon))
841 #endif
842 #endif
843 
844 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
845 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
846 #define NewCMProfileIterateProc(userRoutine) NewCMProfileIterateUPP(userRoutine)
847 #define NewCMMIterateProc(userRoutine) NewCMMIterateUPP(userRoutine)
848 #define CallCMProfileIterateProc(userRoutine, iterateData, refCon) \
849  InvokeCMProfileIterateUPP(iterateData, refCon, userRoutine)
850 #define CallCMMIterateProc(userRoutine, iterateData, refCon) \
851  InvokeCMMIterateUPP(iterateData, refCon, userRoutine)
852 #endif /* CALL_NOT_IN_CARBON */
853 
854  /* Profile file and element access */
863  CMError
864  CMNewProfile(CMProfileRef *prof, const CMProfileLocation *theProfile);
865 
874  CMError
875  CMOpenProfile(CMProfileRef *prof, const CMProfileLocation *theProfile);
876 
885  CMError
886  CMCloseProfile(CMProfileRef prof);
887 
896  CMError
897  CMUpdateProfile(CMProfileRef prof);
898 
907  CMError
908  CMCopyProfile(CMProfileRef *targetProf, const CMProfileLocation *targetLocation,
909  CMProfileRef srcProf);
910 
919  CMError
920  CMValidateProfile(CMProfileRef prof, Boolean *valid,
921  Boolean *preferredCMMnotfound);
922 
931  CMError
932  CMGetProfileLocation(CMProfileRef prof, CMProfileLocation *theProfile);
933 
942  CMError
943  NCMGetProfileLocation(CMProfileRef prof, CMProfileLocation *theProfile,
944  UInt32 *locationSize);
945 
954  CMError
955  CMFlattenProfile(CMProfileRef prof, UInt32 flags, CMFlattenUPP proc,
956  void *refCon, Boolean *preferredCMMnotfound);
957 
958 #if TARGET_OS_MAC
959 #if CALL_NOT_IN_CARBON
968  CMError
969  CMUnflattenProfile(FSSpec *resultFileSpec, CMFlattenUPP proc, void *refCon,
970  Boolean *preferredCMMnotfound);
971 
972 #endif /* CALL_NOT_IN_CARBON */
973 
974 #endif /* TARGET_OS_MAC */
975 
984  CMError
986 
995  CMError
996  CMSetProfileHeader(CMProfileRef prof, const CMAppleProfileHeader *header);
997 
1006  CMError
1007  CMProfileElementExists(CMProfileRef prof, OSType tag, Boolean *found);
1008 
1017  CMError
1018  CMCountProfileElements(CMProfileRef prof, UInt32 *elementCount);
1019 
1028  CMError
1029  CMGetProfileElement(CMProfileRef prof, OSType tag, UInt32 *elementSize,
1030  void *elementData);
1031 
1040  CMError
1041  CMSetProfileElement(CMProfileRef prof, OSType tag, UInt32 elementSize,
1042  const void *elementData);
1043 
1052  CMError
1053  CMSetProfileElementSize(CMProfileRef prof, OSType tag, UInt32 elementSize);
1054 
1063  CMError
1064  CMSetProfileElementReference(CMProfileRef prof, OSType elementTag,
1065  OSType referenceTag);
1066 
1075  CMError
1076  CMGetPartialProfileElement(CMProfileRef prof, OSType tag, UInt32 offset,
1077  UInt32 *byteCount, void *elementData);
1078 
1087  CMError
1088  CMSetPartialProfileElement(CMProfileRef prof, OSType tag, UInt32 offset,
1089  UInt32 byteCount, const void *elementData);
1090 
1099  CMError
1100  CMGetIndProfileElementInfo(CMProfileRef prof, UInt32 index, OSType *tag,
1101  UInt32 *elementSize, Boolean *refs);
1102 
1111  CMError
1112  CMGetIndProfileElement(CMProfileRef prof, UInt32 index, UInt32 *elementSize,
1113  void *elementData);
1114 
1123  CMError
1124  CMRemoveProfileElement(CMProfileRef prof, OSType tag);
1125 
1134  CMError
1135  CMGetScriptProfileDescription(CMProfileRef prof, Str255 name, ScriptCode *code);
1136 
1145  CMError
1146  CMGetProfileDescriptions(CMProfileRef prof, char *aName, UInt32 *aCount,
1147  Str255 mName, ScriptCode *mCode, UniChar *uName,
1148  UniCharCount *uCount);
1149 
1158  CMError
1159  CMSetProfileDescriptions(CMProfileRef prof, const char *aName, UInt32 aCount,
1160  ConstStr255Param mName, ScriptCode mCode,
1161  const UniChar *uName, UniCharCount uCount);
1162 
1171  CMError
1172  CMCopyProfileLocalizedStringDictionary(CMProfileRef prof, OSType tag,
1173  CFDictionaryRef *theDict);
1174 
1183  CMError
1184  CMSetProfileLocalizedStringDictionary(CMProfileRef prof, OSType tag,
1185  CFDictionaryRef theDict);
1186 
1195  CMError
1196  CMCopyProfileLocalizedString(CMProfileRef prof, OSType tag,
1197  CFStringRef reqLocale, CFStringRef *locale,
1198  CFStringRef *str);
1199 
1208  CMError
1209  CMCloneProfileRef(CMProfileRef prof);
1210 
1219  CMError
1220  CMGetProfileRefCount(CMProfileRef prof, long *count);
1221 
1230  CMError
1231  CMProfileModified(CMProfileRef prof, Boolean *modified);
1232 
1241  CMError
1242  CMGetProfileMD5(CMProfileRef prof, CMProfileMD5 digest);
1243 
1244  /* named Color access functions */
1253  CMError
1254  CMGetNamedColorInfo(CMProfileRef prof, UInt32 *deviceChannels,
1255  OSType *deviceColorSpace, OSType *PCSColorSpace,
1256  UInt32 *count, StringPtr prefix, StringPtr suffix);
1257 
1266  CMError
1267  CMGetNamedColorValue(CMProfileRef prof, StringPtr name, CMColor *deviceColor,
1268  CMColor *PCSColor);
1269 
1278  CMError
1279  CMGetIndNamedColorValue(CMProfileRef prof, UInt32 index, CMColor *deviceColor,
1280  CMColor *PCSColor);
1281 
1290  CMError
1291  CMGetNamedColorIndex(CMProfileRef prof, StringPtr name, UInt32 *index);
1292 
1301  CMError
1302  CMGetNamedColorName(CMProfileRef prof, UInt32 index, StringPtr name);
1303 
1304  /* General-purpose matching functions */
1313  CMError
1314  NCWNewColorWorld(CMWorldRef *cw, CMProfileRef src, CMProfileRef dst);
1315 
1324  CMError
1325  CWConcatColorWorld(CMWorldRef *cw, CMConcatProfileSet *profileSet);
1326 
1335  CMError
1336  CWNewLinkProfile(CMProfileRef *prof, const CMProfileLocation *targetLocation,
1337  CMConcatProfileSet *profileSet);
1338 
1347  CMError
1348  NCWConcatColorWorld(CMWorldRef *cw, NCMConcatProfileSet *profileSet,
1349  CMConcatCallBackUPP proc, void *refCon);
1350 
1359  CMError
1360  NCWNewLinkProfile(CMProfileRef *prof, const CMProfileLocation *targetLocation,
1361  NCMConcatProfileSet *profileSet, CMConcatCallBackUPP proc,
1362  void *refCon);
1363 
1372  void
1373  CWDisposeColorWorld(CMWorldRef cw);
1374 
1383  CMError
1384  CWMatchColors(CMWorldRef cw, CMColor *myColors, UInt32 count);
1385 
1394  CMError
1395  CWCheckColors(CMWorldRef cw, CMColor *myColors, UInt32 count, UInt32 *result);
1396 
1405  CMError
1406  CWMatchBitmap(CMWorldRef cw, CMBitmap *bitmap, CMBitmapCallBackUPP progressProc,
1407  void *refCon, CMBitmap *matchedBitmap);
1408 
1417  CMError
1418  CWCheckBitmap(CMWorldRef cw, const CMBitmap *bitmap,
1419  CMBitmapCallBackUPP progressProc, void *refCon,
1420  CMBitmap *resultBitmap);
1421 
1422 /* Quickdraw-specific matching */
1423 #if TARGET_OS_MAC && _DECLARE_CS_QD_API_
1432  CMError
1433  CWMatchPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc,
1434  void *refCon);
1435 
1444  CMError
1445  CWCheckPixMap(CMWorldRef cw, PixMap *myPixMap, CMBitmapCallBackUPP progressProc,
1446  void *refCon, BitMap *resultBitMap);
1447 
1456  CMError
1457  NCMBeginMatching(CMProfileRef src, CMProfileRef dst, CMMatchRef *myRef);
1458 
1467  void
1468  CMEndMatching(CMMatchRef myRef);
1469 
1478  void
1479  NCMDrawMatchedPicture(PicHandle myPicture, CMProfileRef dst, Rect *myRect);
1480 
1489  void
1490  CMEnableMatchingComment(Boolean enableIt);
1491 
1500  CMError
1501  NCMUseProfileComment(CMProfileRef prof, UInt32 flags);
1502 
1503 #endif /* TARGET_OS_MAC && _DECLARE_CS_QD_API_ */
1504 
1505 #if TARGET_OS_WIN32
1506 #if CALL_NOT_IN_CARBON
1515  CMError
1516  CWMatchHBITMAP(CMWorldRef cw, HBITMAP hBitmap, CMBitmapCallBackUPP progressProc,
1517  void *refCon);
1518 
1519 #endif /* CALL_NOT_IN_CARBON */
1520 
1521 #endif /* TARGET_OS_WIN32 */
1522 
1531  CMError
1533  UInt32 *size);
1534 
1535  /* System Profile access */
1544  CMError
1545  CMGetSystemProfile(CMProfileRef *prof);
1546 
1555  CMError
1556  CMSetSystemProfile(const FSSpec *profileFileSpec);
1557 
1566  CMError
1568 
1577  CMError
1578  CMGetDefaultProfileBySpace(OSType dataColorSpace, CMProfileRef *prof);
1579 
1588  CMError
1589  CMSetDefaultProfileBySpace(OSType dataColorSpace, CMProfileRef prof);
1590 
1591 #if TARGET_OS_MAC
1600  CMError
1601  CMGetProfileByAVID(CMDisplayIDType theID, CMProfileRef *prof);
1602 
1611  CMError
1612  CMSetProfileByAVID(CMDisplayIDType theID, CMProfileRef prof);
1613 
1622  CMError
1623  CMGetGammaByAVID(CMDisplayIDType theID, CMVideoCardGamma *gamma, UInt32 *size);
1624 
1633  CMError
1634  CMSetGammaByAVID(CMDisplayIDType theID, CMVideoCardGamma *gamma);
1635 
1636 #endif /* TARGET_OS_MAC */
1637 
1638  /* Profile access by Use */
1647  CMError
1648  CMGetDefaultProfileByUse(OSType use, CMProfileRef *prof);
1649 
1658  CMError
1659  CMSetDefaultProfileByUse(OSType use, CMProfileRef prof);
1660 
1661  /* Profile Management */
1670  CMError
1671  CMNewProfileSearch(CMSearchRecord *searchSpec, void *refCon, UInt32 *count,
1672  CMProfileSearchRef *searchResult);
1673 
1682  CMError
1683  CMUpdateProfileSearch(CMProfileSearchRef search, void *refCon, UInt32 *count);
1684 
1693  void
1694  CMDisposeProfileSearch(CMProfileSearchRef search);
1695 
1704  CMError
1705  CMSearchGetIndProfile(CMProfileSearchRef search, UInt32 index,
1706  CMProfileRef *prof);
1707 
1716  CMError
1717  CMSearchGetIndProfileFileSpec(CMProfileSearchRef search, UInt32 index,
1718  FSSpec *profileFile);
1719 
1728  CMError
1730  UInt32 *matchedCount,
1731  CMProfileSearchRef *searchResult);
1732 
1741  CMError
1743  CMProfileRef *profileList, UInt32 listSize,
1744  UInt32 *matchedCount, CMProfileRef *matchedList);
1745 
1754  CMError
1755  CMIterateColorSyncFolder(CMProfileIterateUPP proc, UInt32 *seed, UInt32 *count,
1756  void *refCon);
1757 
1766  CMError
1767  NCMUnflattenProfile(CMProfileLocation *targetLocation, CMFlattenUPP proc,
1768  void *refCon, Boolean *preferredCMMnotfound);
1769 
1770 /* Utilities */
1771 #if TARGET_OS_MAC
1780  CMError
1781  CMGetColorSyncFolderSpec(short vRefNum, Boolean createFolder,
1782  short *foundVRefNum, long *foundDirID);
1783 
1784 #endif /* TARGET_OS_MAC */
1785 
1786 #if TARGET_OS_WIN32 || TARGET_OS_UNIX
1787 #if CALL_NOT_IN_CARBON
1796  CMError
1797  CMGetColorSyncFolderPath(Boolean createFolder, char *lpBuffer, UInt32 uSize);
1798 
1799 #endif /* CALL_NOT_IN_CARBON */
1800 
1801 #endif /* TARGET_OS_WIN32 || TARGET_OS_UNIX */
1802 
1811  CMError
1812  CMGetCWInfo(CMWorldRef cw, CMCWInfoRecord *info);
1813 
1814 #if TARGET_API_MAC_OS8
1815 #if CALL_NOT_IN_CARBON
1824  CMError
1825  CMConvertProfile2to1(CMProfileRef profv2, CMProfileHandle *profv1);
1826 
1827 #endif /* CALL_NOT_IN_CARBON */
1828 
1829 #endif /* TARGET_API_MAC_OS8 */
1830 
1839  CMError
1840  CMGetPreferredCMM(OSType *cmmType, Boolean *preferredCMMnotfound);
1841 
1850  CMError
1851  CMIterateCMMInfo(CMMIterateUPP proc, UInt32 *count, void *refCon);
1852 
1861  CMError
1862  CMGetColorSyncVersion(UInt32 *version);
1863 
1872  CMError
1873  CMLaunchControlPanel(UInt32 flags);
1874 
1875  /* ColorSpace conversion functions */
1884  CMError
1885  CMConvertXYZToLab(const CMColor *src, const CMXYZColor *white, CMColor *dst,
1886  UInt32 count);
1887 
1896  CMError
1897  CMConvertLabToXYZ(const CMColor *src, const CMXYZColor *white, CMColor *dst,
1898  UInt32 count);
1899 
1908  CMError
1909  CMConvertXYZToLuv(const CMColor *src, const CMXYZColor *white, CMColor *dst,
1910  UInt32 count);
1911 
1920  CMError
1921  CMConvertLuvToXYZ(const CMColor *src, const CMXYZColor *white, CMColor *dst,
1922  UInt32 count);
1923 
1932  CMError
1933  CMConvertXYZToYxy(const CMColor *src, CMColor *dst, UInt32 count);
1934 
1943  CMError
1944  CMConvertYxyToXYZ(const CMColor *src, CMColor *dst, UInt32 count);
1945 
1954  CMError
1955  CMConvertRGBToHLS(const CMColor *src, CMColor *dst, UInt32 count);
1956 
1965  CMError
1966  CMConvertHLSToRGB(const CMColor *src, CMColor *dst, UInt32 count);
1967 
1976  CMError
1977  CMConvertRGBToHSV(const CMColor *src, CMColor *dst, UInt32 count);
1978 
1987  CMError
1988  CMConvertHSVToRGB(const CMColor *src, CMColor *dst, UInt32 count);
1989 
1998  CMError
1999  CMConvertRGBToGray(const CMColor *src, CMColor *dst, UInt32 count);
2000 
2009  CMError
2011  UInt32 count);
2012 
2021  CMError
2023  UInt32 count);
2024 
2033  CMError
2034  CMConvertXYZToXYZ(const CMColor *src, const CMXYZColor *srcIlluminant,
2035  CMColor *dst, const CMXYZColor *dstIlluminant,
2036  CMChromaticAdaptation method, UInt32 count);
2037 
2038  /* PS-related */
2047  CMError
2048  CMGetPS2ColorSpace(CMProfileRef srcProf, UInt32 flags, CMFlattenUPP proc,
2049  void *refCon, Boolean *preferredCMMnotfound);
2050 
2059  CMError
2060  CMGetPS2ColorRenderingIntent(CMProfileRef srcProf, UInt32 flags,
2061  CMFlattenUPP proc, void *refCon,
2062  Boolean *preferredCMMnotfound);
2063 
2072  CMError
2073  CMGetPS2ColorRendering(CMProfileRef srcProf, CMProfileRef dstProf, UInt32 flags,
2074  CMFlattenUPP proc, void *refCon,
2075  Boolean *preferredCMMnotfound);
2076 
2085  CMError
2086  CMGetPS2ColorRenderingVMSize(CMProfileRef srcProf, CMProfileRef dstProf,
2087  UInt32 *vmSize, Boolean *preferredCMMnotfound);
2088 
2089 /* ColorSync 1.0 functions which have parallel 2.0 counterparts */
2090 #if TARGET_API_MAC_OS8
2091 #if CALL_NOT_IN_CARBON
2100  CMError
2101  CWNewColorWorld(CMWorldRef *cw, CMProfileHandle src, CMProfileHandle dst);
2102 
2111  CMError
2112  ConcatenateProfiles(CMProfileHandle thru, CMProfileHandle dst,
2113  CMProfileHandle *newDst);
2114 
2123  CMError
2124  CMBeginMatching(CMProfileHandle src, CMProfileHandle dst, CMMatchRef *myRef);
2125 
2134  void
2135  CMDrawMatchedPicture(PicHandle myPicture, CMProfileHandle dst, Rect *myRect);
2136 
2145  CMError
2146  CMUseProfileComment(CMProfileHandle profile);
2147 
2156  void
2157  CMGetProfileName(CMProfileHandle myProfile, CMIString *IStringResult);
2158 
2167  long
2168  CMGetProfileAdditionalDataOffset(CMProfileHandle myProfile);
2169 
2170 /* ProfileResponder definitions */
2171 #endif /* CALL_NOT_IN_CARBON */
2172 
2173  enum
2174  {
2175  cmSystemDevice = FOUR_CHAR_CODE('sys '),
2176  cmGDevice = FOUR_CHAR_CODE('gdev')
2177  };
2178 
2179 /* ProfileResponder functions */
2180 #if CALL_NOT_IN_CARBON
2189  CMError
2190  GetProfile(OSType deviceType, long refNum, CMProfileHandle aProfile,
2191  CMProfileHandle *returnedProfile);
2192 
2201  CMError
2202  SetProfile(OSType deviceType, long refNum, CMProfileHandle newProfile);
2203 
2212  CMError
2213  SetProfileDescription(OSType deviceType, long refNum, long deviceData,
2214  CMProfileHandle hProfile);
2215 
2224  CMError
2225  GetIndexedProfile(OSType deviceType, long refNum,
2227  CMProfileHandle *returnProfile, long *index);
2228 
2237  CMError
2238  DeleteDeviceProfile(OSType deviceType, long refNum, CMProfileHandle deleteMe);
2239 
2240 #endif /* CALL_NOT_IN_CARBON */
2241 
2242 #if OLDROUTINENAMES
2243  /* old constants */
2244 
2245  typedef CMFlattenProcPtr CMFlattenProc;
2246  typedef CMBitmapCallBackProcPtr CMBitmapCallBackProc;
2247  typedef CMProfileFilterProcPtr CMProfileFilterProc;
2248  enum
2249  {
2250  CMTrap = cmTrap,
2251  CMBeginProfile = cmBeginProfile,
2252  CMEndProfile = cmEndProfile,
2253  CMEnableMatching = cmEnableMatching,
2254  CMDisableMatching = cmDisableMatching
2255  };
2256 
2257  /* 1.0 Error codes, for compatibility with older applications. 1.0 CMM's may
2258  * return obsolete error codes */
2259  enum
2260  {
2261  CMNoError = 0, /* obsolete name, use noErr */
2262  CMProfileError = cmProfileError,
2263  CMMethodError = cmMethodError,
2264  CMMemFullError = -172, /* obsolete, 2.0 uses memFullErr */
2265  CMUnimplementedError = -173, /* obsolete, 2.0 uses unimpErr */
2266  CMParamError = -174, /* obsolete, 2.0 uses paramErr */
2267  CMMethodNotFound = cmMethodNotFound,
2268  CMProfileNotFound = cmProfileNotFound,
2269  CMProfilesIdentical = cmProfilesIdentical,
2270  CMCantConcatenateError = cmCantConcatenateError,
2271  CMCantXYZ = cmCantXYZ,
2272  CMCantDeleteProfile = cmCantDeleteProfile,
2273  CMUnsupportedDataType = cmUnsupportedDataType,
2274  CMNoCurrentProfile = cmNoCurrentProfile
2275  };
2276 
2277  enum
2278  {
2279  qdSystemDevice = cmSystemDevice,
2280  qdGDevice = cmGDevice
2281  };
2282 
2283  enum
2284  {
2285  kMatchCMMType = cmMatchCMMType,
2286  kMatchApplProfileVersion = cmMatchApplProfileVersion,
2287  kMatchDataType = cmMatchDataType,
2288  kMatchDeviceType = cmMatchDeviceType,
2289  kMatchDeviceManufacturer = cmMatchDeviceManufacturer,
2290  kMatchDeviceModel = cmMatchDeviceModel,
2291  kMatchDeviceAttributes = cmMatchDeviceAttributes,
2292  kMatchFlags = cmMatchFlags,
2293  kMatchOptions = cmMatchOptions,
2294  kMatchWhite = cmMatchWhite,
2295  kMatchBlack = cmMatchBlack
2296  };
2297 
2298  /* old types */
2299  typedef CMCMYKColor CMYKColor;
2300  typedef CMWorldRef CWorld;
2301  typedef long *CMGamutResult;
2302 /* old functions */
2303 #define EndMatching(myRef) CMEndMatching(myRef)
2304 #define EnableMatching(enableIt) CMEnableMatchingComment(enableIt)
2305 #define GetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, \
2306  foundDirID) \
2307  CMGetColorSyncFolderSpec(vRefNum, createFolder, foundVRefNum, foundDirID)
2308 #define BeginMatching(src, dst, myRef) CMBeginMatching(src, dst, myRef)
2309 #define DrawMatchedPicture(myPicture, dst, myRect) \
2310  CMDrawMatchedPicture(myPicture, dst, myRect)
2311 #define UseProfile(profile) CMUseProfileComment(profile)
2312 #define GetProfileName(myProfile, IStringResult) \
2313  CMGetProfileName(myProfile, IStringResult)
2314 #define GetProfileAdditionalDataOffset(myProfile) \
2315  CMGetProfileAdditionalDataOffset(myProfile)
2316 #endif /* OLDROUTINENAMES */
2317 
2318  /* Deprecated stuff*/
2319  /* PrGeneral parameter blocks */
2320  enum
2321  {
2322  enableColorMatchingOp = 12,
2323  registerProfileOp = 13
2324  };
2325 
2326  struct TEnableColorMatchingBlk
2327  {
2328  short iOpCode;
2329  short iError;
2330  long lReserved;
2331  THPrint hPrint;
2332  Boolean fEnableIt;
2333  SInt8 filler;
2334  };
2335  typedef struct TEnableColorMatchingBlk TEnableColorMatchingBlk;
2336  struct TRegisterProfileBlk
2337  {
2338  short iOpCode;
2339  short iError;
2340  long lReserved;
2341  THPrint hPrint;
2342  Boolean fRegisterIt;
2343  SInt8 filler;
2344  };
2345  typedef struct TRegisterProfileBlk TRegisterProfileBlk;
2346 #endif /* TARGET_API_MAC_OS8 */
2347 
2348 #if PRAGMA_STRUCT_ALIGN
2349 #pragma options align = reset
2350 #elif PRAGMA_STRUCT_PACKPUSH
2351 #pragma pack(pop)
2352 #elif PRAGMA_STRUCT_PACK
2353 #pragma pack()
2354 #endif
2355 
2356 #ifdef PRAGMA_IMPORT_OFF
2357 #pragma import off
2358 #elif PRAGMA_IMPORT
2359 #pragma import reset
2360 #endif
2361 
2362 #ifdef __cplusplus
2363 }
2364 #endif
2365 
2366 #endif /* __CMAPPLICATION__ */
CMError CMGetScriptProfileDescription(CMProfileRef prof, Str255 name, ScriptCode *code)
void CMDisposeProfileSearch(CMProfileSearchRef search)
CMError CMGetPS2ColorRenderingIntent(CMProfileRef srcProf, UInt32 flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
CMError CMConvertXYZToLuv(const CMColor *src, const CMXYZColor *white, CMColor *dst, UInt32 count)
CMError CMConvertRGBToGray(const CMColor *src, CMColor *dst, UInt32 count)
CMError CMNewProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
CMError NCMGetProfileLocation(CMProfileRef prof, CMProfileLocation *theProfile, UInt32 *locationSize)
CMError CMCopyProfileLocalizedString(CMProfileRef prof, OSType tag, CFStringRef reqLocale, CFStringRef *locale, CFStringRef *str)
CMError NCMUnflattenProfile(CMProfileLocation *targetLocation, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
CMError CMConvertYxyToXYZ(const CMColor *src, CMColor *dst, UInt32 count)
CMError CMSetProfileElement(CMProfileRef prof, OSType tag, UInt32 elementSize, const void *elementData)
CMError CMConvertXYZToYxy(const CMColor *src, CMColor *dst, UInt32 count)
CMError CWNewLinkProfile(CMProfileRef *prof, const CMProfileLocation *targetLocation, CMConcatProfileSet *profileSet)
CMError NCWNewColorWorld(CMWorldRef *cw, CMProfileRef src, CMProfileRef dst)
CMError CWConcatColorWorld(CMWorldRef *cw, CMConcatProfileSet *profileSet)
CMError NCWConcatColorWorld(CMWorldRef *cw, NCMConcatProfileSet *profileSet, CMConcatCallBackUPP proc, void *refCon)
CMError CMGetCWInfo(CMWorldRef cw, CMCWInfoRecord *info)
CMError CMConvertHSVToRGB(const CMColor *src, CMColor *dst, UInt32 count)
CMError CMSetDefaultProfileBySpace(OSType dataColorSpace, CMProfileRef prof)
CMError CMIterateCMMInfo(CMMIterateUPP proc, UInt32 *count, void *refCon)
CMError CMGetProfileHeader(CMProfileRef prof, CMAppleProfileHeader *header)
CMError CMIterateColorSyncFolder(CMProfileIterateUPP proc, UInt32 *seed, UInt32 *count, void *refCon)
CMError CMSearchGetIndProfileFileSpec(CMProfileSearchRef search, UInt32 index, FSSpec *profileFile)
CMError CMProfileIdentifierFolderSearch(CMProfileIdentifierPtr ident, UInt32 *matchedCount, CMProfileSearchRef *searchResult)
CMError CMConvertXYZToFixedXYZ(const CMXYZColor *src, CMFixedXYZColor *dst, UInt32 count)
CMMIterateUPP NewCMMIterateUPP(CMMIterateProcPtr userRoutine)
CMError CMConvertXYZToXYZ(const CMColor *src, const CMXYZColor *srcIlluminant, CMColor *dst, const CMXYZColor *dstIlluminant, CMChromaticAdaptation method, UInt32 count)
CMError CMGetNamedColorIndex(CMProfileRef prof, StringPtr name, UInt32 *index)
CMError CMConvertFixedXYZToXYZ(const CMFixedXYZColor *src, CMXYZColor *dst, UInt32 count)
CMError CMProfileModified(CMProfileRef prof, Boolean *modified)
CMError CMConvertRGBToHSV(const CMColor *src, CMColor *dst, UInt32 count)
CMError CMProfileIdentifierListSearch(CMProfileIdentifierPtr ident, CMProfileRef *profileList, UInt32 listSize, UInt32 *matchedCount, CMProfileRef *matchedList)
CMError CMConvertLabToXYZ(const CMColor *src, const CMXYZColor *white, CMColor *dst, UInt32 count)
void CWDisposeColorWorld(CMWorldRef cw)
CMError CMGetDefaultProfileByUse(OSType use, CMProfileRef *prof)
CMProfileIterateUPP NewCMProfileIterateUPP(CMProfileIterateProcPtr userRoutine)
CMError CMGetNamedColorValue(CMProfileRef prof, StringPtr name, CMColor *deviceColor, CMColor *PCSColor)
CMError CMRemoveProfileElement(CMProfileRef prof, OSType tag)
CMError CMConvertLuvToXYZ(const CMColor *src, const CMXYZColor *white, CMColor *dst, UInt32 count)
CMError CMGetNamedColorName(CMProfileRef prof, UInt32 index, StringPtr name)
CMError CMFlattenProfile(CMProfileRef prof, UInt32 flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
CMError CMGetNamedColorInfo(CMProfileRef prof, UInt32 *deviceChannels, OSType *deviceColorSpace, OSType *PCSColorSpace, UInt32 *count, StringPtr prefix, StringPtr suffix)
CMError CWCheckBitmap(CMWorldRef cw, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *resultBitmap)
CMError CMGetDefaultProfileBySpace(OSType dataColorSpace, CMProfileRef *prof)
CMError CMConvertXYZToLab(const CMColor *src, const CMXYZColor *white, CMColor *dst, UInt32 count)
CMError CMCloseProfile(CMProfileRef prof)
void DisposeCMProfileIterateUPP(CMProfileIterateUPP userUPP)
CMError CMCloneProfileRef(CMProfileRef prof)
CMError CMOpenProfile(CMProfileRef *prof, const CMProfileLocation *theProfile)
OSErr InvokeCMMIterateUPP(CMMInfo *iterateData, void *refCon, CMMIterateUPP userUPP)
CMError CMGetIndNamedColorValue(CMProfileRef prof, UInt32 index, CMColor *deviceColor, CMColor *PCSColor)
CMError CMSearchGetIndProfile(CMProfileSearchRef search, UInt32 index, CMProfileRef *prof)
CMError CMSetProfileDescriptions(CMProfileRef prof, const char *aName, UInt32 aCount, ConstStr255Param mName, ScriptCode mCode, const UniChar *uName, UniCharCount uCount)
CMError CMSetSystemProfile(const FSSpec *profileFileSpec)
CMError CMGetPS2ColorRendering(CMProfileRef srcProf, CMProfileRef dstProf, UInt32 flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
CMError CMGetIndProfileElement(CMProfileRef prof, UInt32 index, UInt32 *elementSize, void *elementData)
CMError CMProfileElementExists(CMProfileRef prof, OSType tag, Boolean *found)
CMError CMSetProfileElementReference(CMProfileRef prof, OSType elementTag, OSType referenceTag)
CMError CMConvertHLSToRGB(const CMColor *src, CMColor *dst, UInt32 count)
CMError CMSetProfileLocalizedStringDictionary(CMProfileRef prof, OSType tag, CFDictionaryRef theDict)
CMError CMLaunchControlPanel(UInt32 flags)
CMError CWMatchColors(CMWorldRef cw, CMColor *myColors, UInt32 count)
CMError CMNewProfileSearch(CMSearchRecord *searchSpec, void *refCon, UInt32 *count, CMProfileSearchRef *searchResult)
CMError CMGetProfileRefCount(CMProfileRef prof, long *count)
CMError CMUpdateProfileSearch(CMProfileSearchRef search, void *refCon, UInt32 *count)
CMError CMGetProfileMD5(CMProfileRef prof, CMProfileMD5 digest)
CMError CMGetSystemProfile(CMProfileRef *prof)
CMError CMUpdateProfile(CMProfileRef prof)
CMError CMCreateProfileIdentifier(CMProfileRef prof, CMProfileIdentifierPtr ident, UInt32 *size)
void DisposeCMMIterateUPP(CMMIterateUPP userUPP)
CMError CMGetPS2ColorSpace(CMProfileRef srcProf, UInt32 flags, CMFlattenUPP proc, void *refCon, Boolean *preferredCMMnotfound)
CMError NCWNewLinkProfile(CMProfileRef *prof, const CMProfileLocation *targetLocation, NCMConcatProfileSet *profileSet, CMConcatCallBackUPP proc, void *refCon)
OSErr InvokeCMProfileIterateUPP(CMProfileIterateData *iterateData, void *refCon, CMProfileIterateUPP userUPP)
CMError CMCopyProfile(CMProfileRef *targetProf, const CMProfileLocation *targetLocation, CMProfileRef srcProf)
CMError CMSetPartialProfileElement(CMProfileRef prof, OSType tag, UInt32 offset, UInt32 byteCount, const void *elementData)
CMError CMConvertRGBToHLS(const CMColor *src, CMColor *dst, UInt32 count)
CMError CWCheckColors(CMWorldRef cw, CMColor *myColors, UInt32 count, UInt32 *result)
CMError CMGetProfileDescriptions(CMProfileRef prof, char *aName, UInt32 *aCount, Str255 mName, ScriptCode *mCode, UniChar *uName, UniCharCount *uCount)
CMError CMGetIndProfileElementInfo(CMProfileRef prof, UInt32 index, OSType *tag, UInt32 *elementSize, Boolean *refs)
CMError CMGetProfileElement(CMProfileRef prof, OSType tag, UInt32 *elementSize, void *elementData)
CMError CMGetPreferredCMM(OSType *cmmType, Boolean *preferredCMMnotfound)
CMError CMCountProfileElements(CMProfileRef prof, UInt32 *elementCount)
CMError CMGetPartialProfileElement(CMProfileRef prof, OSType tag, UInt32 offset, UInt32 *byteCount, void *elementData)
CMError CMValidateProfile(CMProfileRef prof, Boolean *valid, Boolean *preferredCMMnotfound)
CMError CMGetProfileLocation(CMProfileRef prof, CMProfileLocation *theProfile)
CMError CMSetProfileHeader(CMProfileRef prof, const CMAppleProfileHeader *header)
CMError CMCopyProfileLocalizedStringDictionary(CMProfileRef prof, OSType tag, CFDictionaryRef *theDict)
CMError CMSetDefaultProfileByUse(OSType use, CMProfileRef prof)
CMError CWMatchBitmap(CMWorldRef cw, CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *matchedBitmap)
CMError CMGetPS2ColorRenderingVMSize(CMProfileRef srcProf, CMProfileRef dstProf, UInt32 *vmSize, Boolean *preferredCMMnotfound)
CMError CMGetColorSyncVersion(UInt32 *version)
CMError CMSetProfileElementSize(CMProfileRef prof, OSType tag, UInt32 elementSize)
CMError NCMSetSystemProfile(const CMProfileLocation *profLoc)
ICC Profile Format Definitions.
xxx put contents here xxx
File Manager (MFS, HFS, and HFS+) Interfaces.
OSErr codes.
Basic Macintosh data types.
unsigned char * StringPtr
Definition: MacTypes.h:477
unsigned char Boolean
Definition: MacTypes.h:318
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
Print Manager Interfaces.
Interface to Quickdraw Graphics.
TQAMethodSelector
Definition: RAVE.h:1009
Definition: Quickdraw.h:279
Definition: CMICCProfile.h:378
Definition: CMApplication.h:554
Definition: CMApplication.h:620
Definition: CMApplication.h:258
Definition: CMApplication.h:250
Definition: CMApplication.h:396
Definition: CMApplication.h:203
Definition: CMICCProfile.h:355
Definition: CMApplication.h:594
Definition: CMICCProfile.h:364
Definition: CMApplication.h:300
Definition: CMApplication.h:265
Definition: CMApplication.h:272
Definition: CMApplication.h:599
Definition: CMICCProfile.h:790
Definition: CMICCProfile.h:770
Definition: CMApplication.h:279
Definition: CMApplication.h:286
Definition: CMApplication.h:390
Definition: CMApplication.h:375
Definition: CMICCProfile.h:712
Definition: CMApplication.h:305
Definition: CMApplication.h:310
Definition: CMApplication.h:315
Definition: CMApplication.h:320
Definition: CMApplication.h:325
Definition: CMApplication.h:615
Definition: CMApplication.h:609
Definition: CMApplication.h:403
Definition: CMApplication.h:670
Definition: CMApplication.h:636
Definition: CMApplication.h:350
Definition: CMICCProfile.h:821
Definition: CMApplication.h:604
Definition: CMApplication.h:243
Definition: CMApplication.h:360
Definition: CMICCProfile.h:698
Definition: CMICCProfile.h:372
Definition: CMApplication.h:293
Definition: Components.h:266
Definition: CMApplication.h:218
Definition: CMApplication.h:211
Definition: Quickdraw.h:326
Definition: Quickdraw.h:2064
Definition: MacTypes.h:527
Definition: Printing.h:374
Definition: RAVE.h:426
Definition: CMApplication.h:196
Definition: CMApplication.h:330
Definition: CMApplication.h:626