CMICCProfile.pas 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882
  1. {
  2. File: CMICCProfile.p
  3. Contains: ICC Profile Format Definitions
  4. Version: Technology: ColorSync 2.5
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1994-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit CMICCProfile;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes;
  92. {$ALIGN MAC68K}
  93. { ICC Profile version constants }
  94. const
  95. cmICCProfileVersion2 = $02000000;
  96. cmICCProfileVersion21 = $02100000;
  97. cmCS2ProfileVersion = $02000000;
  98. cmCS1ProfileVersion = $00000100; { ColorSync 1.0 profile version }
  99. { Current Major version number }
  100. cmProfileMajorVersionMask = $FF000000;
  101. cmCurrentProfileMajorVersion = $02000000;
  102. { magic cookie number for anonymous file ID }
  103. cmMagicNumber = $61637370 (* 'acsp' *);
  104. { ********************************************************************** }
  105. { ************** ColorSync 2.0 profile specification ******************* }
  106. { ********************************************************************** }
  107. { *** flags field *** }
  108. cmICCReservedFlagsMask = $0000FFFF; { these bits of the flags field are defined and reserved by ICC }
  109. cmEmbeddedMask = $00000001; { if bit 0 is 0 then not embedded profile, if 1 then embedded profile }
  110. cmEmbeddedUseMask = $00000002; { if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only }
  111. cmCMSReservedFlagsMask = $FFFF0000; { these bits of the flags field are defined and reserved by CMS vendor }
  112. cmQualityMask = $00030000; { if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best }
  113. cmInterpolationMask = $00040000; { if bit 18 is 0 then interpolation, if 1 then lookup only }
  114. cmGamutCheckingMask = $00080000; { if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info }
  115. { copyright-protection flag options }
  116. cmEmbeddedProfile = 0; { 0 is not embedded profile, 1 is embedded profile }
  117. cmEmbeddedUse = 1; { 0 is to use anywhere, 1 is to use as embedded profile only }
  118. { speed and quality flag options }
  119. cmNormalMode = 0; { it uses the least significent two bits in the high word of flag }
  120. cmDraftMode = 1; { it should be evaulated like this: right shift 16 bits first, mask off the }
  121. cmBestMode = 2; { high 14 bits, and then compare with the enum to determine the option value }
  122. { *** deviceAttributes fields *** }
  123. { deviceAttributes[0] is defined by and reserved for device vendors }
  124. { deviceAttributes[1] is defined by and reserved for ICC }
  125. { The following bits of deviceAttributes[1] are currently defined }
  126. cmReflectiveTransparentMask = $00000001; { if bit 0 is 0 then reflective media, if 1 then transparency media }
  127. cmGlossyMatteMask = $00000002; { if bit 1 is 0 then glossy, if 1 then matte }
  128. { device/media attributes element values }
  129. cmReflective = 0; { if bit 0 is 0 then reflective media, if 1 then transparency media }
  130. cmGlossy = 1; { if bit 1 is 0 then glossy, if 1 then matte }
  131. { *** renderingIntent field *** }
  132. cmPerceptual = 0; { Photographic images }
  133. cmRelativeColorimetric = 1; { Logo Colors }
  134. cmSaturation = 2; { Business graphics }
  135. cmAbsoluteColorimetric = 3; { Logo Colors }
  136. { data type element values }
  137. cmAsciiData = 0;
  138. cmBinaryData = 1;
  139. { screen encodings }
  140. cmPrtrDefaultScreens = 0; { Use printer default screens. 0 is false, 1 is ture }
  141. cmLinesPer = 1; { 0 is LinesPerCm, 1 is LinesPerInch }
  142. { 2.0 tag type information }
  143. cmNumHeaderElements = 10;
  144. { public tags }
  145. cmAToB0Tag = $41324230 (* 'A2B0' *);
  146. cmAToB1Tag = $41324231 (* 'A2B1' *);
  147. cmAToB2Tag = $41324232 (* 'A2B2' *);
  148. cmBlueColorantTag = $6258595A (* 'bXYZ' *);
  149. cmBlueTRCTag = $62545243 (* 'bTRC' *);
  150. cmBToA0Tag = $42324130 (* 'B2A0' *);
  151. cmBToA1Tag = $42324131 (* 'B2A1' *);
  152. cmBToA2Tag = $42324132 (* 'B2A2' *);
  153. cmCalibrationDateTimeTag = $63616C74 (* 'calt' *);
  154. cmChromaticAdaptationTag = $63686164 (* 'chad' *);
  155. cmCharTargetTag = $74617267 (* 'targ' *);
  156. cmCopyrightTag = $63707274 (* 'cprt' *);
  157. cmDeviceMfgDescTag = $646D6E64 (* 'dmnd' *);
  158. cmDeviceModelDescTag = $646D6464 (* 'dmdd' *);
  159. cmGamutTag = $67616D74 (* 'gamt' *);
  160. cmGrayTRCTag = $6B545243 (* 'kTRC' *);
  161. cmGreenColorantTag = $6758595A (* 'gXYZ' *);
  162. cmGreenTRCTag = $67545243 (* 'gTRC' *);
  163. cmLuminanceTag = $6C756D69 (* 'lumi' *);
  164. cmMeasurementTag = $6D656173 (* 'meas' *);
  165. cmMediaBlackPointTag = $626B7074 (* 'bkpt' *);
  166. cmMediaWhitePointTag = $77747074 (* 'wtpt' *);
  167. cmNamedColorTag = $6E636F6C (* 'ncol' *);
  168. cmNamedColor2Tag = $6E636C32 (* 'ncl2' *);
  169. cmPreview0Tag = $70726530 (* 'pre0' *);
  170. cmPreview1Tag = $70726531 (* 'pre1' *);
  171. cmPreview2Tag = $70726532 (* 'pre2' *);
  172. cmProfileDescriptionTag = $64657363 (* 'desc' *);
  173. cmProfileSequenceDescTag = $70736571 (* 'pseq' *);
  174. cmPS2CRD0Tag = $70736430 (* 'psd0' *);
  175. cmPS2CRD1Tag = $70736431 (* 'psd1' *);
  176. cmPS2CRD2Tag = $70736432 (* 'psd2' *);
  177. cmPS2CRD3Tag = $70736433 (* 'psd3' *);
  178. cmPS2CSATag = $70733273 (* 'ps2s' *);
  179. cmPS2RenderingIntentTag = $70733269 (* 'ps2i' *);
  180. cmRedColorantTag = $7258595A (* 'rXYZ' *);
  181. cmRedTRCTag = $72545243 (* 'rTRC' *);
  182. cmScreeningDescTag = $73637264 (* 'scrd' *);
  183. cmScreeningTag = $7363726E (* 'scrn' *);
  184. cmTechnologyTag = $74656368 (* 'tech' *);
  185. cmUcrBgTag = $62666420 (* 'bfd ' *);
  186. cmViewingConditionsDescTag = $76756564 (* 'vued' *);
  187. cmViewingConditionsTag = $76696577 (* 'view' *);
  188. { custom tags }
  189. cmPS2CRDVMSizeTag = $7073766D (* 'psvm' *);
  190. cmVideoCardGammaTag = $76636774 (* 'vcgt' *);
  191. cmMakeAndModelTag = $6D6D6F64 (* 'mmod' *);
  192. cmProfileDescriptionMLTag = $6473636D (* 'dscm' *);
  193. { technology tag descriptions }
  194. cmTechnologyFilmScanner = $6673636E (* 'fscn' *);
  195. cmTechnologyReflectiveScanner = $7273636E (* 'rscn' *);
  196. cmTechnologyInkJetPrinter = $696A6574 (* 'ijet' *);
  197. cmTechnologyThermalWaxPrinter = $74776178 (* 'twax' *);
  198. cmTechnologyElectrophotographicPrinter = $6570686F (* 'epho' *);
  199. cmTechnologyElectrostaticPrinter = $65737461 (* 'esta' *);
  200. cmTechnologyDyeSublimationPrinter = $64737562 (* 'dsub' *);
  201. cmTechnologyPhotographicPaperPrinter = $7270686F (* 'rpho' *);
  202. cmTechnologyFilmWriter = $6670726E (* 'fprn' *);
  203. cmTechnologyVideoMonitor = $7669646D (* 'vidm' *);
  204. cmTechnologyVideoCamera = $76696463 (* 'vidc' *);
  205. cmTechnologyProjectionTelevision = $706A7476 (* 'pjtv' *);
  206. cmTechnologyCRTDisplay = $43525420 (* 'CRT ' *);
  207. cmTechnologyPMDisplay = $504D4420 (* 'PMD ' *);
  208. cmTechnologyAMDisplay = $414D4420 (* 'AMD ' *);
  209. cmTechnologyPhotoCD = $4B504344 (* 'KPCD' *);
  210. cmTechnologyPhotoImageSetter = $696D6773 (* 'imgs' *);
  211. cmTechnologyGravure = $67726176 (* 'grav' *);
  212. cmTechnologyOffsetLithography = $6F666673 (* 'offs' *);
  213. cmTechnologySilkscreen = $73696C6B (* 'silk' *);
  214. cmTechnologyFlexography = $666C6578 (* 'flex' *);
  215. { public type signatures }
  216. cmSigCurveType = $63757276 (* 'curv' *);
  217. cmSigDataType = $64617461 (* 'data' *);
  218. cmSigDateTimeType = $6474696D (* 'dtim' *);
  219. cmSigLut16Type = $6D667432 (* 'mft2' *);
  220. cmSigLut8Type = $6D667431 (* 'mft1' *);
  221. cmSigMeasurementType = $6D656173 (* 'meas' *);
  222. cmSigNamedColorType = $6E636F6C (* 'ncol' *);
  223. cmSigNamedColor2Type = $6E636C32 (* 'ncl2' *);
  224. cmSigProfileDescriptionType = $64657363 (* 'desc' *);
  225. cmSigScreeningType = $7363726E (* 'scrn' *);
  226. cmSigS15Fixed16Type = $73663332 (* 'sf32' *);
  227. cmSigSignatureType = $73696720 (* 'sig ' *);
  228. cmSigTextType = $74657874 (* 'text' *);
  229. cmSigU16Fixed16Type = $75663332 (* 'uf32' *);
  230. cmSigU1Fixed15Type = $75663136 (* 'uf16' *);
  231. cmSigUInt8Type = $75693038 (* 'ui08' *);
  232. cmSigUInt16Type = $75693136 (* 'ui16' *);
  233. cmSigUInt32Type = $75693332 (* 'ui32' *);
  234. cmSigUInt64Type = $75693634 (* 'ui64' *);
  235. cmSigUcrBgType = $62666420 (* 'bfd ' *);
  236. cmSigUnicodeTextType = $75747874 (* 'utxt' *);
  237. cmSigViewingConditionsType = $76696577 (* 'view' *);
  238. cmSigXYZType = $58595A20 (* 'XYZ ' *);
  239. { custom type signatures }
  240. cmSigPS2CRDVMSizeType = $7073766D (* 'psvm' *);
  241. cmSigVideoCardGammaType = $76636774 (* 'vcgt' *);
  242. cmSigMakeAndModelType = $6D6D6F64 (* 'mmod' *);
  243. cmSigMultiLocalizedUniCodeType = $6D6C7563 (* 'mluc' *);
  244. { Measurement type encodings }
  245. { Measurement Flare }
  246. cmFlare0 = $00000000;
  247. cmFlare100 = $00000001;
  248. { Measurement Geometry }
  249. cmGeometryUnknown = $00000000;
  250. cmGeometry045or450 = $00000001;
  251. cmGeometry0dord0 = $00000002;
  252. { Standard Observer }
  253. cmStdobsUnknown = $00000000;
  254. cmStdobs1931TwoDegrees = $00000001;
  255. cmStdobs1964TenDegrees = $00000002;
  256. { Standard Illuminant }
  257. cmIlluminantUnknown = $00000000;
  258. cmIlluminantD50 = $00000001;
  259. cmIlluminantD65 = $00000002;
  260. cmIlluminantD93 = $00000003;
  261. cmIlluminantF2 = $00000004;
  262. cmIlluminantD55 = $00000005;
  263. cmIlluminantA = $00000006;
  264. cmIlluminantEquiPower = $00000007;
  265. cmIlluminantF8 = $00000008;
  266. { Spot Function Value }
  267. cmSpotFunctionUnknown = 0;
  268. cmSpotFunctionDefault = 1;
  269. cmSpotFunctionRound = 2;
  270. cmSpotFunctionDiamond = 3;
  271. cmSpotFunctionEllipse = 4;
  272. cmSpotFunctionLine = 5;
  273. cmSpotFunctionSquare = 6;
  274. cmSpotFunctionCross = 7;
  275. { Color Space Signatures }
  276. cmXYZData = $58595A20 (* 'XYZ ' *);
  277. cmLabData = $4C616220 (* 'Lab ' *);
  278. cmLuvData = $4C757620 (* 'Luv ' *);
  279. cmYxyData = $59787920 (* 'Yxy ' *);
  280. cmRGBData = $52474220 (* 'RGB ' *);
  281. cmSRGBData = $73524742 (* 'sRGB' *);
  282. cmGrayData = $47524159 (* 'GRAY' *);
  283. cmHSVData = $48535620 (* 'HSV ' *);
  284. cmHLSData = $484C5320 (* 'HLS ' *);
  285. cmCMYKData = $434D594B (* 'CMYK' *);
  286. cmCMYData = $434D5920 (* 'CMY ' *);
  287. cmMCH5Data = $4D434835 (* 'MCH5' *);
  288. cmMCH6Data = $4D434836 (* 'MCH6' *);
  289. cmMCH7Data = $4D434837 (* 'MCH7' *);
  290. cmMCH8Data = $4D434838 (* 'MCH8' *);
  291. cm3CLRData = $33434C52 (* '3CLR' *);
  292. cm4CLRData = $34434C52 (* '4CLR' *);
  293. cm5CLRData = $35434C52 (* '5CLR' *);
  294. cm6CLRData = $36434C52 (* '6CLR' *);
  295. cm7CLRData = $37434C52 (* '7CLR' *);
  296. cm8CLRData = $38434C52 (* '8CLR' *);
  297. cmNamedData = $4E414D45 (* 'NAME' *);
  298. { profileClass enumerations }
  299. cmInputClass = $73636E72 (* 'scnr' *);
  300. cmDisplayClass = $6D6E7472 (* 'mntr' *);
  301. cmOutputClass = $70727472 (* 'prtr' *);
  302. cmLinkClass = $6C696E6B (* 'link' *);
  303. cmAbstractClass = $61627374 (* 'abst' *);
  304. cmColorSpaceClass = $73706163 (* 'spac' *);
  305. cmNamedColorClass = $6E6D636C (* 'nmcl' *);
  306. { platform enumerations }
  307. cmMacintosh = $4150504C (* 'APPL' *);
  308. cmMicrosoft = $4D534654 (* 'MSFT' *);
  309. cmSolaris = $53554E57 (* 'SUNW' *);
  310. cmSiliconGraphics = $53474920 (* 'SGI ' *);
  311. cmTaligent = $54474E54 (* 'TGNT' *);
  312. { ColorSync 1.0 elements }
  313. cmCS1ChromTag = $6368726D (* 'chrm' *);
  314. cmCS1TRCTag = $74726320 (* 'trc ' *);
  315. cmCS1NameTag = $6E616D65 (* 'name' *);
  316. cmCS1CustTag = $63757374 (* 'cust' *);
  317. { General element data types }
  318. type
  319. CMDateTimePtr = ^CMDateTime;
  320. CMDateTime = record
  321. year: UInt16;
  322. month: UInt16;
  323. dayOfTheMonth: UInt16;
  324. hours: UInt16;
  325. minutes: UInt16;
  326. seconds: UInt16;
  327. end;
  328. CMFixedXYZColorPtr = ^CMFixedXYZColor;
  329. CMFixedXYZColor = record
  330. X: Fixed;
  331. Y: Fixed;
  332. Z: Fixed;
  333. end;
  334. CMXYZComponent = UInt16;
  335. CMXYZColorPtr = ^CMXYZColor;
  336. CMXYZColor = record
  337. X: CMXYZComponent;
  338. Y: CMXYZComponent;
  339. Z: CMXYZComponent;
  340. end;
  341. CM2HeaderPtr = ^CM2Header;
  342. CM2Header = record
  343. size: UInt32; { This is the total size of the Profile }
  344. CMMType: OSType; { CMM signature, Registered with CS2 consortium }
  345. profileVersion: UInt32; { Version of CMProfile format }
  346. profileClass: OSType; { input, display, output, devicelink, abstract, or color conversion profile type }
  347. dataColorSpace: OSType; { color space of data }
  348. profileConnectionSpace: OSType; { profile connection color space }
  349. dateTime: CMDateTime; { date and time of profile creation }
  350. CS2profileSignature: OSType; { 'acsp' constant ColorSync 2.0 file ID }
  351. platform: OSType; { primary profile platform, Registered with CS2 consortium }
  352. flags: UInt32; { profile flags }
  353. deviceManufacturer: OSType; { Registered with ICC consortium }
  354. deviceModel: UInt32; { Registered with ICC consortium }
  355. deviceAttributes: array [0..1] of UInt32; { Attributes[0] is for device vendors, [1] is for ICC }
  356. renderingIntent: UInt32; { preferred rendering intent of tagged object }
  357. white: CMFixedXYZColor; { profile illuminant }
  358. creator: OSType; { profile creator }
  359. reserved: packed array [0..43] of char; { reserved for future use }
  360. end;
  361. CMTagRecordPtr = ^CMTagRecord;
  362. CMTagRecord = record
  363. tag: OSType; { Registered with CS2 consortium }
  364. elementOffset: UInt32; { Relative to start of CMProfile }
  365. elementSize: UInt32;
  366. end;
  367. CMTagElemTablePtr = ^CMTagElemTable;
  368. CMTagElemTable = record
  369. count: UInt32;
  370. tagList: array [0..0] of CMTagRecord; { variable size, determined by count }
  371. end;
  372. CM2ProfilePtr = ^CM2Profile;
  373. CM2Profile = record
  374. header: CM2Header;
  375. tagTable: CMTagElemTable;
  376. elemData: SInt8; { variable size data for tagged element storage }
  377. end;
  378. CM2ProfileHandle = ^CM2ProfilePtr;
  379. { Tag Type Definitions }
  380. CMAdaptationMatrixTypePtr = ^CMAdaptationMatrixType;
  381. CMAdaptationMatrixType = record
  382. typeDescriptor: OSType; { 'sf32' = cmSigS15Fixed16Type }
  383. reserved: UInt32; { fill with 0x00 }
  384. adaptationMatrix: array [0..8] of Fixed; { fixed size of nine matrix entries }
  385. end;
  386. CMCurveTypePtr = ^CMCurveType;
  387. CMCurveType = record
  388. typeDescriptor: OSType; { 'curv' = cmSigCurveType }
  389. reserved: UInt32; { fill with 0x00 }
  390. countValue: UInt32; { number of entries in table that follows }
  391. data: array [0..0] of UInt16; { variable size, determined by countValue }
  392. end;
  393. CMDataTypePtr = ^CMDataType;
  394. CMDataType = record
  395. typeDescriptor: OSType; { 'data' = cmSigDataType }
  396. reserved: UInt32; { fill with 0x00 }
  397. dataFlag: UInt32; { 0 = ASCII, 1 = binary }
  398. data: SInt8; { variable size, determined by tag element size }
  399. end;
  400. CMDateTimeTypePtr = ^CMDateTimeType;
  401. CMDateTimeType = record
  402. typeDescriptor: OSType; { 'dtim' = cmSigDateTimeType }
  403. reserved: UInt32; { fill with 0x00 }
  404. dateTime: CMDateTime; { }
  405. end;
  406. CMLut16TypePtr = ^CMLut16Type;
  407. CMLut16Type = record
  408. typeDescriptor: OSType; { 'mft2' = cmSigLut16Type }
  409. reserved: UInt32; { fill with 0x00 }
  410. inputChannels: SInt8; { Number of input channels }
  411. outputChannels: SInt8; { Number of output channels }
  412. gridPoints: SInt8; { Number of clutTable grid points }
  413. reserved2: SInt8; { fill with 0x00 }
  414. matrix: array [0..2,0..2] of Fixed; { }
  415. inputTableEntries: UInt16; { Number of entries in 1-D input luts }
  416. outputTableEntries: UInt16; { Number of entries in 1-D output luts }
  417. inputTable: array [0..0] of UInt16; { variable size, determined by inputChannels*inputTableEntries }
  418. end;
  419. CMLut8TypePtr = ^CMLut8Type;
  420. CMLut8Type = record
  421. typeDescriptor: OSType; { 'mft1' = cmSigLut8Type }
  422. reserved: UInt32; { fill with 0x00 }
  423. inputChannels: SInt8; { Number of input channels }
  424. outputChannels: SInt8; { Number of output channels }
  425. gridPoints: SInt8; { Number of clutTable grid points }
  426. reserved2: SInt8; { fill with 0x00 }
  427. matrix: array [0..2,0..2] of Fixed; { }
  428. inputTable: SInt8; { variable size, determined by inputChannels*256 }
  429. end;
  430. CMMeasurementTypePtr = ^CMMeasurementType;
  431. CMMeasurementType = record
  432. typeDescriptor: OSType; { 'meas' = cmSigMeasurementType }
  433. reserved: UInt32; { fill with 0x00 }
  434. standardObserver: UInt32; { cmStdobsUnknown, cmStdobs1931TwoDegrees, cmStdobs1964TenDegrees }
  435. backingXYZ: CMFixedXYZColor; { absolute XYZ values of backing }
  436. geometry: UInt32; { cmGeometryUnknown, cmGeometry045or450 (0/45), cmGeometry0dord0 (0/d or d/0) }
  437. flare: UInt32; { cmFlare0, cmFlare100 }
  438. illuminant: UInt32; { cmIlluminantUnknown, cmIlluminantD50, ... }
  439. end;
  440. CMNamedColorTypePtr = ^CMNamedColorType;
  441. CMNamedColorType = record
  442. typeDescriptor: OSType; { 'ncol' = cmSigNamedColorType }
  443. reserved: UInt32; { fill with 0x00 }
  444. vendorFlag: UInt32; { }
  445. count: UInt32; { count of named colors in array that follows }
  446. prefixName: SInt8; { variable size, max = 32 }
  447. end;
  448. CMNamedColor2EntryTypePtr = ^CMNamedColor2EntryType;
  449. CMNamedColor2EntryType = record
  450. rootName: packed array [0..31] of UInt8; { 32 byte field. 7 bit ASCII null terminated }
  451. PCSColorCoords: array [0..2] of UInt16; { Lab or XYZ color }
  452. DeviceColorCoords: array [0..0] of UInt16; { variable size }
  453. end;
  454. CMNamedColor2TypePtr = ^CMNamedColor2Type;
  455. CMNamedColor2Type = record
  456. typeDescriptor: OSType; { 'ncl2' = cmSigNamedColor2Type }
  457. reserved: UInt32; { fill with 0x00 }
  458. vendorFlag: UInt32; { lower 16 bits reserved for ICC use }
  459. count: UInt32; { count of named colors in array that follows }
  460. deviceChannelCount: UInt32; { number of device channels, 0 indicates no device value available }
  461. prefixName: packed array [0..31] of UInt8; { Fixed 32 byte size. 7 bit ASCII null terminated }
  462. suffixName: packed array [0..31] of UInt8; { Fixed 32 byte size. 7 bit ASCII null terminated }
  463. data: SInt8; { variable size data for CMNamedColor2EntryType }
  464. end;
  465. CMTextDescriptionTypePtr = ^CMTextDescriptionType;
  466. CMTextDescriptionType = packed record
  467. typeDescriptor: OSType; { 'desc' = cmSigProfileDescriptionType }
  468. reserved: UInt32; { fill with 0x00 }
  469. ASCIICount: UInt32; { Count of bytes (including null terminator) }
  470. ASCIIName: packed array [0..1] of UInt8; { variable size, determined by ASCIICount. 7 bit ASCII null terminated }
  471. end;
  472. CMTextTypePtr = ^CMTextType;
  473. CMTextType = record
  474. typeDescriptor: OSType; { 'text' = cmSigTextType }
  475. reserved: UInt32; { fill with 0x00 }
  476. text: SInt8; { variable size, determined by tag element size }
  477. end;
  478. CMUnicodeTextTypePtr = ^CMUnicodeTextType;
  479. CMUnicodeTextType = record
  480. typeDescriptor: OSType; { 'utxt' = cmSigUnicodeTextType }
  481. reserved: UInt32; { fill with 0x00 }
  482. text: array [0..0] of UniChar; { variable size, determined by tag element size }
  483. end;
  484. CMScreeningChannelRecPtr = ^CMScreeningChannelRec;
  485. CMScreeningChannelRec = record
  486. frequency: Fixed;
  487. angle: Fixed;
  488. spotFunction: UInt32;
  489. end;
  490. CMScreeningTypePtr = ^CMScreeningType;
  491. CMScreeningType = record
  492. typeDescriptor: OSType; { 'scrn' = cmSigScreeningType }
  493. reserved: UInt32; { fill with 0x00 }
  494. screeningFlag: UInt32; { bit 0 : use printer default screens, bit 1 : inch/cm }
  495. channelCount: UInt32; { }
  496. channelInfo: array [0..0] of CMScreeningChannelRec; { variable size, determined by channelCount }
  497. end;
  498. CMSignatureTypePtr = ^CMSignatureType;
  499. CMSignatureType = record
  500. typeDescriptor: OSType; { 'sig ' = cmSigSignatureType }
  501. reserved: UInt32; { fill with 0x00 }
  502. signature: OSType;
  503. end;
  504. CMS15Fixed16ArrayTypePtr = ^CMS15Fixed16ArrayType;
  505. CMS15Fixed16ArrayType = record
  506. typeDescriptor: OSType; { 'sf32' = cmSigS15Fixed16Type }
  507. reserved: UInt32; { fill with 0x00 }
  508. value: array [0..0] of Fixed; { variable size, determined by tag element size }
  509. end;
  510. CMU16Fixed16ArrayTypePtr = ^CMU16Fixed16ArrayType;
  511. CMU16Fixed16ArrayType = record
  512. typeDescriptor: OSType; { 'uf32' = cmSigU16Fixed16Type }
  513. reserved: UInt32; { fill with 0x00 }
  514. value: array [0..0] of UInt32; { variable size, determined by tag element size }
  515. end;
  516. CMUInt8ArrayTypePtr = ^CMUInt8ArrayType;
  517. CMUInt8ArrayType = record
  518. typeDescriptor: OSType; { 'ui08' = cmSigUInt8Type }
  519. reserved: UInt32; { fill with 0x00 }
  520. value: SInt8; { variable size, determined by tag element size }
  521. end;
  522. CMUInt16ArrayTypePtr = ^CMUInt16ArrayType;
  523. CMUInt16ArrayType = record
  524. typeDescriptor: OSType; { 'ui16' = cmSigUInt16Type }
  525. reserved: UInt32; { fill with 0x00 }
  526. value: array [0..0] of UInt16; { variable size, determined by tag element size }
  527. end;
  528. CMUInt32ArrayTypePtr = ^CMUInt32ArrayType;
  529. CMUInt32ArrayType = record
  530. typeDescriptor: OSType; { 'ui32' = cmSigUInt32Type }
  531. reserved: UInt32; { fill with 0x00 }
  532. value: array [0..0] of UInt32; { variable size, determined by tag element size }
  533. end;
  534. CMUInt64ArrayTypePtr = ^CMUInt64ArrayType;
  535. CMUInt64ArrayType = record
  536. typeDescriptor: OSType; { 'ui64' = cmSigUInt64Type }
  537. reserved: UInt32; { fill with 0x00 }
  538. value: array [0..0] of UInt32; { variable size, determined by tag element size }
  539. end;
  540. CMViewingConditionsTypePtr = ^CMViewingConditionsType;
  541. CMViewingConditionsType = record
  542. typeDescriptor: OSType; { 'view' = cmSigViewingConditionsType }
  543. reserved: UInt32; { fill with 0x00 }
  544. illuminant: CMFixedXYZColor; { absolute XYZs of illuminant in cd/m^2 }
  545. surround: CMFixedXYZColor; { absolute XYZs of surround in cd/m^2 }
  546. stdIlluminant: UInt32; { see definitions of std illuminants }
  547. end;
  548. CMXYZTypePtr = ^CMXYZType;
  549. CMXYZType = record
  550. typeDescriptor: OSType; { 'XYZ ' = cmSigXYZType }
  551. reserved: UInt32; { fill with 0x00 }
  552. XYZ: array [0..0] of CMFixedXYZColor; { variable size, determined by tag element size }
  553. end;
  554. CMProfileSequenceDescTypePtr = ^CMProfileSequenceDescType;
  555. CMProfileSequenceDescType = record
  556. typeDescriptor: OSType; { 'pseq' = cmProfileSequenceDescTag }
  557. reserved: UInt32; { fill with 0x00 }
  558. count: UInt32; { Number of descriptions }
  559. data: SInt8; { variable size data explained in ICC spec }
  560. end;
  561. CMUcrBgTypePtr = ^CMUcrBgType;
  562. CMUcrBgType = record
  563. typeDescriptor: OSType; { 'bfd ' = cmSigUcrBgType }
  564. reserved: UInt32; { fill with 0x00 }
  565. ucrCount: UInt32; { Number of UCR entries }
  566. ucrValues: array [0..0] of UInt16; { variable size, determined by ucrCount }
  567. end;
  568. { Private Tag Type Definitions }
  569. CMIntentCRDVMSizePtr = ^CMIntentCRDVMSize;
  570. CMIntentCRDVMSize = record
  571. renderingIntent: SInt32; { rendering intent }
  572. VMSize: UInt32; { VM size taken up by the CRD }
  573. end;
  574. CMPS2CRDVMSizeTypePtr = ^CMPS2CRDVMSizeType;
  575. CMPS2CRDVMSizeType = record
  576. typeDescriptor: OSType; { 'psvm' = cmSigPS2CRDVMSizeType }
  577. reserved: UInt32; { fill with 0x00 }
  578. count: UInt32; { number of intent entries }
  579. intentCRD: array [0..0] of CMIntentCRDVMSize; { variable size, determined by count }
  580. end;
  581. const
  582. cmVideoCardGammaTableType = 0;
  583. cmVideoCardGammaFormulaType = 1;
  584. type
  585. CMVideoCardGammaTablePtr = ^CMVideoCardGammaTable;
  586. CMVideoCardGammaTable = record
  587. channels: UInt16; { # of gamma channels (1 or 3) }
  588. entryCount: UInt16; { 1-based number of entries per channel }
  589. entrySize: UInt16; { size in bytes of each entry }
  590. data: SInt8; { variable size, determined by channels*entryCount*entrySize }
  591. end;
  592. CMVideoCardGammaFormulaPtr = ^CMVideoCardGammaFormula;
  593. CMVideoCardGammaFormula = record
  594. redGamma: Fixed; { must be > 0.0 }
  595. redMin: Fixed; { must be > 0.0 and < 1.0 }
  596. redMax: Fixed; { must be > 0.0 and < 1.0 }
  597. greenGamma: Fixed; { must be > 0.0 }
  598. greenMin: Fixed; { must be > 0.0 and < 1.0 }
  599. greenMax: Fixed; { must be > 0.0 and < 1.0 }
  600. blueGamma: Fixed; { must be > 0.0 }
  601. blueMin: Fixed; { must be > 0.0 and < 1.0 }
  602. blueMax: Fixed; { must be > 0.0 and < 1.0 }
  603. end;
  604. CMVideoCardGammaPtr = ^CMVideoCardGamma;
  605. CMVideoCardGamma = record
  606. tagType: UInt32;
  607. case SInt16 of
  608. 0: (
  609. table: CMVideoCardGammaTable;
  610. );
  611. 1: (
  612. formula: CMVideoCardGammaFormula;
  613. );
  614. end;
  615. CMVideoCardGammaTypePtr = ^CMVideoCardGammaType;
  616. CMVideoCardGammaType = record
  617. typeDescriptor: OSType; { 'vcgt' = cmSigVideoCardGammaType }
  618. reserved: UInt32; { fill with 0x00 }
  619. gamma: CMVideoCardGamma;
  620. end;
  621. CMMakeAndModelPtr = ^CMMakeAndModel;
  622. CMMakeAndModel = record
  623. manufacturer: OSType;
  624. model: UInt32;
  625. serialNumber: UInt32;
  626. manufactureDate: UInt32;
  627. reserved1: UInt32; { fill with 0x00 }
  628. reserved2: UInt32; { fill with 0x00 }
  629. reserved3: UInt32; { fill with 0x00 }
  630. reserved4: UInt32; { fill with 0x00 }
  631. end;
  632. CMMakeAndModelTypePtr = ^CMMakeAndModelType;
  633. CMMakeAndModelType = record
  634. typeDescriptor: OSType; { 'mmod' = cmSigMakeAndModelType }
  635. reserved: UInt32; { fill with 0x00 }
  636. makeAndModel: CMMakeAndModel;
  637. end;
  638. CMMultiLocalizedUniCodeEntryRecPtr = ^CMMultiLocalizedUniCodeEntryRec;
  639. CMMultiLocalizedUniCodeEntryRec = record
  640. languageCode: packed array [0..1] of char; { language code from ISO-639 }
  641. regionCode: packed array [0..1] of char; { region code from ISO-3166 }
  642. textLength: UInt32; { the length in bytes of the string }
  643. textOffset: UInt32; { the offset from the start of tag in bytes }
  644. end;
  645. CMMultiLocalizedUniCodeTypePtr = ^CMMultiLocalizedUniCodeType;
  646. CMMultiLocalizedUniCodeType = record
  647. typeDescriptor: OSType; { 'mluc' = cmSigMultiLocalizedUniCodeType }
  648. reserved: UInt32; { fill with 0x00 }
  649. entryCount: UInt32; { 1-based number of name records that follow }
  650. entrySize: UInt32; { size in bytes of name records that follow }
  651. { variable-length data for storage of CMMultiLocalizedUniCodeEntryRec }
  652. { variable-length data for storage of Unicode strings }
  653. end;
  654. { ********************************************************************** }
  655. { ************** ColorSync 1.0 profile specification ******************* }
  656. { ********************************************************************** }
  657. const
  658. cmGrayResponse = 0;
  659. cmRedResponse = 1;
  660. cmGreenResponse = 2;
  661. cmBlueResponse = 3;
  662. cmCyanResponse = 4;
  663. cmMagentaResponse = 5;
  664. cmYellowResponse = 6;
  665. cmUcrResponse = 7;
  666. cmBgResponse = 8;
  667. cmOnePlusLastResponse = 9;
  668. { Device types }
  669. cmMonitorDevice = $6D6E7472 (* 'mntr' *);
  670. cmScannerDevice = $73636E72 (* 'scnr' *);
  671. cmPrinterDevice = $70727472 (* 'prtr' *);
  672. type
  673. CMIStringPtr = ^CMIString;
  674. CMIString = record
  675. theScript: ScriptCode;
  676. theString: Str63;
  677. end;
  678. { Profile options }
  679. const
  680. cmPerceptualMatch = $0000; { Default. For photographic images }
  681. cmColorimetricMatch = $0001; { Exact matching when possible }
  682. cmSaturationMatch = $0002; { For solid colors }
  683. { Profile flags }
  684. cmNativeMatchingPreferred = $00000001; { Default to native not preferred }
  685. cmTurnOffCache = $00000002; { Default to turn on CMM cache }
  686. type
  687. CMMatchOption = SInt32;
  688. CMMatchFlag = SInt32;
  689. CMHeaderPtr = ^CMHeader;
  690. CMHeader = record
  691. size: UInt32;
  692. CMMType: OSType;
  693. applProfileVersion: UInt32;
  694. dataType: OSType;
  695. deviceType: OSType;
  696. deviceManufacturer: OSType;
  697. deviceModel: UInt32;
  698. deviceAttributes: array [0..1] of UInt32;
  699. profileNameOffset: UInt32;
  700. customDataOffset: UInt32;
  701. flags: CMMatchFlag;
  702. options: CMMatchOption;
  703. white: CMXYZColor;
  704. black: CMXYZColor;
  705. end;
  706. CMProfileChromaticitiesPtr = ^CMProfileChromaticities;
  707. CMProfileChromaticities = record
  708. red: CMXYZColor;
  709. green: CMXYZColor;
  710. blue: CMXYZColor;
  711. cyan: CMXYZColor;
  712. magenta: CMXYZColor;
  713. yellow: CMXYZColor;
  714. end;
  715. CMProfileResponsePtr = ^CMProfileResponse;
  716. CMProfileResponse = record
  717. counts: array [0..8] of UInt16;
  718. data: array [0..0] of UInt16; { Variable size }
  719. end;
  720. CMProfilePtr = ^CMProfile;
  721. CMProfile = record
  722. header: CMHeader;
  723. profile: CMProfileChromaticities;
  724. response: CMProfileResponse;
  725. profileName: CMIString;
  726. customData: SInt8; { Variable size }
  727. end;
  728. CMProfileHandle = ^CMProfilePtr;
  729. {$ifc OLDROUTINENAMES}
  730. const
  731. kCMApplProfileVersion = $00000100;
  732. grayResponse = 0;
  733. redResponse = 1;
  734. greenResponse = 2;
  735. blueResponse = 3;
  736. cyanResponse = 4;
  737. magentaResponse = 5;
  738. yellowResponse = 6;
  739. ucrResponse = 7;
  740. bgResponse = 8;
  741. onePlusLastResponse = 9;
  742. rgbData = $52474220 (* 'RGB ' *);
  743. cmykData = $434D594B (* 'CMYK' *);
  744. grayData = $47524159 (* 'GRAY' *);
  745. xyzData = $58595A20 (* 'XYZ ' *);
  746. monitorDevice = $6D6E7472 (* 'mntr' *);
  747. scannerDevice = $73636E72 (* 'scnr' *);
  748. printerDevice = $70727472 (* 'prtr' *);
  749. type
  750. XYZComponent = UInt16;
  751. XYZColor = CMXYZColor;
  752. XYZColorPtr = ^XYZColor;
  753. CMResponseData = UInt16;
  754. IString = CMIString;
  755. IStringPtr = ^IString;
  756. CMResponseColor = SInt32;
  757. responseColor = CMResponseColor;
  758. {$endc} {OLDROUTINENAMES}
  759. {$ALIGN MAC68K}
  760. end.