Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1025 lines
48 KiB

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