Mac OS 9
CMICCProfile.h
Go to the documentation of this file.
1 
19 #ifndef __CMICCPROFILE__
20 #define __CMICCPROFILE__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #if PRAGMA_ONCE
27 #pragma once
28 #endif
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #if PRAGMA_IMPORT
35 #pragma import on
36 #endif
37 
38 #if PRAGMA_STRUCT_ALIGN
39 #pragma options align = mac68k
40 #elif PRAGMA_STRUCT_PACKPUSH
41 #pragma pack(push, 2)
42 #elif PRAGMA_STRUCT_PACK
43 #pragma pack(2)
44 #endif
45 
46 /* ICC Profile version constants */
47 enum {
48  cmICCProfileVersion2 = 0x02000000,
49  cmICCProfileVersion21 = 0x02100000,
50  cmCS2ProfileVersion = cmICCProfileVersion2,
51  cmCS1ProfileVersion = 0x00000100 /* ColorSync 1.0 profile version */
52 };
53 
54 /* Current Major version number */
55 enum {
56  cmProfileMajorVersionMask = (long)0xFF000000,
57  cmCurrentProfileMajorVersion = 0x02000000
58 };
59 
60 /* magic cookie number for anonymous file ID */
61 enum { cmMagicNumber = FOUR_CHAR_CODE('acsp') };
62 
63 /************************************************************************/
64 /*************** ColorSync 2.0 profile specification ********************/
65 /************************************************************************/
66 /**** flags field ****/
67 enum {
68  cmICCReservedFlagsMask = 0x0000FFFF, /* these bits of the flags field are
69  defined and reserved by ICC */
70  cmEmbeddedMask = 0x00000001, /* if bit 0 is 0 then not embedded profile, if 1
71  then embedded profile */
72  cmEmbeddedUseMask = 0x00000002, /* if bit 1 is 0 then ok to use anywhere, if 1
73  then ok to use as embedded profile only */
74  cmCMSReservedFlagsMask =
75  (long)0xFFFF0000, /* these bits of the flags field are defined and
76  reserved by CMS vendor */
77  cmQualityMask = 0x00030000, /* if bits 16-17 is 0 then normal, if 1 then
78  draft, if 2 then best */
79  cmInterpolationMask =
80  0x00040000, /* if bit 18 is 0 then interpolation, if 1 then lookup only */
81  cmGamutCheckingMask = 0x00080000 /* if bit 19 is 0 then create gamut checking
82  info, if 1 then no gamut checking info */
83 };
84 
85 /* copyright-protection flag options */
86 enum {
87  cmEmbeddedProfile = 0, /* 0 is not embedded profile, 1 is embedded profile */
88  cmEmbeddedUse =
89  1 /* 0 is to use anywhere, 1 is to use as embedded profile only */
90 };
91 
92 /* speed and quality flag options */
93 enum {
94  cmNormalMode =
95  0, /* it uses the least significent two bits in the high word of flag */
96  cmDraftMode = 1, /* it should be evaulated like this: right shift 16 bits
97  first, mask off the */
98  cmBestMode = 2 /* high 14 bits, and then compare with the enum to determine
99  the option value */
100 };
101 
102 /**** deviceAttributes fields ****/
103 /* deviceAttributes[0] is defined by and reserved for device vendors */
104 /* deviceAttributes[1] is defined by and reserved for ICC */
105 /* The following bits of deviceAttributes[1] are currently defined */
106 enum {
107  cmReflectiveTransparentMask =
108  0x00000001, /* if bit 0 is 0 then reflective media, if 1 then transparency
109  media */
110  cmGlossyMatteMask =
111  0x00000002 /* if bit 1 is 0 then glossy, if 1 then matte */
112 };
113 
114 /* device/media attributes element values */
115 enum {
116  cmReflective =
117  0, /* if bit 0 is 0 then reflective media, if 1 then transparency media */
118  cmGlossy = 1 /* if bit 1 is 0 then glossy, if 1 then matte */
119 };
120 
121 /**** renderingIntent field ****/
122 enum {
123  cmPerceptual = 0, /* Photographic images */
124  cmRelativeColorimetric = 1, /* Logo Colors */
125  cmSaturation = 2, /* Business graphics */
126  cmAbsoluteColorimetric = 3 /* Logo Colors */
127 };
128 
129 /* data type element values */
130 enum { cmAsciiData = 0, cmBinaryData = 1 };
131 
132 /* screen encodings */
133 enum {
134  cmPrtrDefaultScreens =
135  0, /* Use printer default screens. 0 is false, 1 is ture */
136  cmLinesPer = 1 /* 0 is LinesPerCm, 1 is LinesPerInch */
137 };
138 
139 /* 2.0 tag type information */
140 enum { cmNumHeaderElements = 10 };
141 
142 /* public tags */
143 enum {
144  cmAToB0Tag = FOUR_CHAR_CODE('A2B0'),
145  cmAToB1Tag = FOUR_CHAR_CODE('A2B1'),
146  cmAToB2Tag = FOUR_CHAR_CODE('A2B2'),
147  cmBlueColorantTag = FOUR_CHAR_CODE('bXYZ'),
148  cmBlueTRCTag = FOUR_CHAR_CODE('bTRC'),
149  cmBToA0Tag = FOUR_CHAR_CODE('B2A0'),
150  cmBToA1Tag = FOUR_CHAR_CODE('B2A1'),
151  cmBToA2Tag = FOUR_CHAR_CODE('B2A2'),
152  cmCalibrationDateTimeTag = FOUR_CHAR_CODE('calt'),
153  cmChromaticAdaptationTag = FOUR_CHAR_CODE('chad'),
154  cmCharTargetTag = FOUR_CHAR_CODE('targ'),
155  cmCopyrightTag = FOUR_CHAR_CODE('cprt'),
156  cmDeviceMfgDescTag = FOUR_CHAR_CODE('dmnd'),
157  cmDeviceModelDescTag = FOUR_CHAR_CODE('dmdd'),
158  cmGamutTag = FOUR_CHAR_CODE('gamt'),
159  cmGrayTRCTag = FOUR_CHAR_CODE('kTRC'),
160  cmGreenColorantTag = FOUR_CHAR_CODE('gXYZ'),
161  cmGreenTRCTag = FOUR_CHAR_CODE('gTRC'),
162  cmLuminanceTag = FOUR_CHAR_CODE('lumi'),
163  cmMeasurementTag = FOUR_CHAR_CODE('meas'),
164  cmMediaBlackPointTag = FOUR_CHAR_CODE('bkpt'),
165  cmMediaWhitePointTag = FOUR_CHAR_CODE('wtpt'),
166  cmNamedColorTag = FOUR_CHAR_CODE('ncol'),
167  cmNamedColor2Tag = FOUR_CHAR_CODE('ncl2'),
168  cmPreview0Tag = FOUR_CHAR_CODE('pre0'),
169  cmPreview1Tag = FOUR_CHAR_CODE('pre1'),
170  cmPreview2Tag = FOUR_CHAR_CODE('pre2'),
171  cmProfileDescriptionTag = FOUR_CHAR_CODE('desc'),
172  cmProfileSequenceDescTag = FOUR_CHAR_CODE('pseq'),
173  cmPS2CRD0Tag = FOUR_CHAR_CODE('psd0'),
174  cmPS2CRD1Tag = FOUR_CHAR_CODE('psd1'),
175  cmPS2CRD2Tag = FOUR_CHAR_CODE('psd2'),
176  cmPS2CRD3Tag = FOUR_CHAR_CODE('psd3'),
177  cmPS2CSATag = FOUR_CHAR_CODE('ps2s'),
178  cmPS2RenderingIntentTag = FOUR_CHAR_CODE('ps2i'),
179  cmRedColorantTag = FOUR_CHAR_CODE('rXYZ'),
180  cmRedTRCTag = FOUR_CHAR_CODE('rTRC'),
181  cmScreeningDescTag = FOUR_CHAR_CODE('scrd'),
182  cmScreeningTag = FOUR_CHAR_CODE('scrn'),
183  cmTechnologyTag = FOUR_CHAR_CODE('tech'),
184  cmUcrBgTag = FOUR_CHAR_CODE('bfd '),
185  cmViewingConditionsDescTag = FOUR_CHAR_CODE('vued'),
186  cmViewingConditionsTag = FOUR_CHAR_CODE('view')
187 };
188 
189 /* custom tags */
190 enum {
191  cmPS2CRDVMSizeTag = FOUR_CHAR_CODE('psvm'),
192  cmVideoCardGammaTag = FOUR_CHAR_CODE('vcgt'),
193  cmMakeAndModelTag = FOUR_CHAR_CODE('mmod'),
194  cmProfileDescriptionMLTag = FOUR_CHAR_CODE('dscm')
195 };
196 
197 /* technology tag descriptions */
198 enum {
199  cmTechnologyFilmScanner = FOUR_CHAR_CODE('fscn'),
200  cmTechnologyReflectiveScanner = FOUR_CHAR_CODE('rscn'),
201  cmTechnologyInkJetPrinter = FOUR_CHAR_CODE('ijet'),
202  cmTechnologyThermalWaxPrinter = FOUR_CHAR_CODE('twax'),
203  cmTechnologyElectrophotographicPrinter = FOUR_CHAR_CODE('epho'),
204  cmTechnologyElectrostaticPrinter = FOUR_CHAR_CODE('esta'),
205  cmTechnologyDyeSublimationPrinter = FOUR_CHAR_CODE('dsub'),
206  cmTechnologyPhotographicPaperPrinter = FOUR_CHAR_CODE('rpho'),
207  cmTechnologyFilmWriter = FOUR_CHAR_CODE('fprn'),
208  cmTechnologyVideoMonitor = FOUR_CHAR_CODE('vidm'),
209  cmTechnologyVideoCamera = FOUR_CHAR_CODE('vidc'),
210  cmTechnologyProjectionTelevision = FOUR_CHAR_CODE('pjtv'),
211  cmTechnologyCRTDisplay = FOUR_CHAR_CODE('CRT '),
212  cmTechnologyPMDisplay = FOUR_CHAR_CODE('PMD '),
213  cmTechnologyAMDisplay = FOUR_CHAR_CODE('AMD '),
214  cmTechnologyPhotoCD = FOUR_CHAR_CODE('KPCD'),
215  cmTechnologyPhotoImageSetter = FOUR_CHAR_CODE('imgs'),
216  cmTechnologyGravure = FOUR_CHAR_CODE('grav'),
217  cmTechnologyOffsetLithography = FOUR_CHAR_CODE('offs'),
218  cmTechnologySilkscreen = FOUR_CHAR_CODE('silk'),
219  cmTechnologyFlexography = FOUR_CHAR_CODE('flex')
220 };
221 
222 /* public type signatures */
223 enum {
224  cmSigCurveType = FOUR_CHAR_CODE('curv'),
225  cmSigDataType = FOUR_CHAR_CODE('data'),
226  cmSigDateTimeType = FOUR_CHAR_CODE('dtim'),
227  cmSigLut16Type = FOUR_CHAR_CODE('mft2'),
228  cmSigLut8Type = FOUR_CHAR_CODE('mft1'),
229  cmSigMeasurementType = FOUR_CHAR_CODE('meas'),
230  cmSigNamedColorType = FOUR_CHAR_CODE('ncol'),
231  cmSigNamedColor2Type = FOUR_CHAR_CODE('ncl2'),
232  cmSigProfileDescriptionType = FOUR_CHAR_CODE('desc'),
233  cmSigScreeningType = FOUR_CHAR_CODE('scrn'),
234  cmSigS15Fixed16Type = FOUR_CHAR_CODE('sf32'),
235  cmSigSignatureType = FOUR_CHAR_CODE('sig '),
236  cmSigTextType = FOUR_CHAR_CODE('text'),
237  cmSigU16Fixed16Type = FOUR_CHAR_CODE('uf32'),
238  cmSigU1Fixed15Type = FOUR_CHAR_CODE('uf16'),
239  cmSigUInt8Type = FOUR_CHAR_CODE('ui08'),
240  cmSigUInt16Type = FOUR_CHAR_CODE('ui16'),
241  cmSigUInt32Type = FOUR_CHAR_CODE('ui32'),
242  cmSigUInt64Type = FOUR_CHAR_CODE('ui64'),
243  cmSigUcrBgType = FOUR_CHAR_CODE('bfd '),
244  cmSigUnicodeTextType = FOUR_CHAR_CODE('utxt'),
245  cmSigViewingConditionsType = FOUR_CHAR_CODE('view'),
246  cmSigXYZType = FOUR_CHAR_CODE('XYZ ')
247 };
248 
249 /* custom type signatures */
250 enum {
251  cmSigPS2CRDVMSizeType = FOUR_CHAR_CODE('psvm'),
252  cmSigVideoCardGammaType = FOUR_CHAR_CODE('vcgt'),
253  cmSigMakeAndModelType = FOUR_CHAR_CODE('mmod'),
254  cmSigMultiLocalizedUniCodeType = FOUR_CHAR_CODE('mluc')
255 };
256 
257 /* Measurement type encodings */
258 /* Measurement Flare */
259 enum { cmFlare0 = 0x00000000, cmFlare100 = 0x00000001 };
260 
261 /* Measurement Geometry */
262 enum {
263  cmGeometryUnknown = 0x00000000,
264  cmGeometry045or450 = 0x00000001,
265  cmGeometry0dord0 = 0x00000002
266 };
267 
268 /* Standard Observer */
269 enum {
270  cmStdobsUnknown = 0x00000000,
271  cmStdobs1931TwoDegrees = 0x00000001,
272  cmStdobs1964TenDegrees = 0x00000002
273 };
274 
275 /* Standard Illuminant */
276 enum {
277  cmIlluminantUnknown = 0x00000000,
278  cmIlluminantD50 = 0x00000001,
279  cmIlluminantD65 = 0x00000002,
280  cmIlluminantD93 = 0x00000003,
281  cmIlluminantF2 = 0x00000004,
282  cmIlluminantD55 = 0x00000005,
283  cmIlluminantA = 0x00000006,
284  cmIlluminantEquiPower = 0x00000007,
285  cmIlluminantF8 = 0x00000008
286 };
287 
288 /* Spot Function Value */
289 enum {
290  cmSpotFunctionUnknown = 0,
291  cmSpotFunctionDefault = 1,
292  cmSpotFunctionRound = 2,
293  cmSpotFunctionDiamond = 3,
294  cmSpotFunctionEllipse = 4,
295  cmSpotFunctionLine = 5,
296  cmSpotFunctionSquare = 6,
297  cmSpotFunctionCross = 7
298 };
299 
300 /* Color Space Signatures */
301 enum {
302  cmXYZData = FOUR_CHAR_CODE('XYZ '),
303  cmLabData = FOUR_CHAR_CODE('Lab '),
304  cmLuvData = FOUR_CHAR_CODE('Luv '),
305  cmYxyData = FOUR_CHAR_CODE('Yxy '),
306  cmRGBData = FOUR_CHAR_CODE('RGB '),
307  cmSRGBData = FOUR_CHAR_CODE('sRGB'),
308  cmGrayData = FOUR_CHAR_CODE('GRAY'),
309  cmHSVData = FOUR_CHAR_CODE('HSV '),
310  cmHLSData = FOUR_CHAR_CODE('HLS '),
311  cmCMYKData = FOUR_CHAR_CODE('CMYK'),
312  cmCMYData = FOUR_CHAR_CODE('CMY '),
313  cmMCH5Data = FOUR_CHAR_CODE('MCH5'),
314  cmMCH6Data = FOUR_CHAR_CODE('MCH6'),
315  cmMCH7Data = FOUR_CHAR_CODE('MCH7'),
316  cmMCH8Data = FOUR_CHAR_CODE('MCH8'),
317  cm3CLRData = FOUR_CHAR_CODE('3CLR'),
318  cm4CLRData = FOUR_CHAR_CODE('4CLR'),
319  cm5CLRData = FOUR_CHAR_CODE('5CLR'),
320  cm6CLRData = FOUR_CHAR_CODE('6CLR'),
321  cm7CLRData = FOUR_CHAR_CODE('7CLR'),
322  cm8CLRData = FOUR_CHAR_CODE('8CLR'),
323  cmNamedData = FOUR_CHAR_CODE('NAME')
324 };
325 
326 /* profileClass enumerations */
327 enum {
328  cmInputClass = FOUR_CHAR_CODE('scnr'),
329  cmDisplayClass = FOUR_CHAR_CODE('mntr'),
330  cmOutputClass = FOUR_CHAR_CODE('prtr'),
331  cmLinkClass = FOUR_CHAR_CODE('link'),
332  cmAbstractClass = FOUR_CHAR_CODE('abst'),
333  cmColorSpaceClass = FOUR_CHAR_CODE('spac'),
334  cmNamedColorClass = FOUR_CHAR_CODE('nmcl')
335 };
336 
337 /* platform enumerations */
338 enum {
339  cmMacintosh = FOUR_CHAR_CODE('APPL'),
340  cmMicrosoft = FOUR_CHAR_CODE('MSFT'),
341  cmSolaris = FOUR_CHAR_CODE('SUNW'),
342  cmSiliconGraphics = FOUR_CHAR_CODE('SGI '),
343  cmTaligent = FOUR_CHAR_CODE('TGNT')
344 };
345 
346 /* ColorSync 1.0 elements */
347 enum {
348  cmCS1ChromTag = FOUR_CHAR_CODE('chrm'),
349  cmCS1TRCTag = FOUR_CHAR_CODE('trc '),
350  cmCS1NameTag = FOUR_CHAR_CODE('name'),
351  cmCS1CustTag = FOUR_CHAR_CODE('cust')
352 };
353 
354 /* General element data types */
355 struct CMDateTime {
356  UInt16 year;
357  UInt16 month;
358  UInt16 dayOfTheMonth;
359  UInt16 hours;
360  UInt16 minutes;
361  UInt16 seconds;
362 };
363 typedef struct CMDateTime CMDateTime;
365  Fixed X;
366  Fixed Y;
367  Fixed Z;
368 };
369 typedef struct CMFixedXYZColor CMFixedXYZColor;
370 
371 typedef UInt16 CMXYZComponent;
372 struct CMXYZColor {
373  CMXYZComponent X;
374  CMXYZComponent Y;
375  CMXYZComponent Z;
376 };
377 typedef struct CMXYZColor CMXYZColor;
378 struct CM2Header {
379  UInt32 size; /* This is the total size of the Profile */
380  OSType CMMType; /* CMM signature, Registered with CS2 consortium */
381  UInt32 profileVersion; /* Version of CMProfile format */
382  OSType profileClass; /* input, display, output, devicelink, abstract, or color
383  conversion profile type */
384  OSType dataColorSpace; /* color space of data */
385  OSType profileConnectionSpace; /* profile connection color space */
386  CMDateTime dateTime; /* date and time of profile creation */
387  OSType CS2profileSignature; /* 'acsp' constant ColorSync 2.0 file ID */
388  OSType
389  platform; /* primary profile platform, Registered with CS2 consortium */
390  UInt32 flags; /* profile flags */
391  OSType deviceManufacturer; /* Registered with ICC consortium */
392  UInt32 deviceModel; /* Registered with ICC consortium */
393  UInt32 deviceAttributes[2]; /* Attributes[0] is for device vendors, [1] is for
394  ICC */
395  UInt32 renderingIntent; /* preferred rendering intent of tagged object */
396  CMFixedXYZColor white; /* profile illuminant */
397  OSType creator; /* profile creator */
398  char reserved[44]; /* reserved for future use */
399 };
400 typedef struct CM2Header CM2Header;
401 struct CMTagRecord {
402  OSType tag; /* Registered with CS2 consortium */
403  UInt32 elementOffset; /* Relative to start of CMProfile */
404  UInt32 elementSize;
405 };
406 typedef struct CMTagRecord CMTagRecord;
408  UInt32 count;
409  CMTagRecord tagList[1]; /* variable size, determined by count */
410 };
411 typedef struct CMTagElemTable CMTagElemTable;
412 struct CM2Profile {
414  CMTagElemTable tagTable;
415  char elemData[1]; /* variable size data for tagged element storage */
416 };
417 typedef struct CM2Profile CM2Profile;
418 typedef CM2Profile *CM2ProfilePtr;
420 /* Tag Type Definitions */
422  OSType typeDescriptor; /* 'sf32' = cmSigS15Fixed16Type */
423  unsigned long reserved; /* fill with 0x00 */
424  Fixed adaptationMatrix[9]; /* fixed size of nine matrix entries */
425 };
427 struct CMCurveType {
428  OSType typeDescriptor; /* 'curv' = cmSigCurveType */
429  UInt32 reserved; /* fill with 0x00 */
430  UInt32 countValue; /* number of entries in table that follows */
431  UInt16 data[1]; /* variable size, determined by countValue */
432 };
433 typedef struct CMCurveType CMCurveType;
434 struct CMDataType {
435  OSType typeDescriptor; /* 'data' = cmSigDataType*/
436  UInt32 reserved; /* fill with 0x00 */
437  UInt32 dataFlag; /* 0 = ASCII, 1 = binary */
438  char data[1]; /* variable size, determined by tag element size */
439 };
440 typedef struct CMDataType CMDataType;
442  OSType typeDescriptor; /* 'dtim' = cmSigDateTimeType */
443  UInt32 reserved; /* fill with 0x00 */
444  CMDateTime dateTime; /* */
445 };
446 typedef struct CMDateTimeType CMDateTimeType;
447 struct CMLut16Type {
448  OSType typeDescriptor; /* 'mft2' = cmSigLut16Type */
449  UInt32 reserved; /* fill with 0x00 */
450  UInt8 inputChannels; /* Number of input channels */
451  UInt8 outputChannels; /* Number of output channels */
452  UInt8 gridPoints; /* Number of clutTable grid points */
453  UInt8 reserved2; /* fill with 0x00 */
454  Fixed matrix[3][3]; /* */
455  UInt16 inputTableEntries; /* Number of entries in 1-D input luts */
456  UInt16 outputTableEntries; /* Number of entries in 1-D output luts */
457  UInt16 inputTable[1]; /* variable size, determined by
458  inputChannels*inputTableEntries */
459 #if 0 /* NOTE: Field offsets are variable from here on. */
460  /* In order to correctly reflect the actual format of this tag, some of the fields in */
461  /* this structure have been removed because they follow an array field of variable size. */
462  /* As a result, the size of this structure has changed from previous versions of this interface. */
463  /* Code that relies on sizeof(CMLut16Type) should be changed. */
464  UInt16 CLUT[]; /* variable size, determined by (gridPoints^inputChannels)*outputChannels */
465  UInt16 outputTable[]; /* variable size, determined by outputChannels*outputTableEntries */
466 #endif
467 };
468 typedef struct CMLut16Type CMLut16Type;
469 struct CMLut8Type {
470  OSType typeDescriptor; /* 'mft1' = cmSigLut8Type */
471  UInt32 reserved; /* fill with 0x00 */
472  UInt8 inputChannels; /* Number of input channels */
473  UInt8 outputChannels; /* Number of output channels */
474  UInt8 gridPoints; /* Number of clutTable grid points */
475  UInt8 reserved2; /* fill with 0x00 */
476  Fixed matrix[3][3]; /* */
477  UInt8 inputTable[1]; /* variable size, determined by inputChannels*256 */
478 #if 0 /* NOTE: Field offsets are variable from here on. */
479  /* In order to correctly reflect the actual format of this tag, some of the fields in */
480  /* this structure have been removed because they follow an array field of variable size. */
481  /* As a result, the size of this structure has changed from previous versions of this interface. */
482  /* Code that relies on sizeof(CMLut8Type) should be changed. */
483  UInt8 CLUT[]; /* variable size, determined by (gridPoints^inputChannels)*outputChannels */
484  UInt8 outputTable[]; /* variable size, determined by outputChannels*256 */
485 #endif
486 };
487 typedef struct CMLut8Type CMLut8Type;
489  OSType typeDescriptor; /* 'meas' = cmSigMeasurementType */
490  UInt32 reserved; /* fill with 0x00 */
491  UInt32 standardObserver; /* cmStdobsUnknown, cmStdobs1931TwoDegrees,
492  cmStdobs1964TenDegrees */
493  CMFixedXYZColor backingXYZ; /* absolute XYZ values of backing */
494  UInt32 geometry; /* cmGeometryUnknown, cmGeometry045or450 (0/45),
495  cmGeometry0dord0 (0/d or d/0) */
496  UInt32 flare; /* cmFlare0, cmFlare100 */
497  UInt32 illuminant; /* cmIlluminantUnknown, cmIlluminantD50, ... */
498 };
499 typedef struct CMMeasurementType CMMeasurementType;
501  OSType typeDescriptor; /* 'ncol' = cmSigNamedColorType */
502  UInt32 reserved; /* fill with 0x00 */
503  UInt32 vendorFlag; /* */
504  UInt32 count; /* count of named colors in array that follows */
505  UInt8 prefixName[1]; /* variable size, max = 32 */
506 #if 0 /* NOTE: Field offsets are variable from here on. */
507  /* In order to correctly reflect the actual format of this tag, some of the fields in */
508  /* this structure have been removed because they follow an array field of variable size. */
509  /* As a result, the size of this structure has changed from previous versions of this interface. */
510  /* Code that relies on sizeof(CMNamedColorType) should be changed. */
511  UInt8 suffixName[]; /* variable size, max = 32 */
512  struct {
513  UInt8 rootName[]; /* variable size, max = 32 */
514  UInt8 colorCoords[]; /* variable size */
515  } colorName[]; /* variable size */
516 #endif
517 };
518 typedef struct CMNamedColorType CMNamedColorType;
520  UInt8 rootName[32]; /* 32 byte field. 7 bit ASCII null terminated */
521  UInt16 PCSColorCoords[3]; /* Lab or XYZ color */
522  UInt16 DeviceColorCoords[1]; /* variable size */
523 };
526  OSType typeDescriptor; /* 'ncl2' = cmSigNamedColor2Type */
527  UInt32 reserved; /* fill with 0x00 */
528  UInt32 vendorFlag; /* lower 16 bits reserved for ICC use */
529  UInt32 count; /* count of named colors in array that follows */
530  UInt32 deviceChannelCount; /* number of device channels, 0 indicates no device
531  value available */
532  UInt8 prefixName[32]; /* Fixed 32 byte size. 7 bit ASCII null terminated */
533  UInt8 suffixName[32]; /* Fixed 32 byte size. 7 bit ASCII null terminated */
534  char data[1]; /* variable size data for CMNamedColor2EntryType */
535 };
536 typedef struct CMNamedColor2Type CMNamedColor2Type;
538  OSType typeDescriptor; /* 'desc' = cmSigProfileDescriptionType */
539  UInt32 reserved; /* fill with 0x00 */
540  UInt32 ASCIICount; /* Count of bytes (including null terminator) */
541  UInt8 ASCIIName[2]; /* variable size, determined by ASCIICount. 7 bit ASCII
542  null terminated */
543 #if 0 /* NOTE: Field offsets are variable from here on. */
544  /* In order to correctly reflect the actual format of this tag, some of the fields in */
545  /* this structure have been removed because they follow an array field of variable size. */
546  /* As a result, the size of this structure has changed from previous versions of this interface. */
547  /* Code that relies on sizeof(CMTextDescriptionType) should be changed. */
548  UInt32 UniCodeCode; /* Unused */
549  UInt32 UniCodeCount; /* Count of 2-byte characters (including null terminator) */
550  UInt8 UniCodeName[]; /* variable size, determined by UniCodeCount */
551  SInt16 ScriptCodeCode; /* Mac-defined script code */
552  UInt8 ScriptCodeCount; /* Count of bytes (including null terminator) */
553  UInt8 ScriptCodeName[]; /* variable size, determined by ScriptCodeCount */
554 #endif
555 };
557 struct CMTextType {
558  OSType typeDescriptor; /* 'text' = cmSigTextType */
559  UInt32 reserved; /* fill with 0x00 */
560  UInt8 text[1]; /* variable size, determined by tag element size */
561 };
562 typedef struct CMTextType CMTextType;
564  OSType typeDescriptor; /* 'utxt' = cmSigUnicodeTextType */
565  UInt32 reserved; /* fill with 0x00 */
566  UniChar text[1]; /* variable size, determined by tag element size */
567 };
568 typedef struct CMUnicodeTextType CMUnicodeTextType;
570  Fixed frequency;
571  Fixed angle;
572  UInt32 spotFunction;
573 };
576  OSType typeDescriptor; /* 'scrn' = cmSigScreeningType */
577  UInt32 reserved; /* fill with 0x00 */
578  UInt32
579  screeningFlag; /* bit 0 : use printer default screens, bit 1 : inch/cm */
580  UInt32 channelCount; /* */
582  channelInfo[1]; /* variable size, determined by channelCount */
583 };
584 typedef struct CMScreeningType CMScreeningType;
586  OSType typeDescriptor; /* 'sig ' = cmSigSignatureType */
587  UInt32 reserved; /* fill with 0x00 */
588  OSType signature;
589 };
590 typedef struct CMSignatureType CMSignatureType;
592  OSType typeDescriptor; /* 'sf32' = cmSigS15Fixed16Type */
593  UInt32 reserved; /* fill with 0x00 */
594  Fixed value[1]; /* variable size, determined by tag element size */
595 };
598  OSType typeDescriptor; /* 'uf32' = cmSigU16Fixed16Type */
599  UInt32 reserved; /* fill with 0x00 */
600  UInt32 value[1]; /* variable size, determined by tag element size */
601 };
604  OSType typeDescriptor; /* 'ui08' = cmSigUInt8Type */
605  UInt32 reserved; /* fill with 0x00 */
606  UInt8 value[1]; /* variable size, determined by tag element size */
607 };
608 typedef struct CMUInt8ArrayType CMUInt8ArrayType;
610  OSType typeDescriptor; /* 'ui16' = cmSigUInt16Type */
611  UInt32 reserved; /* fill with 0x00 */
612  UInt16 value[1]; /* variable size, determined by tag element size */
613 };
614 typedef struct CMUInt16ArrayType CMUInt16ArrayType;
616  OSType typeDescriptor; /* 'ui32' = cmSigUInt32Type */
617  UInt32 reserved; /* fill with 0x00 */
618  UInt32 value[1]; /* variable size, determined by tag element size */
619 };
620 typedef struct CMUInt32ArrayType CMUInt32ArrayType;
622  OSType typeDescriptor; /* 'ui64' = cmSigUInt64Type */
623  UInt32 reserved; /* fill with 0x00 */
624  UInt32 value[1]; /* variable size, determined by tag element size */
625 };
626 typedef struct CMUInt64ArrayType CMUInt64ArrayType;
628  OSType typeDescriptor; /* 'view' = cmSigViewingConditionsType */
629  UInt32 reserved; /* fill with 0x00 */
630  CMFixedXYZColor illuminant; /* absolute XYZs of illuminant in cd/m^2 */
631  CMFixedXYZColor surround; /* absolute XYZs of surround in cd/m^2 */
632  UInt32 stdIlluminant; /* see definitions of std illuminants */
633 };
635 struct CMXYZType {
636  OSType typeDescriptor; /* 'XYZ ' = cmSigXYZType */
637  UInt32 reserved; /* fill with 0x00 */
638  CMFixedXYZColor XYZ[1]; /* variable size, determined by tag element size */
639 };
640 typedef struct CMXYZType CMXYZType;
642  OSType typeDescriptor; /* 'pseq' = cmProfileSequenceDescTag */
643  UInt32 reserved; /* fill with 0x00 */
644  UInt32 count; /* Number of descriptions */
645  char data[1]; /* variable size data explained in ICC spec */
646 };
648 struct CMUcrBgType {
649  OSType typeDescriptor; /* 'bfd ' = cmSigUcrBgType */
650  UInt32 reserved; /* fill with 0x00 */
651  UInt32 ucrCount; /* Number of UCR entries */
652  UInt16 ucrValues[1]; /* variable size, determined by ucrCount */
653 #if 0 /* NOTE: Field offsets are variable from here on. */
654  /* In order to correctly reflect the actual format of this tag, some of the fields in */
655  /* this structure have been removed because they follow an array field of variable size. */
656  /* As a result, the size of this structure has changed from previous versions of this interface. */
657  /* Code that relies on sizeof(CMUcrBgType) should be changed. */
658  UInt32 bgCount; /* Number of BG entries */
659  UInt16 bgValues[]; /* variable size, determined by bgCount */
660  UInt8 ucrbgASCII[]; /* null terminated ASCII string */
661 #endif
662 };
663 typedef struct CMUcrBgType CMUcrBgType;
664 /* Private Tag Type Definitions */
666  long renderingIntent; /* rendering intent */
667  UInt32 VMSize; /* VM size taken up by the CRD */
668 };
669 typedef struct CMIntentCRDVMSize CMIntentCRDVMSize;
671  OSType typeDescriptor; /* 'psvm' = cmSigPS2CRDVMSizeType */
672  UInt32 reserved; /* fill with 0x00 */
673  UInt32 count; /* number of intent entries */
674  CMIntentCRDVMSize intentCRD[1]; /* variable size, determined by count */
675 };
677 enum { cmVideoCardGammaTableType = 0, cmVideoCardGammaFormulaType = 1 };
678 
680  UInt16 channels; /* # of gamma channels (1 or 3) */
681  UInt16 entryCount; /* 1-based number of entries per channel */
682  UInt16 entrySize; /* size in bytes of each entry */
683  char data[1]; /* variable size, determined by channels*entryCount*entrySize */
684 };
687  Fixed redGamma; /* must be > 0.0 */
688  Fixed redMin; /* must be > 0.0 and < 1.0 */
689  Fixed redMax; /* must be > 0.0 and < 1.0 */
690  Fixed greenGamma; /* must be > 0.0 */
691  Fixed greenMin; /* must be > 0.0 and < 1.0 */
692  Fixed greenMax; /* must be > 0.0 and < 1.0 */
693  Fixed blueGamma; /* must be > 0.0 */
694  Fixed blueMin; /* must be > 0.0 and < 1.0 */
695  Fixed blueMax; /* must be > 0.0 and < 1.0 */
696 };
699  UInt32 tagType;
700  union {
701  CMVideoCardGammaTable table;
702  CMVideoCardGammaFormula formula;
703  } u;
704 };
705 typedef struct CMVideoCardGamma CMVideoCardGamma;
707  OSType typeDescriptor; /* 'vcgt' = cmSigVideoCardGammaType */
708  UInt32 reserved; /* fill with 0x00 */
709  CMVideoCardGamma gamma;
710 };
713  OSType manufacturer;
714  UInt32 model;
715  UInt32 serialNumber;
716  UInt32 manufactureDate;
717  UInt32 reserved1; /* fill with 0x00 */
718  UInt32 reserved2; /* fill with 0x00 */
719  UInt32 reserved3; /* fill with 0x00 */
720  UInt32 reserved4; /* fill with 0x00 */
721 };
722 typedef struct CMMakeAndModel CMMakeAndModel;
724  OSType typeDescriptor; /* 'mmod' = cmSigMakeAndModelType */
725  UInt32 reserved; /* fill with 0x00 */
726  CMMakeAndModel makeAndModel;
727 };
730  char languageCode[2]; /* language code from ISO-639 */
731  char regionCode[2]; /* region code from ISO-3166 */
732  UInt32 textLength; /* the length in bytes of the string */
733  UInt32 textOffset; /* the offset from the start of tag in bytes */
734 };
737  OSType typeDescriptor; /* 'mluc' = cmSigMultiLocalizedUniCodeType */
738  UInt32 reserved; /* fill with 0x00 */
739  UInt32 entryCount; /* 1-based number of name records that follow */
740  UInt32 entrySize; /* size in bytes of name records that follow */
741 
742  /* variable-length data for storage of CMMultiLocalizedUniCodeEntryRec */
743 
744  /* variable-length data for storage of Unicode strings*/
745 };
747 /************************************************************************/
748 /*************** ColorSync 1.0 profile specification ********************/
749 /************************************************************************/
750 enum {
751  cmGrayResponse = 0,
752  cmRedResponse = 1,
753  cmGreenResponse = 2,
754  cmBlueResponse = 3,
755  cmCyanResponse = 4,
756  cmMagentaResponse = 5,
757  cmYellowResponse = 6,
758  cmUcrResponse = 7,
759  cmBgResponse = 8,
760  cmOnePlusLastResponse = 9
761 };
762 
763 /* Device types */
764 enum {
765  cmMonitorDevice = FOUR_CHAR_CODE('mntr'),
766  cmScannerDevice = FOUR_CHAR_CODE('scnr'),
767  cmPrinterDevice = FOUR_CHAR_CODE('prtr')
768 };
769 
770 struct CMIString {
771  ScriptCode theScript;
772  Str63 theString;
773 };
774 typedef struct CMIString CMIString;
775 /* Profile options */
776 enum {
777  cmPerceptualMatch = 0x0000, /* Default. For photographic images */
778  cmColorimetricMatch = 0x0001, /* Exact matching when possible */
779  cmSaturationMatch = 0x0002 /* For solid colors */
780 };
781 
782 /* Profile flags */
783 enum {
784  cmNativeMatchingPreferred = 0x00000001, /* Default to native not preferred */
785  cmTurnOffCache = 0x00000002 /* Default to turn on CMM cache */
786 };
787 
788 typedef long CMMatchOption;
789 typedef long CMMatchFlag;
790 struct CMHeader {
791  UInt32 size;
792  OSType CMMType;
793  UInt32 applProfileVersion;
794  OSType dataType;
795  OSType deviceType;
796  OSType deviceManufacturer;
797  UInt32 deviceModel;
798  UInt32 deviceAttributes[2];
799  UInt32 profileNameOffset;
800  UInt32 customDataOffset;
801  CMMatchFlag flags;
802  CMMatchOption options;
803  CMXYZColor white;
804  CMXYZColor black;
805 };
806 typedef struct CMHeader CMHeader;
808  CMXYZColor red;
809  CMXYZColor green;
810  CMXYZColor blue;
811  CMXYZColor cyan;
812  CMXYZColor magenta;
813  CMXYZColor yellow;
814 };
817  UInt16 counts[9];
818  UInt16 data[1]; /* Variable size */
819 };
820 typedef struct CMProfileResponse CMProfileResponse;
821 struct CMProfile {
824  CMProfileResponse response;
825  CMIString profileName;
826  char customData[1]; /* Variable size */
827 };
828 typedef struct CMProfile CMProfile;
829 typedef CMProfile *CMProfilePtr;
831 #if OLDROUTINENAMES
832 enum { kCMApplProfileVersion = cmCS1ProfileVersion };
833 
834 enum {
835  grayResponse = cmGrayResponse,
836  redResponse = cmRedResponse,
837  greenResponse = cmGreenResponse,
838  blueResponse = cmBlueResponse,
839  cyanResponse = cmCyanResponse,
840  magentaResponse = cmMagentaResponse,
841  yellowResponse = cmYellowResponse,
842  ucrResponse = cmUcrResponse,
843  bgResponse = cmBgResponse,
844  onePlusLastResponse = cmOnePlusLastResponse
845 };
846 
847 enum {
848  rgbData = cmRGBData,
849  cmykData = cmCMYKData,
850  grayData = cmGrayData,
851  xyzData = cmXYZData
852 };
853 
854 enum { XYZData = cmXYZData };
855 
856 enum {
857  monitorDevice = cmMonitorDevice,
858  scannerDevice = cmScannerDevice,
859  printerDevice = cmPrinterDevice
860 };
861 
862 enum {
863  CMNativeMatchingPreferred =
864  cmNativeMatchingPreferred, /* Default to native not preferred */
865  CMTurnOffCache = cmTurnOffCache /* Default to turn on CMM cache */
866 };
867 
868 enum {
869  CMPerceptualMatch = cmPerceptualMatch, /* Default. For photographic images */
870  CMColorimetricMatch = cmColorimetricMatch, /* Exact matching when possible */
871  CMSaturationMatch = cmSaturationMatch /* For solid colors */
872 };
873 
874 typedef UInt16 XYZComponent;
875 typedef CMXYZColor XYZColor;
876 typedef UInt16 CMResponseData;
877 typedef CMIString IString;
878 typedef long CMResponseColor;
879 typedef CMResponseColor responseColor;
880 #endif /* OLDROUTINENAMES */
881 
882 #if PRAGMA_STRUCT_ALIGN
883 #pragma options align = reset
884 #elif PRAGMA_STRUCT_PACKPUSH
885 #pragma pack(pop)
886 #elif PRAGMA_STRUCT_PACK
887 #pragma pack()
888 #endif
889 
890 #ifdef PRAGMA_IMPORT_OFF
891 #pragma import off
892 #elif PRAGMA_IMPORT
893 #pragma import reset
894 #endif
895 
896 #ifdef __cplusplus
897 }
898 #endif
899 
900 #endif /* __CMICCPROFILE__ */
Basic Macintosh data types.
long Fixed
Definition: MacTypes.h:153
Definition: CMICCProfile.h:378
Definition: CMICCProfile.h:412
Definition: CMICCProfile.h:421
Definition: CMICCProfile.h:427
Definition: CMICCProfile.h:434
Definition: CMICCProfile.h:441
Definition: CMICCProfile.h:355
Definition: CMICCProfile.h:364
Definition: CMICCProfile.h:790
Definition: CMICCProfile.h:770
Definition: CMICCProfile.h:665
Definition: CMICCProfile.h:447
Definition: CMICCProfile.h:469
Definition: CMICCProfile.h:723
Definition: CMICCProfile.h:712
Definition: CMICCProfile.h:488
Definition: CMICCProfile.h:729
Definition: CMICCProfile.h:736
Definition: CMICCProfile.h:519
Definition: CMICCProfile.h:525
Definition: CMICCProfile.h:500
Definition: CMICCProfile.h:670
Definition: CMICCProfile.h:807
Definition: CMICCProfile.h:816
Definition: CMICCProfile.h:641
Definition: CMICCProfile.h:821
Definition: CMICCProfile.h:591
Definition: CMICCProfile.h:569
Definition: CMICCProfile.h:575
Definition: CMICCProfile.h:585
Definition: CMICCProfile.h:407
Definition: CMICCProfile.h:401
Definition: CMICCProfile.h:537
Definition: CMICCProfile.h:557
Definition: CMICCProfile.h:597
Definition: CMICCProfile.h:609
Definition: CMICCProfile.h:615
Definition: CMICCProfile.h:621
Definition: CMICCProfile.h:603
Definition: CMICCProfile.h:648
Definition: CMICCProfile.h:563
Definition: CMICCProfile.h:686
Definition: CMICCProfile.h:679
Definition: CMICCProfile.h:706
Definition: CMICCProfile.h:698
Definition: CMICCProfile.h:627
Definition: CMICCProfile.h:372
Definition: CMICCProfile.h:635
Definition: Components.h:266