mesa: simplify dependencies in mmakefiles
[AROS.git] / workbench / libs / lcms2 / utils / delphi / lcms2dll.pas
blob1c2d674c45929b0a78bc70ae9b8509950da3745e
1 //
2 // Little cms DELPHI wrapper
3 //---------------------------------------------------------------------------------
4 //
5 // Little Color Management System
6 // Copyright (c) 1998-2010 Marti Maria Saguer
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining
9 // a copy of this software and associated documentation files (the "Software"),
10 // to deal in the Software without restriction, including without limitation
11 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 // and/or sell copies of the Software, and to permit persons to whom the Software
13 // is furnished to do so, subject to the following conditions:
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
20 // THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 //---------------------------------------------------------------------------------
28 // Version 2.1
31 UNIT lcms2dll;
33 INTERFACE
35 USES Windows;
37 TYPE
39 Uint8 = Byte;
40 Int8 = Shortint;
41 UInt16 = Word;
42 Int16 = Smallint;
43 UInt32 = LongWord;
44 Int32 = Longint;
46 TYPE
47 cmsUInt8Number = Uint8;
48 cmsInt8Number = Int8;
49 cmsUInt16Number = UInt16;
50 cmsInt16Number = Int16;
52 cmsUInt32Number = UInt32;
53 cmsInt32Number = Int32;
54 cmsInt64Number = Int64;
55 cmsUInt64Number = UInt64;
57 cmsFloat32Number = Single;
58 cmsFloat64Number = Double;
60 LPcmsUInt8Number = ^cmsUInt8Number;
61 LPcmsInt8Number = ^cmsInt8Number;
62 LPcmsUInt16Number = ^cmsUInt16Number;
63 LPcmsInt16Number = ^cmsInt16Number;
65 LPcmsUInt32Number = ^cmsUInt32Number;
66 LPcmsInt32Number = ^cmsInt32Number;
67 LPcmsInt64Number = ^cmsInt64Number;
68 LPcmsUInt64Number = ^cmsUInt64Number;
70 LPcmsFloat32Number = ^cmsFloat32Number;
71 LPcmsFloat64Number = ^cmsFloat64Number;
74 // Derivative types
75 cmsSignature = cmsUInt32Number;
76 cmsU8Fixed8Number = cmsUInt16Number;
77 cmsS15Fixed16Number = cmsInt32Number;
78 cmsU16Fixed16Number = cmsUInt32Number;
80 // Boolean type, which will be using the native integer
81 cmsBool = Boolean;
83 CONST
85 // Some common definitions
86 cmsMAX_PATH = 256;
88 // D50 XYZ normalized to Y=1.0
89 cmsD50X = 0.9642;
90 cmsD50Y = 1.0;
91 cmsD50Z = 0.8249;
93 // V4 perceptual black
94 cmsPERCEPTUAL_BLACK_X = 0.00336;
95 cmsPERCEPTUAL_BLACK_Y = 0.0034731;
96 cmsPERCEPTUAL_BLACK_Z = 0.00287;
98 // Definitions in ICC spec
99 cmsMagicNumber = $61637370; // 'acsp'
100 lcmsSignature = $6c636d73; // 'lcms'
103 TYPE
105 // Base ICC type definitions
106 cmsTagTypeSignature = (
107 cmsSigChromaticityType = $6368726D, // 'chrm'
108 cmsSigColorantOrderType = $636C726F, // 'clro'
109 cmsSigColorantTableType = $636C7274, // 'clrt'
110 cmsSigCrdInfoType = $63726469, // 'crdi'
111 cmsSigCurveType = $63757276, // 'curv'
112 cmsSigDataType = $64617461, // 'data'
113 cmsSigDictType = $64696374, // 'dict'
114 cmsSigDateTimeType = $6474696D, // 'dtim'
115 cmsSigDeviceSettingsType = $64657673, // 'devs'
116 cmsSigLut16Type = $6d667432, // 'mft2'
117 cmsSigLut8Type = $6d667431, // 'mft1'
118 cmsSigLutAtoBType = $6d414220, // 'mAB '
119 cmsSigLutBtoAType = $6d424120, // 'mBA '
120 cmsSigMeasurementType = $6D656173, // 'meas'
121 cmsSigMultiLocalizedUnicodeType = $6D6C7563, // 'mluc'
122 cmsSigMultiProcessElementType = $6D706574, // 'mpet'
123 cmsSigNamedColorType = $6E636f6C, // 'ncol' -- DEPRECATED!
124 cmsSigNamedColor2Type = $6E636C32, // 'ncl2'
125 cmsSigParametricCurveType = $70617261, // 'para'
126 cmsSigProfileSequenceDescType = $70736571, // 'pseq'
127 cmsSigProfileSequenceIdType = $70736964, // 'psid'
128 cmsSigResponseCurveSet16Type = $72637332, // 'rcs2'
129 cmsSigS15Fixed16ArrayType = $73663332, // 'sf32'
130 cmsSigScreeningType = $7363726E, // 'scrn'
131 cmsSigSignatureType = $73696720, // 'sig '
132 cmsSigTextType = $74657874, // 'text'
133 cmsSigTextDescriptionType = $64657363, // 'desc'
134 cmsSigU16Fixed16ArrayType = $75663332, // 'uf32'
135 cmsSigUcrBgType = $62666420, // 'bfd '
136 cmsSigUInt16ArrayType = $75693136, // 'ui16'
137 cmsSigUInt32ArrayType = $75693332, // 'ui32'
138 cmsSigUInt64ArrayType = $75693634, // 'ui64'
139 cmsSigUInt8ArrayType = $75693038, // 'ui08'
140 cmsSigViewingConditionsType = $76696577, // 'view'
141 cmsSigXYZType = $58595A20, // 'XYZ '
142 cmsSigVcgtType = $76636774 // 'vcgt'
145 // Base ICC tag definitions
146 cmsTagSignature = (
147 cmsSigAToB0Tag = $41324230, // 'A2B0'
148 cmsSigAToB1Tag = $41324231, // 'A2B1'
149 cmsSigAToB2Tag = $41324232, // 'A2B2'
150 cmsSigBlueColorantTag = $6258595A, // 'bXYZ'
151 cmsSigBlueMatrixColumnTag = $6258595A, // 'bXYZ'
152 cmsSigBlueTRCTag = $62545243, // 'bTRC'
153 cmsSigBToA0Tag = $42324130, // 'B2A0'
154 cmsSigBToA1Tag = $42324131, // 'B2A1'
155 cmsSigBToA2Tag = $42324132, // 'B2A2'
156 cmsSigCalibrationDateTimeTag = $63616C74, // 'calt'
157 cmsSigCharTargetTag = $74617267, // 'targ'
158 cmsSigChromaticAdaptationTag = $63686164, // 'chad'
159 cmsSigChromaticityTag = $6368726D, // 'chrm'
160 cmsSigColorantOrderTag = $636C726F, // 'clro'
161 cmsSigColorantTableTag = $636C7274, // 'clrt'
162 cmsSigColorantTableOutTag = $636C6F74, // 'clot'
163 cmsSigColorimetricIntentImageStateTag = $63696973, // 'ciis'
164 cmsSigCopyrightTag = $63707274, // 'cprt'
165 cmsSigCrdInfoTag = $63726469, // 'crdi'
166 cmsSigDataTag = $64617461, // 'data'
167 cmsSigDateTimeTag = $6474696D, // 'dtim'
168 cmsSigDeviceMfgDescTag = $646D6E64, // 'dmnd'
169 cmsSigDeviceModelDescTag = $646D6464, // 'dmdd'
170 cmsSigDeviceSettingsTag = $64657673, // 'devs'
171 cmsSigDToB0Tag = $44324230, // 'D2B0'
172 cmsSigDToB1Tag = $44324231, // 'D2B1'
173 cmsSigDToB2Tag = $44324232, // 'D2B2'
174 cmsSigDToB3Tag = $44324233, // 'D2B3'
175 cmsSigBToD0Tag = $42324430, // 'B2D0'
176 cmsSigBToD1Tag = $42324431, // 'B2D1'
177 cmsSigBToD2Tag = $42324432, // 'B2D2'
178 cmsSigBToD3Tag = $42324433, // 'B2D3'
179 cmsSigGamutTag = $67616D74, // 'gamt'
180 cmsSigGrayTRCTag = $6b545243, // 'kTRC'
181 cmsSigGreenColorantTag = $6758595A, // 'gXYZ'
182 cmsSigGreenMatrixColumnTag = $6758595A, // 'gXYZ'
183 cmsSigGreenTRCTag = $67545243, // 'gTRC'
184 cmsSigLuminanceTag = $6C756d69, // 'lumi'
185 cmsSigMeasurementTag = $6D656173, // 'meas'
186 cmsSigMediaBlackPointTag = $626B7074, // 'bkpt'
187 cmsSigMediaWhitePointTag = $77747074, // 'wtpt'
188 cmsSigNamedColorTag = $6E636f6C, // 'ncol' // Deprecated by the ICC
189 cmsSigNamedColor2Tag = $6E636C32, // 'ncl2'
190 cmsSigOutputResponseTag = $72657370, // 'resp'
191 cmsSigPerceptualRenderingIntentGamutTag = $72696730, // 'rig0'
192 cmsSigPreview0Tag = $70726530, // 'pre0'
193 cmsSigPreview1Tag = $70726531, // 'pre1'
194 cmsSigPreview2Tag = $70726532, // 'pre2'
195 cmsSigProfileDescriptionTag = $64657363, // 'desc'
196 cmsSigProfileSequenceDescTag = $70736571, // 'pseq'
197 cmsSigProfileSequenceIdTag = $70736964, // 'psid'
198 cmsSigPs2CRD0Tag = $70736430, // 'psd0'
199 cmsSigPs2CRD1Tag = $70736431, // 'psd1'
200 cmsSigPs2CRD2Tag = $70736432, // 'psd2'
201 cmsSigPs2CRD3Tag = $70736433, // 'psd3'
202 cmsSigPs2CSATag = $70733273, // 'ps2s'
203 cmsSigPs2RenderingIntentTag = $70733269, // 'ps2i'
204 cmsSigRedColorantTag = $7258595A, // 'rXYZ'
205 cmsSigRedMatrixColumnTag = $7258595A, // 'rXYZ'
206 cmsSigRedTRCTag = $72545243, // 'rTRC'
207 cmsSigSaturationRenderingIntentGamutTag = $72696732, // 'rig2'
208 cmsSigScreeningDescTag = $73637264, // 'scrd'
209 cmsSigScreeningTag = $7363726E, // 'scrn'
210 cmsSigTechnologyTag = $74656368, // 'tech'
211 cmsSigUcrBgTag = $62666420, // 'bfd '
212 cmsSigViewingCondDescTag = $76756564, // 'vued'
213 cmsSigViewingConditionsTag = $76696577, // 'view'
214 cmsSigVcgtTag = $76636774, // 'vcgt'
215 cmsSigMetaTag = $6D657461 // 'meta'
218 // ICC Technology tag
219 cmsTechnologySignature = (
220 cmsSigDigitalCamera = $6463616D, // 'dcam'
221 cmsSigFilmScanner = $6673636E, // 'fscn'
222 cmsSigReflectiveScanner = $7273636E, // 'rscn'
223 cmsSigInkJetPrinter = $696A6574, // 'ijet'
224 cmsSigThermalWaxPrinter = $74776178, // 'twax'
225 cmsSigElectrophotographicPrinter = $6570686F, // 'epho'
226 cmsSigElectrostaticPrinter = $65737461, // 'esta'
227 cmsSigDyeSublimationPrinter = $64737562, // 'dsub'
228 cmsSigPhotographicPaperPrinter = $7270686F, // 'rpho'
229 cmsSigFilmWriter = $6670726E, // 'fprn'
230 cmsSigVideoMonitor = $7669646D, // 'vidm'
231 cmsSigVideoCamera = $76696463, // 'vidc'
232 cmsSigProjectionTelevision = $706A7476, // 'pjtv'
233 cmsSigCRTDisplay = $43525420, // 'CRT '
234 cmsSigPMDisplay = $504D4420, // 'PMD '
235 cmsSigAMDisplay = $414D4420, // 'AMD '
236 cmsSigPhotoCD = $4B504344, // 'KPCD'
237 cmsSigPhotoImageSetter = $696D6773, // 'imgs'
238 cmsSigGravure = $67726176, // 'grav'
239 cmsSigOffsetLithography = $6F666673, // 'offs'
240 cmsSigSilkscreen = $73696C6B, // 'silk'
241 cmsSigFlexography = $666C6578, // 'flex'
242 cmsSigMotionPictureFilmScanner = $6D706673, // 'mpfs'
243 cmsSigMotionPictureFilmRecorder = $6D706672, // 'mpfr'
244 cmsSigDigitalMotionPictureCamera = $646D7063, // 'dmpc'
245 cmsSigDigitalCinemaProjector = $64636A70 // 'dcpj'
249 // ICC Color spaces
250 cmsColorSpaceSignature = (
251 cmsSigXYZData = $58595A20, // 'XYZ '
252 cmsSigLabData = $4C616220, // 'Lab '
253 cmsSigLuvData = $4C757620, // 'Luv '
254 cmsSigYCbCrData = $59436272, // 'YCbr'
255 cmsSigYxyData = $59787920, // 'Yxy '
256 cmsSigRgbData = $52474220, // 'RGB '
257 cmsSigGrayData = $47524159, // 'GRAY'
258 cmsSigHsvData = $48535620, // 'HSV '
259 cmsSigHlsData = $484C5320, // 'HLS '
260 cmsSigCmykData = $434D594B, // 'CMYK'
261 cmsSigCmyData = $434D5920, // 'CMY '
262 cmsSigMCH1Data = $4D434831, // 'MCH1'
263 cmsSigMCH2Data = $4D434832, // 'MCH2'
264 cmsSigMCH3Data = $4D434833, // 'MCH3'
265 cmsSigMCH4Data = $4D434834, // 'MCH4'
266 cmsSigMCH5Data = $4D434835, // 'MCH5'
267 cmsSigMCH6Data = $4D434836, // 'MCH6'
268 cmsSigMCH7Data = $4D434837, // 'MCH7'
269 cmsSigMCH8Data = $4D434838, // 'MCH8'
270 cmsSigMCH9Data = $4D434839, // 'MCH9'
271 cmsSigMCHAData = $4D43483A, // 'MCHA'
272 cmsSigMCHBData = $4D43483B, // 'MCHB'
273 cmsSigMCHCData = $4D43483C, // 'MCHC'
274 cmsSigMCHDData = $4D43483D, // 'MCHD'
275 cmsSigMCHEData = $4D43483E, // 'MCHE'
276 cmsSigMCHFData = $4D43483F, // 'MCHF'
277 cmsSigNamedData = $6e6d636c, // 'nmcl'
278 cmsSig1colorData = $31434C52, // '1CLR'
279 cmsSig2colorData = $32434C52, // '2CLR'
280 cmsSig3colorData = $33434C52, // '3CLR'
281 cmsSig4colorData = $34434C52, // '4CLR'
282 cmsSig5colorData = $35434C52, // '5CLR'
283 cmsSig6colorData = $36434C52, // '6CLR'
284 cmsSig7colorData = $37434C52, // '7CLR'
285 cmsSig8colorData = $38434C52, // '8CLR'
286 cmsSig9colorData = $39434C52, // '9CLR'
287 cmsSig10colorData = $41434C52, // 'ACLR'
288 cmsSig11colorData = $42434C52, // 'BCLR'
289 cmsSig12colorData = $43434C52, // 'CCLR'
290 cmsSig13colorData = $44434C52, // 'DCLR'
291 cmsSig14colorData = $45434C52, // 'ECLR'
292 cmsSig15colorData = $46434C52, // 'FCLR'
293 cmsSigLuvKData = $4C75764B // 'LuvK'
296 // ICC Profile Class
297 cmsProfileClassSignature = (
298 cmsSigInputClass = $73636E72, // 'scnr'
299 cmsSigDisplayClass = $6D6E7472, // 'mntr'
300 cmsSigOutputClass = $70727472, // 'prtr'
301 cmsSigLinkClass = $6C696E6B, // 'link'
302 cmsSigAbstractClass = $61627374, // 'abst'
303 cmsSigColorSpaceClass = $73706163, // 'spac'
304 cmsSigNamedColorClass = $6e6d636c // 'nmcl'
308 // ICC Platforms
309 cmsPlatformSignature = (
310 cmsSigMacintosh = $4150504C, // 'APPL'
311 cmsSigMicrosoft = $4D534654, // 'MSFT'
312 cmsSigSolaris = $53554E57, // 'SUNW'
313 cmsSigSGI = $53474920, // 'SGI '
314 cmsSigTaligent = $54474E54, // 'TGNT'
315 cmsSigUnices = $2A6E6978 // '*nix' // From argyll -- Not official
318 CONST
320 // Reference gamut
321 cmsSigPerceptualReferenceMediumGamut = $70726d67; //'prmg'
323 // For cmsSigColorimetricIntentImageStateTag
324 cmsSigSceneColorimetryEstimates = $73636F65; //'scoe'
325 cmsSigSceneAppearanceEstimates = $73617065; //'sape'
326 cmsSigFocalPlaneColorimetryEstimates = $66706365; //'fpce'
327 cmsSigReflectionHardcopyOriginalColorimetry = $72686F63; //'rhoc'
328 cmsSigReflectionPrintOutputColorimetry = $72706F63; //'rpoc'
330 TYPE
332 // Multi process elements types
333 cmsStageSignature = (
334 cmsSigCurveSetElemType = $63767374, //'cvst'
335 cmsSigMatrixElemType = $6D617466, //'matf'
336 cmsSigCLutElemType = $636C7574, //'clut'
338 cmsSigBAcsElemType = $62414353, // 'bACS'
339 cmsSigEAcsElemType = $65414353, // 'eACS'
341 // Custom from here, not in the ICC Spec
342 cmsSigXYZ2LabElemType = $6C327820, // 'l2x '
343 cmsSigLab2XYZElemType = $78326C20, // 'x2l '
344 cmsSigNamedColorElemType = $6E636C20, // 'ncl '
345 cmsSigLabV2toV4 = $32203420, // '2 4 '
346 cmsSigLabV4toV2 = $34203220, // '4 2 '
348 // Identities
349 cmsSigIdentityElemType = $69646E20 // 'idn '
352 // Types of CurveElements
353 cmsCurveSegSignature = (
355 cmsSigFormulaCurveSeg = $70617266, // 'parf'
356 cmsSigSampledCurveSeg = $73616D66, // 'samf'
357 cmsSigSegmentedCurve = $63757266 // 'curf'
360 CONST
362 // Used in ResponseCurveType
363 cmsSigStatusA = $53746141; //'StaA'
364 cmsSigStatusE = $53746145; //'StaE'
365 cmsSigStatusI = $53746149; //'StaI'
366 cmsSigStatusT = $53746154; //'StaT'
367 cmsSigStatusM = $5374614D; //'StaM'
368 cmsSigDN = $444E2020; //'DN '
369 cmsSigDNP = $444E2050; //'DN P'
370 cmsSigDNN = $444E4E20; //'DNN '
371 cmsSigDNNP = $444E4E50; //'DNNP'
373 // Device attributes, currently defined values correspond to the low 4 bytes
374 // of the 8 byte attribute quantity
375 cmsReflective = 0;
376 cmsTransparency = 1;
377 cmsGlossy = 0;
378 cmsMatte = 2;
380 TYPE
382 // Common structures in ICC tags
383 cmsICCData = PACKED RECORD
384 len : cmsUInt32Number;
385 flag : cmsUInt32Number;
386 data : Array [0..1] of cmsUInt8Number;
387 END;
389 // ICC date time
390 cmsDateTimeNumber = PACKED RECORD
391 year: cmsUInt16Number;
392 month: cmsUInt16Number;
393 day: cmsUInt16Number;
394 hours: cmsUInt16Number;
395 minutes: cmsUInt16Number;
396 seconds: cmsUInt16Number;
397 END;
399 // ICC XYZ
401 cmsEncodedXYZNumber = PACKED RECORD
402 X: cmsS15Fixed16Number;
403 Y: cmsS15Fixed16Number;
404 Z: cmsS15Fixed16Number;
405 END;
408 // Profile ID as computed by MD5 algorithm
409 cmsProfileID = PACKED RECORD
410 CASE Integer OF
411 1: (ID8: Array[0..15] OF cmsUInt8Number);
412 2: (ID16: Array[0..7] OF cmsUInt16Number);
413 3: (ID32: Array[0..3] OF cmsUInt32Number);
414 END;
418 // ----------------------------------------------------------------------------------------------
419 // ICC profile internal base types. Strictly, shouldn't be declared in this unit, but maybe
420 // somebody want to use this info for accessing profile header directly, so here it is.
422 // Profile header -- it is 32-bit aligned, so no issues are expected on alignment
423 cmsICCHeader = PACKED RECORD
424 size: cmsUInt32Number; // Profile size in bytes
425 cmmId: cmsSignature; // CMM for this profile
426 version: cmsUInt32Number; // Format version number
427 deviceClass: cmsProfileClassSignature; // Type of profile
428 colorSpace: cmsColorSpaceSignature; // Color space of data
429 pcs: cmsColorSpaceSignature; // PCS, XYZ or Lab only
430 date: cmsDateTimeNumber; // Date profile was created
431 magic: cmsSignature; // Magic Number to identify an ICC profile
432 platform: cmsPlatformSignature; // Primary Platform
433 flags: cmsUInt32Number; // Various bit settings
434 manufacturer: cmsSignature; // Device manufacturer
435 model: cmsUInt32Number; // Device model number
436 attributes: cmsUInt64Number; // Device attributes
437 renderingIntent:cmsUInt32Number; // Rendering intent
438 illuminant: cmsEncodedXYZNumber; // Profile illuminant
439 creator: cmsSignature; // Profile creator
440 profileID: cmsProfileID; // Profile ID using MD5
441 reserved: array [0..27] of cmsInt8Number; // Reserved for future use
442 END;
444 // ICC base tag
445 cmsTagBase = PACKED RECORD
446 sig: cmsTagTypeSignature;
447 reserved: array[0..3] of cmsInt8Number;
448 END;
450 // A tag entry in directory
451 cmsTagEntry = PACKED RECORD
452 sig: cmsTagSignature; // The tag signature
453 offset: cmsUInt32Number; // Start of tag
454 size: cmsUInt32Number; // Size in bytes
455 END;
458 cmsContext = Pointer; // Context identifier for multithreaded environments
459 cmsHANDLE = Pointer; // Generic handle
460 cmsHPROFILE = Pointer; // Opaque typedefs to hide internals
461 cmsHTRANSFORM = Pointer;
464 CONST
466 cmsMAXCHANNELS = 16; // Maximum number of channels in ICC profiles
468 // Format of pixel is defined by one cmsUInt32Number, using bit fields as follows
470 // A O TTTTT U Y F P X S EEE CCCC BBB
472 // A: Floating point -- With this flag we can differentiate 16 bits as float and as int
473 // O: Optimized -- previous optimization already returns the final 8-bit value
474 // T: Pixeltype
475 // F: Flavor 0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)
476 // P: Planar? 0=Chunky, 1=Planar
477 // X: swap 16 bps endianess?
478 // S: Do swap? ie, BGR, KYMC
479 // E: Extra samples
480 // C: Channels (Samples per pixel)
481 // B: bytes per sample
482 // Y: Swap first - changes ABGR to BGRA and KCMY to CMYK
484 FUNCTION FLOAT_SH(a: cmsUInt32Number): cmsUInt32Number;
485 FUNCTION OPTIMIZED_SH(s: cmsUInt32Number): cmsUInt32Number;
486 FUNCTION COLORSPACE_SH(s: cmsUInt32Number):cmsUInt32Number;
487 FUNCTION SWAPFIRST_SH(s: cmsUInt32Number):cmsUInt32Number;
488 FUNCTION FLAVOR_SH(s: cmsUInt32Number):cmsUInt32Number;
489 FUNCTION PLANAR_SH(p: cmsUInt32Number):cmsUInt32Number;
490 FUNCTION ENDIAN16_SH(e: cmsUInt32Number):cmsUInt32Number;
491 FUNCTION DOSWAP_SH(e: cmsUInt32Number):cmsUInt32Number;
492 FUNCTION EXTRA_SH(e: cmsUInt32Number):cmsUInt32Number;
493 FUNCTION CHANNELS_SH(c: cmsUInt32Number):cmsUInt32Number;
494 FUNCTION BYTES_SH(b: cmsUInt32Number):cmsUInt32Number;
497 FUNCTION T_FLOAT(a: cmsUInt32Number): cmsUInt32Number;
498 FUNCTION T_OPTIMIZED(o: cmsUInt32Number): cmsUInt32Number;
499 FUNCTION T_COLORSPACE(s: cmsUInt32Number): cmsUInt32Number;
500 FUNCTION T_SWAPFIRST(s: cmsUInt32Number): cmsUInt32Number;
501 FUNCTION T_FLAVOR(s: cmsUInt32Number): cmsUInt32Number;
502 FUNCTION T_PLANAR(p: cmsUInt32Number): cmsUInt32Number;
503 FUNCTION T_ENDIAN16(e: cmsUInt32Number): cmsUInt32Number;
504 FUNCTION T_DOSWAP(e: cmsUInt32Number): cmsUInt32Number;
505 FUNCTION T_EXTRA(e: cmsUInt32Number): cmsUInt32Number;
506 FUNCTION T_CHANNELS(c: cmsUInt32Number): cmsUInt32Number;
507 FUNCTION T_BYTES(b: cmsUInt32Number): cmsUInt32Number;
509 CONST
512 // Pixel types
514 PT_ANY = 0; // Don't check colorspace
515 // 1 & 2 are reserved
516 PT_GRAY = 3;
517 PT_RGB = 4;
518 PT_CMY = 5;
519 PT_CMYK = 6;
520 PT_YCbCr = 7;
521 PT_YUV = 8; // Lu'v'
522 PT_XYZ = 9;
523 PT_Lab = 10;
524 PT_YUVK = 11; // Lu'v'K
525 PT_HSV = 12;
526 PT_HLS = 13;
527 PT_Yxy = 14;
529 PT_MCH1 = 15;
530 PT_MCH2 = 16;
531 PT_MCH3 = 17;
532 PT_MCH4 = 18;
533 PT_MCH5 = 19;
534 PT_MCH6 = 20;
535 PT_MCH7 = 21;
536 PT_MCH8 = 22;
537 PT_MCH9 = 23;
538 PT_MCH10 = 24;
539 PT_MCH11 = 25;
540 PT_MCH12 = 26;
541 PT_MCH13 = 27;
542 PT_MCH14 = 28;
543 PT_MCH15 = 29;
545 PT_LabV2 = 30; // Identical to PT_Lab, but using the V2 old encoding
548 // Format descriptors
549 TYPE_GRAY_8 = $030009;
550 TYPE_GRAY_8_REV = $032009;
551 TYPE_GRAY_16 = $03000a;
552 TYPE_GRAY_16_REV = $03200a;
553 TYPE_GRAY_16_SE = $03080a;
554 TYPE_GRAYA_8 = $030089;
555 TYPE_GRAYA_16 = $03008a;
556 TYPE_GRAYA_16_SE = $03088a;
557 TYPE_GRAYA_8_PLANAR = $031089;
558 TYPE_GRAYA_16_PLANAR = $03108a;
559 TYPE_RGB_8 = $040019;
560 TYPE_RGB_8_PLANAR = $041019;
561 TYPE_BGR_8 = $040419;
562 TYPE_BGR_8_PLANAR = $041419;
563 TYPE_RGB_16 = $04001a;
564 TYPE_RGB_16_PLANAR = $04101a;
565 TYPE_RGB_16_SE = $04081a;
566 TYPE_BGR_16 = $04041a;
567 TYPE_BGR_16_PLANAR = $04141a;
568 TYPE_BGR_16_SE = $040c1a;
569 TYPE_RGBA_8 = $040099;
570 TYPE_RGBA_8_PLANAR = $041099;
571 TYPE_RGBA_16 = $04009a;
572 TYPE_RGBA_16_PLANAR = $04109a;
573 TYPE_RGBA_16_SE = $04089a;
574 TYPE_ARGB_8 = $044099;
575 TYPE_ARGB_16 = $04409a;
576 TYPE_ABGR_8 = $040499;
577 TYPE_ABGR_16 = $04049a;
578 TYPE_ABGR_16_PLANAR = $04149a;
579 TYPE_ABGR_16_SE = $040c9a;
580 TYPE_BGRA_8 = $044499;
581 TYPE_BGRA_16 = $04449a;
582 TYPE_BGRA_16_SE = $04489a;
583 TYPE_CMY_8 = $050019;
584 TYPE_CMY_8_PLANAR = $051019;
585 TYPE_CMY_16 = $05001a;
586 TYPE_CMY_16_PLANAR = $05101a;
587 TYPE_CMY_16_SE = $05081a;
588 TYPE_CMYK_8 = $060021;
589 TYPE_CMYKA_8 = $0600a1;
590 TYPE_CMYK_8_REV = $062021;
591 TYPE_YUVK_8 = $062021;
592 TYPE_CMYK_8_PLANAR = $061021;
593 TYPE_CMYK_16 = $060022;
594 TYPE_CMYK_16_REV = $062022;
595 TYPE_YUVK_16 = $062022;
596 TYPE_CMYK_16_PLANAR = $061022;
597 TYPE_CMYK_16_SE = $060822;
598 TYPE_KYMC_8 = $060421;
599 TYPE_KYMC_16 = $060422;
600 TYPE_KYMC_16_SE = $060c22;
601 TYPE_KCMY_8 = $064021;
602 TYPE_KCMY_8_REV = $066021;
603 TYPE_KCMY_16 = $064022;
604 TYPE_KCMY_16_REV = $066022;
605 TYPE_KCMY_16_SE = $064822;
606 TYPE_CMYK5_8 = $130029;
607 TYPE_CMYK5_16 = $13002a;
608 TYPE_CMYK5_16_SE = $13082a;
609 TYPE_KYMC5_8 = $130429;
610 TYPE_KYMC5_16 = $13042a;
611 TYPE_KYMC5_16_SE = $130c2a;
612 TYPE_CMYK6_8 = $140031;
613 TYPE_CMYK6_8_PLANAR = $141031;
614 TYPE_CMYK6_16 = $140032;
615 TYPE_CMYK6_16_PLANAR = $141032;
616 TYPE_CMYK6_16_SE = $140832;
617 TYPE_CMYK7_8 = $150039;
618 TYPE_CMYK7_16 = $15003a;
619 TYPE_CMYK7_16_SE = $15083a;
620 TYPE_KYMC7_8 = $150439;
621 TYPE_KYMC7_16 = $15043a;
622 TYPE_KYMC7_16_SE = $150c3a;
623 TYPE_CMYK8_8 = $160041;
624 TYPE_CMYK8_16 = $160042;
625 TYPE_CMYK8_16_SE = $160842;
626 TYPE_KYMC8_8 = $160441;
627 TYPE_KYMC8_16 = $160442;
628 TYPE_KYMC8_16_SE = $160c42;
629 TYPE_CMYK9_8 = $170049;
630 TYPE_CMYK9_16 = $17004a;
631 TYPE_CMYK9_16_SE = $17084a;
632 TYPE_KYMC9_8 = $170449;
633 TYPE_KYMC9_16 = $17044a;
634 TYPE_KYMC9_16_SE = $170c4a;
635 TYPE_CMYK10_8 = $180051;
636 TYPE_CMYK10_16 = $180052;
637 TYPE_CMYK10_16_SE = $180852;
638 TYPE_KYMC10_8 = $180451;
639 TYPE_KYMC10_16 = $180452;
640 TYPE_KYMC10_16_SE = $180c52;
641 TYPE_CMYK11_8 = $190059;
642 TYPE_CMYK11_16 = $19005a;
643 TYPE_CMYK11_16_SE = $19085a;
644 TYPE_KYMC11_8 = $190459;
645 TYPE_KYMC11_16 = $19045a;
646 TYPE_KYMC11_16_SE = $190c5a;
647 TYPE_CMYK12_8 = $1a0061;
648 TYPE_CMYK12_16 = $1a0062;
649 TYPE_CMYK12_16_SE = $1a0862;
650 TYPE_KYMC12_8 = $1a0461;
651 TYPE_KYMC12_16 = $1a0462;
652 TYPE_KYMC12_16_SE = $1a0c62;
653 TYPE_XYZ_16 = $09001a;
654 TYPE_Lab_8 = $0a0019;
655 TYPE_ALab_8 = $0a0499;
656 TYPE_Lab_16 = $0a001a;
657 TYPE_Yxy_16 = $0e001a;
658 TYPE_YCbCr_8 = $070019;
659 TYPE_YCbCr_8_PLANAR = $071019;
660 TYPE_YCbCr_16 = $07001a;
661 TYPE_YCbCr_16_PLANAR = $07101a;
662 TYPE_YCbCr_16_SE = $07081a;
663 TYPE_YUV_8 = $080019;
664 TYPE_YUV_8_PLANAR = $081019;
665 TYPE_YUV_16 = $08001a;
666 TYPE_YUV_16_PLANAR = $08101a;
667 TYPE_YUV_16_SE = $08081a;
668 TYPE_HLS_8 = $0d0019;
669 TYPE_HLS_8_PLANAR = $0d1019;
670 TYPE_HLS_16 = $0d001a;
671 TYPE_HLS_16_PLANAR = $0d101a;
672 TYPE_HLS_16_SE = $0d081a;
673 TYPE_HSV_8 = $0c0019;
674 TYPE_HSV_8_PLANAR = $0c1019;
675 TYPE_HSV_16 = $0c001a;
676 TYPE_HSV_16_PLANAR = $0c101a;
677 TYPE_HSV_16_SE = $0c081a;
679 TYPE_NAMED_COLOR_INDEX = $000A;
681 TYPE_XYZ_FLT = $49001c;
682 TYPE_Lab_FLT = $4a001c;
683 TYPE_GRAY_FLT = $43000c;
684 TYPE_RGB_FLT = $44001c;
685 TYPE_CMYK_FLT = $460024;
686 TYPE_XYZA_FLT = $49009c;
687 TYPE_LabA_FLT = $4a009c;
688 TYPE_RGBA_FLT = $44009c;
689 TYPE_XYZ_DBL = $490018;
690 TYPE_Lab_DBL = $4a0018;
691 TYPE_GRAY_DBL = $430008;
692 TYPE_RGB_DBL = $440018;
693 TYPE_CMYK_DBL = $460020;
694 TYPE_LabV2_8 = $1e0019;
695 TYPE_ALabV2_8 = $1e0499;
696 TYPE_LabV2_16 = $1e001a;
699 TYPE
702 // Colorimetric spaces
704 cmsCIEXYZ = PACKED RECORD
705 X, Y, Z : cmsFloat64Number;
706 END;
707 LPcmsCIEXYZ = ^cmsCIEXYZ;
709 cmsCIExyY = PACKED RECORD
710 x, y, YY : cmsFloat64Number
711 END;
712 LPcmsCIExyY = ^cmsCIEXYY;
714 cmsCIELab = PACKED RECORD
715 L, a, b: cmsFloat64Number
716 END;
717 LPcmsCIELab = ^cmsCIELab;
719 cmsCIELCh = PACKED RECORD
720 L, C, h : cmsFloat64Number
721 END;
722 LPcmsCIELCh = ^cmsCIELCh;
724 cmsJCh = PACKED RECORD
725 J, C, h : cmsFloat64Number
726 END;
727 LPcmsJCh = ^cmsJCH;
730 cmsCIEXYZTRIPLE = PACKED RECORD
731 Red, Green, Blue : cmsCIEXYZ
732 END;
733 LPcmsCIEXYZTRIPLE = ^cmsCIEXYZTRIPLE;
736 cmsCIExyYTRIPLE = PACKED RECORD
737 Red, Green, Blue : cmsCIExyY
738 END;
739 LPcmsCIExyYTRIPLE = ^cmsCIExyYTRIPLE;
742 CONST
744 // Illuminant types for structs below
745 cmsILLUMINANT_TYPE_UNKNOWN = $0000000;
746 cmsILLUMINANT_TYPE_D50 = $0000001;
747 cmsILLUMINANT_TYPE_D65 = $0000002;
748 cmsILLUMINANT_TYPE_D93 = $0000003;
749 cmsILLUMINANT_TYPE_F2 = $0000004;
750 cmsILLUMINANT_TYPE_D55 = $0000005;
751 cmsILLUMINANT_TYPE_A = $0000006;
752 cmsILLUMINANT_TYPE_E = $0000007;
753 cmsILLUMINANT_TYPE_F8 = $0000008;
755 TYPE
757 cmsICCMeasurementConditions = PACKED RECORD
759 Observer: cmsUInt32Number; // 0 = unknown, 1=CIE 1931, 2=CIE 1964
760 Backing: cmsCIEXYZ; // Value of backing
761 Geometry: cmsUInt32Number; // 0=unknown, 1=45/0, 0/45 2=0d, d/0
762 Flare: cmsFloat64Number; // 0..1.0
763 IlluminantType: cmsUInt32Number;
765 END;
767 cmsICCViewingConditions = PACKED RECORD
768 IlluminantXYZ: cmsCIEXYZ; // Not the same struct as CAM02,
769 SurroundXYZ: cmsCIEXYZ; // This is for storing the tag
770 IlluminantType: cmsUInt32Number; // viewing condition
771 END;
774 // Plug-In registering ---------------------------------------------------------------------------------------------------
776 FUNCTION cmsPlugin(Plugin: Pointer): cmsBool; StdCall;
777 PROCEDURE cmsUnregisterPlugins; StdCall;
779 // Error logging ----------------------------------------------------------------------------------------------------------
781 // There is no error handling at all. When a function fails, it returns proper value.
782 // For example, all create functions does return NULL on failure. Other may return FALSE.
783 // It may be interesting, for the developer, to know why the function is failing.
784 // for that reason, lcms2 does offer a logging function. This function will get
785 // an ENGLISH string with some clues on what is going wrong. You can show this
786 // info to the end user if you wish, or just create some sort of log on disk.
787 // The logging function should NOT terminate the program, as this obviously can leave
788 // unfreed resources. It is the programmer's responsibility to check each function
789 // return code to make sure it didn't fail.
791 CONST
793 cmsERROR_UNDEFINED = 0;
794 cmsERROR_FILE = 1;
795 cmsERROR_RANGE = 2;
796 cmsERROR_INTERNAL = 3;
797 cmsERROR_NULL = 4;
798 cmsERROR_READ = 5;
799 cmsERROR_SEEK = 6;
800 cmsERROR_WRITE = 7;
801 cmsERROR_UNKNOWN_EXTENSION = 8;
802 cmsERROR_COLORSPACE_CHECK = 9;
803 cmsERROR_ALREADY_DEFINED = 10;
804 cmsERROR_BAD_SIGNATURE = 11;
805 cmsERROR_CORRUPTION_DETECTED = 12;
806 cmsERROR_NOT_SUITABLE = 13;
808 // Error logger is called with the ContextID when a message is raised. This gives the
809 // chance to know which thread is responsible of the warning and any environment associated
810 // with it. Non-multithreading applications may safely ignore this parameter.
811 // Note that under certain special circumstances, ContextID may be NULL.
813 TYPE
815 cmsLogErrorHandlerFunction = PROCEDURE( ContextID: cmsContext; ErrorCode: cmsUInt32Number; Text: PAnsiChar); CDecl;
817 // Allows user to set any specific logger
818 PROCEDURE cmsSetLogErrorHandler(Fn: cmsLogErrorHandlerFunction); StdCall;
821 // Conversions --------------------------------------------------------------------------------------------------------------
824 // Returns pointers to constant structs
825 FUNCTION cmsD50_XYZ: LPcmsCIEXYZ; StdCall;
826 FUNCTION cmsD50_xyY: LPcmsCIExyY; StdCall;
828 // Colorimetric space conversions
829 PROCEDURE cmsXYZ2xyY(Dest: LPcmsCIExyY; Source: LPcmsCIEXYZ); StdCall;
830 PROCEDURE cmsxyY2XYZ(Dest: LPcmsCIEXYZ; Source: LPcmsCIExyY); StdCall;
831 PROCEDURE cmsLab2XYZ(WhitePoint: LPcmsCIEXYZ; xyz: LPcmsCIEXYZ; Lab: LPcmsCIELab); StdCall;
832 PROCEDURE cmsXYZ2Lab(WhitePoint: LPcmsCIEXYZ; Lab: LPcmsCIELab; xyz: LPcmsCIEXYZ); StdCall;
833 PROCEDURE cmsLab2LCh(LCh: LPcmsCIELCh; Lab: LPcmsCIELab); StdCall;
834 PROCEDURE cmsLCh2Lab(Lab: LPcmsCIELab; LCh: LPcmsCIELCh); StdCall;
836 // Encoding /Decoding on PCS
837 PROCEDURE cmsLabEncoded2Float(Lab: LPcmsCIELab; wLab: Pointer); StdCall;
838 PROCEDURE cmsLabEncoded2FloatV2(Lab: LPcmsCIELab; wLab: Pointer); StdCall;
839 PROCEDURE cmsFloat2LabEncoded(wLab: Pointer; Lab: LPcmsCIELab); StdCall;
840 PROCEDURE cmsFloat2LabEncodedV2(wLab: Pointer; Lab: LPcmsCIELab); StdCall;
841 PROCEDURE cmsXYZEncoded2Float(fxyz : LPcmsCIEXYZ; XYZ: Pointer); StdCall;
842 PROCEDURE cmsFloat2XYZEncoded(XYZ: Pointer; fXYZ: LPcmsCIEXYZ); StdCall;
845 // DeltaE metrics
846 FUNCTION cmsDeltaE(Lab1, Lab2: LPcmsCIELab): Double; StdCall;
847 FUNCTION cmsCIE94DeltaE(Lab1, Lab2: LPcmsCIELab): Double; StdCall;
848 FUNCTION cmsBFDdeltaE(Lab1, Lab2: LPcmsCIELab): Double; StdCall;
849 FUNCTION cmsCMCdeltaE(Lab1, Lab2: LPcmsCIELab): Double; StdCall;
850 FUNCTION cmsCIE2000DeltaE(Lab1, Lab2: LPcmsCIELab; Kl, Kc, Kh: Double): Double; StdCall;
853 // Temperature <-> Chromaticity (Black body)
854 FUNCTION cmsWhitePointFromTemp(var WhitePoint: cmsCIExyY; TempK: cmsFloat64Number) : cmsBool; StdCall;
855 FUNCTION cmsTempFromWhitePoint(var TeampK: cmsFloat64Number; var WhitePoint: cmsCIExyY) : cmsBool; StdCall;
858 // Chromatic adaptation
859 FUNCTION cmsAdaptToIlluminant(Result: LPcmsCIEXYZ; SourceWhitePt: LPcmsCIEXYZ;
860 Illuminant: LPcmsCIEXYZ; Value: LPcmsCIEXYZ): cmsBool; StdCall;
863 // CIECAM02 ---------------------------------------------------------------------------------------------------
865 // Viewing conditions. Please note those are CAM model viewing conditions, and not the ICC tag viewing
866 // conditions, which I'm naming cmsICCViewingConditions to make differences evident. Unfortunately, the tag
867 // cannot deal with surround La, Yb and D value so is basically useless to store CAM02 viewing conditions.
869 CONST
871 AVG_SURROUND = 1;
872 DIM_SURROUND = 2;
873 DARK_SURROUND = 3;
874 CUTSHEET_SURROUND = 4;
876 D_CALCULATE = -1;
878 TYPE
880 cmsViewingConditions = PACKED RECORD
882 WhitePoint: cmsCIEXYZ;
883 Yb : cmsFloat64Number;
884 La : cmsFloat64Number;
885 surround : Integer;
886 D_value : cmsFloat64Number
887 END;
890 LPcmsViewingConditions = ^cmsViewingConditions;
892 FUNCTION cmsCIECAM02Init(pVC : LPcmsViewingConditions ) : Pointer; StdCall;
893 PROCEDURE cmsCIECAM02Done(hModel : Pointer); StdCall;
894 PROCEDURE cmsCIECAM02Forward(hModel: Pointer; pIn: LPcmsCIEXYZ; pOut: LPcmsJCh ); StdCall;
895 PROCEDURE cmsCIECAM02Reverse(hModel: Pointer; pIn: LPcmsJCh; pOut: LPcmsCIEXYZ ); StdCall;
897 // Tone curves -----------------------------------------------------------------------------------------
899 // This describes a curve segment. For a table of supported types, see the manual. User can increase the number of
900 // available types by using a proper plug-in. Parametric segments allow 10 parameters at most
902 TYPE
903 cmsCurveSegment = PACKED RECORD
904 x0, x1: cmsFloat32Number; // Domain; for x0 < x <= x1
905 PType: cmsInt32Number; // Parametric type, Type == 0 means sampled segment. Negative values are reserved
906 Params: array [0..9] of cmsFloat64Number; // Parameters if Type != 0
907 nGridPoints: cmsUInt32Number; // Number of grid points if Type == 0
908 SampledPoints: LPcmsFloat32Number; // Points to an array of floats if Type == 0
909 END;
911 LPcmsToneCurve = Pointer;
912 LPcmsCurveSegmentArray = ^cmsCurveSegmentArray;
913 cmsCurveSegmentArray = array[0..0] of cmsCurveSegment;
915 LPcmsFloat64NumberArray = ^cmsFloat64NumberArray;
916 cmsFloat64NumberArray = array[0..0] of cmsFloat64Number;
918 LPcmsUInt16NumberArray = ^cmsUInt16NumberArray;
919 cmsUInt16NumberArray = array[0..0] of cmsUInt16Number;
921 LPcmsFloat32NumberArray = ^cmsFloat32NumberArray;
922 cmsFloat32NumberArray = array[0..0] of cmsFloat32Number;
924 LPLPcmsToneCurveArray = ^LPcmsToneCurveArray;
925 LPcmsToneCurveArray = array[0..0] of LPcmsToneCurve;
927 LPcmsUInt32NumberArray = ^cmsUInt32NumberArray;
928 cmsUInt32NumberArray = array[0..0] of cmsUInt32Number;
930 FUNCTION cmsBuildSegmentedToneCurve(ContextID: cmsContext; nSegments: cmsInt32Number; Segments: LPcmsCurveSegmentArray): LPcmsToneCurve; StdCall;
931 FUNCTION cmsBuildParametricToneCurve(ContextID: cmsContext; CType: cmsInt32Number; Params: LPcmsFloat64NumberArray): LPcmsToneCurve; StdCall;
932 FUNCTION cmsBuildGamma(ContextID: cmsContext; Gamma: cmsFloat64Number): LPcmsToneCurve; StdCall;
933 FUNCTION cmsBuildTabulatedToneCurve16(ContextID: cmsContext; nEntries: cmsInt32Number; values: LPcmsUInt16NumberArray): LPcmsToneCurve; StdCall;
934 FUNCTION cmsBuildTabulatedToneCurveFloat(ContextID: cmsContext; nEntries: cmsUInt32Number; values: LPcmsFloat32NumberArray): LPcmsToneCurve; StdCall;
935 PROCEDURE cmsFreeToneCurve(Curve: LPcmsToneCurve); StdCall;
936 PROCEDURE cmsFreeToneCurveTriple(Curve: LPLPcmsToneCurveArray); StdCall;
937 FUNCTION cmsDupToneCurve(Src: LPcmsToneCurve): LPcmsToneCurve; StdCall;
938 FUNCTION cmsReverseToneCurve(InGamma: LPcmsToneCurve): LPcmsToneCurve; StdCall;
939 FUNCTION cmsReverseToneCurveEx(nResultSamples: cmsInt32Number; InGamma: LPcmsToneCurve): LPcmsToneCurve; StdCall;
940 FUNCTION cmsJoinToneCurve(ContextID: cmsContext; X, Y: LPcmsToneCurve; nPoints: cmsUInt32Number ): LPcmsToneCurve; StdCall;
941 FUNCTION cmsSmoothToneCurve(Tab: LPcmsToneCurve; lambda: cmsFloat64Number): cmsBool; StdCall;
942 FUNCTION cmsEvalToneCurveFloat(Curve: LPcmsToneCurve; v: cmsFloat32Number):cmsFloat32Number; StdCall;
943 FUNCTION cmsEvalToneCurve16(Curve: LPcmsToneCurve; v:cmsUInt16Number):cmsUInt16Number; StdCall;
944 FUNCTION cmsIsToneCurveMultisegment(InGamma: LPcmsToneCurve):cmsBool; StdCall;
945 FUNCTION cmsIsToneCurveLinear(Curve: LPcmsToneCurve):cmsBool; StdCall;
946 FUNCTION cmsIsToneCurveMonotonic(t: LPcmsToneCurve):cmsBool; StdCall;
947 FUNCTION cmsIsToneCurveDescending(t: LPcmsToneCurve):cmsBool; StdCall;
948 FUNCTION cmsGetToneCurveParametricType(t: LPcmsToneCurve):cmsInt32Number; StdCall;
949 FUNCTION cmsEstimateGamma(t: LPcmsToneCurve; Precision:cmsFloat64Number):cmsFloat64Number; StdCall;
952 // Implements pipelines of multi-processing elements -------------------------------------------------------------
954 TYPE
955 LPcmsPipeline = Pointer;
956 LPcmsStage = Pointer;
957 LPLPcmsStage = ^LPcmsStage;
959 // Those are hi-level pipelines
960 FUNCTION cmsPipelineAlloc(ContextID: cmsContext; InputChannels, OutputChannels: cmsUInt32Number): LPcmsPipeline; StdCall;
961 PROCEDURE cmsPipelineFree(lut: LPcmsPipeline); StdCall;
962 FUNCTION cmsPipelineDup(Orig: LPcmsPipeline): LPcmsPipeline; StdCall;
963 FUNCTION cmsPipelineInputChannels(lut: LPcmsPipeline): cmsUInt32Number; StdCall;
964 FUNCTION cmsPipelineOutputChannels(lut: LPcmsPipeline): cmsUInt32Number; StdCall;
966 FUNCTION cmsPipelineStageCount(lut: LPcmsPipeline): cmsUInt32Number; StdCall;
967 FUNCTION cmsPipelineGetPtrToFirstStage(lut: LPcmsPipeline): LPcmsStage; StdCall;
968 FUNCTION cmsPipelineGetPtrToLastStage(lut: LPcmsPipeline): LPcmsStage; StdCall;
970 PROCEDURE cmsPipelineEval16(Inv, Outv: LPcmsUInt16NumberArray; lut: LPcmsPipeline); StdCall;
971 PROCEDURE cmsPipelineEvalFloat(Inv, Outv: LPcmsFloat32NumberArray; lut: LPcmsPipeline); StdCall;
973 FUNCTION cmsPipelineEvalReverseFloat(Target, Result, Hint: LPcmsFloat32NumberArray; lut: LPcmsPipeline): cmsBool; StdCall;
974 FUNCTION cmsPipelineCat(l1, l2: LPcmsPipeline): cmsBool; StdCall;
975 FUNCTION cmsPipelineSetSaveAs8bitsFlag(lut: LPcmsPipeline; On: cmsBool): cmsBool; StdCall;
977 // Where to place/locate the stages in the pipeline chain
978 TYPE
979 cmsStageLoc = (cmsAT_BEGIN = 0, cmsAT_END = 1 );
981 PROCEDURE cmsPipelineInsertStage(lut: LPcmsPipeline; loc: cmsStageLoc; mpe: LPcmsStage); StdCall;
982 PROCEDURE cmsPipelineUnlinkStage(lut: LPcmsPipeline; loc: cmsStageLoc; mpe: LPLPcmsStage); StdCall;
984 // This function is quite useful to analyze the structure of a Pipeline and retrieve the Stage elements
985 // that conform the Pipeline. It should be called with the Pipeline, the number of expected elements and
986 // then a list of expected types followed with a list of double pointers to Stage elements. If
987 // the function founds a match with current pipeline, it fills the pointers and returns TRUE
988 // if not, returns FALSE without touching anything.
989 // FUNCTION cmsPipelineCheckAndRetreiveStages(const cmsPipeline* Lut, n: cmsUInt32Number, ...): cmsBool; StdCall;
991 // Matrix has double precision and CLUT has only float precision. That is because an ICC profile can encode
992 // matrices with far more precision that CLUTS
993 FUNCTION cmsStageAllocIdentity(ContextID: cmsContext; nChannels: cmsUInt32Number): LPcmsStage; StdCall;
994 FUNCTION cmsStageAllocToneCurves(ContextID: cmsContext; nChannels: cmsUInt32Number; Curves: LPLPcmsToneCurveArray): LPcmsStage; StdCall;
995 FUNCTION cmsStageAllocMatrix(ContextID: cmsContext; Rows, Cols: cmsUInt32Number; Matrix, Offset: LPcmsFloat64NumberArray): LPcmsStage; StdCall;
997 FUNCTION cmsStageAllocCLut16bit(ContextID: cmsContext; nGridPoints: cmsUInt32Number; inputChan, outputChan: cmsUInt32Number; Table: LPcmsUInt16NumberArray): LPcmsStage; StdCall;
998 FUNCTION cmsStageAllocCLutFloat(ContextID: cmsContext; nGridPoints: cmsUInt32Number; inputChan, outputChan: cmsUInt32Number; Table: LPcmsFloat32NumberArray): LPcmsStage; StdCall;
1000 FUNCTION cmsStageAllocCLut16bitGranular(ContextID: cmsContext; nGridPoints: LPcmsUInt32NumberArray; inputChan, outputChan: cmsUInt32Number; Table: LPcmsUInt16NumberArray): LPcmsStage; StdCall;
1001 FUNCTION cmsStageAllocCLutFloatGranular(ContextID: cmsContext; nGridPoints: LPcmsUInt32NumberArray; inputChan, outputChan: cmsUInt32Number; Table: LPcmsFloat32NumberArray): LPcmsStage; StdCall;
1004 FUNCTION cmsStageDup(mpe: LPcmsStage): LPcmsStage; StdCall;
1005 PROCEDURE cmsStageFree(mpe: LPcmsStage); StdCall;
1006 FUNCTION cmsStageNext(mpe: LPcmsStage): LPcmsStage; StdCall;
1008 FUNCTION cmsStageInputChannels(mpe: LPcmsStage): cmsUInt32Number; StdCall;
1009 FUNCTION cmsStageOutputChannels(mpe: LPcmsStage): cmsUInt32Number; StdCall;
1010 FUNCTION cmsStageType(mpe: LPcmsStage): cmsStageSignature; StdCall;
1011 FUNCTION cmsStageData(mpe: LPcmsStage): Pointer; StdCall;
1013 // Sampling
1015 Type
1016 cmsSAMPLER16 = FUNCTION (Inp, Outp: LPcmsUInt16NumberArray; Cargo: Pointer): cmsInt32Number; CDecl;
1017 cmsSAMPLERFLOAT = FUNCTION (Inp, Outp: LPcmsFloat32NumberArray; Cargo: Pointer): cmsInt32Number; CDecl;
1019 // Use this flag to prevent changes being written to destination
1021 Const
1023 SAMPLER_INSPECT = $01000000;
1026 // For CLUT only
1027 FUNCTION cmsStageSampleCLut16bit(mpe: LPcmsStage; Sampler: cmsSAMPLER16; Cargo: Pointer; dwFlags: cmsUInt32Number): cmsBool; StdCall;
1028 FUNCTION cmsStageSampleCLutFloat(mpe: LPcmsStage; Sampler: cmsSAMPLERFLOAT; Cargo: Pointer; dwFlags: cmsUInt32Number): cmsBool; StdCall;
1031 // Slicers
1032 FUNCTION cmsSliceSpace16(nInputs: cmsUInt32Number; clutPoints: LPcmsUInt32NumberArray;
1033 Sampler: cmsSAMPLER16; Cargo: Pointer): cmsBool; StdCall;
1035 FUNCTION cmsSliceSpaceFloat(nInputs: cmsUInt32Number; clutPoints: LPcmsUInt32NumberArray;
1036 Sampler: cmsSAMPLERFLOAT; Cargo: Pointer): cmsBool; StdCall;
1038 // Multilocalized Unicode management ---------------------------------------------------------------------------------------
1040 Type
1041 LPcmsMLU = Pointer;
1043 Const
1045 cmsNoLanguage = #0#0#0;
1046 cmsNoCountry = #0#0#0;
1049 FUNCTION cmsMLUalloc(ContextID: cmsContext; nItems: cmsUInt32Number): LPcmsMLU; StdCall;
1050 PROCEDURE cmsMLUfree(mlu: LPcmsMLU); StdCall;
1051 FUNCTION cmsMLUdup(mlu: LPcmsMLU): LPcmsMLU; StdCall;
1053 FUNCTION cmsMLUsetASCII(mlu: LPcmsMLU; LanguageCode, CountryCode, ASCIIString: PAnsiChar): cmsBool; StdCall;
1054 FUNCTION cmsMLUsetWide(mlu: LPcmsMLU; LanguageCode, CountryCode: PAnsiChar; WideString: PWChar): cmsBool; StdCall;
1056 FUNCTION cmsMLUgetASCII(mlu: LPcmsMLU; LanguageCode, CountryCode: PAnsiChar; Buffer: PAnsiChar; BufferSize: cmsUInt32Number): cmsUInt32Number; StdCall;
1058 FUNCTION cmsMLUgetWide(mlu: LPcmsMLU; LanguageCode, CountryCode: PAnsiChar; Buffer: PWChar; BufferSize: cmsUInt32Number): cmsUInt32Number; StdCall;
1060 FUNCTION cmsMLUgetTranslation(mlu: LPcmsMLU; LanguageCode, CountryCode, ObtainedLanguage, ObtainedCountry: PAnsiChar): cmsBool; StdCall;
1062 // Undercolorremoval & black generation -------------------------------------------------------------------------------------
1064 Type
1066 cmsUcrBg = PACKED RECORD
1067 Ucr, Bg: LPcmsToneCurve;
1068 Desc: LPcmsMLU;
1069 END;
1072 // Screening ----------------------------------------------------------------------------------------------------------------
1074 Const
1076 cmsPRINTER_DEFAULT_SCREENS = $0001;
1077 cmsFREQUENCE_UNITS_LINES_CM = $0000;
1078 cmsFREQUENCE_UNITS_LINES_INCH = $0002;
1080 cmsSPOT_UNKNOWN = 0;
1081 cmsSPOT_PRINTER_DEFAULT = 1;
1082 cmsSPOT_ROUND = 2;
1083 cmsSPOT_DIAMOND = 3;
1084 cmsSPOT_ELLIPSE = 4;
1085 cmsSPOT_LINE = 5;
1086 cmsSPOT_SQUARE = 6;
1087 cmsSPOT_CROSS = 7;
1090 Type
1092 cmsScreeningChannel = PACKED RECORD
1094 Frequency,
1095 ScreenAngle: cmsFloat64Number;
1096 SpotShape: cmsUInt32Number;
1098 END;
1100 cmsScreening = PACKED RECORD
1102 Flag,
1103 nChannels : cmsUInt32Number;
1104 Channels: Array [0..cmsMAXCHANNELS-1] OF cmsScreeningChannel;
1105 END;
1108 // Named color -----------------------------------------------------------------------------------------------------------------
1111 LPcmsNAMEDCOLORLIST = Pointer;
1113 FUNCTION cmsAllocNamedColorList(ContextID: cmsContext; n, ColorantCount :cmsUInt32Number;
1114 Prefix, Suffix: PAnsiChar): LPcmsNAMEDCOLORLIST; StdCall;
1116 PROCEDURE cmsFreeNamedColorList(v: LPcmsNAMEDCOLORLIST); StdCall;
1117 FUNCTION cmsDupNamedColorList(v: LPcmsNAMEDCOLORLIST): LPcmsNAMEDCOLORLIST; StdCall;
1118 FUNCTION cmsAppendNamedColor(v: LPcmsNAMEDCOLORLIST; Name: PAnsiChar;
1119 PCS, Colorant : LPcmsUInt16NumberArray): cmsBool; StdCall;
1121 FUNCTION cmsNamedColorCount(v: LPcmsNAMEDCOLORLIST): cmsUInt32Number; StdCall;
1122 FUNCTION cmsNamedColorIndex(v: LPcmsNAMEDCOLORLIST; Name: PAnsiChar): cmsInt32Number; StdCall;
1124 FUNCTION cmsNamedColorInfo(v: LPcmsNAMEDCOLORLIST; nColor : cmsUInt32Number;
1125 Name,Prefix, Suffix : PAnsiChar;
1126 PCS, Colorant : LPcmsUInt16NumberArray): cmsBool; StdCall;
1128 // Retrieve named color list from transform
1129 FUNCTION cmsGetNamedColorList(xform: cmsHTRANSFORM ): LPcmsNAMEDCOLORLIST; StdCall;
1131 // Profile sequence -----------------------------------------------------------------------------------------------------
1133 Type
1135 // Profile sequence descriptor. Some fields come from profile sequence descriptor tag, others
1136 // come from Profile Sequence Identifier Tag
1138 cmsPSEQDESC = PACKED RECORD
1139 deviceMfg, deviceModel: cmsSignature;
1141 attributes: cmsUInt64Number;
1142 technology: cmsTechnologySignature;
1143 ProfileID: cmsProfileID;
1144 Manufacturer,
1145 Model,
1146 Description : LPcmsMLU;
1147 END;
1149 LPcmsSEQDESC = ^cmsPSEQDESC;
1151 cmsSEQ = PACKED RECORD
1153 n: cmsUInt32Number;
1154 ContextID: cmsContext;
1155 seq: LPcmsSEQDESC;
1156 END;
1158 LPcmsSEQ = ^cmsSEQ;
1160 FUNCTION cmsAllocProfileSequenceDescription(ContextID: cmsContext; n: cmsUInt32Number):LPcmsSEQ; StdCall;
1161 FUNCTION cmsDupProfileSequenceDescription(pseq: LPcmsSEQ):LPcmsSEQ; StdCall;
1162 PROCEDURE cmsFreeProfileSequenceDescription(pseq: LPcmsSEQ); StdCall;
1164 // Dictionaries --------------------------------------------------------------------------------------------------------
1166 TYPE
1168 LPcmsDICTentry = ^cmsDICTentry;
1170 cmsDICTentry = PACKED RECORD
1172 Next: LPcmsDICTentry;
1174 DisplayName, DisplayValue: LPcmsMLU;
1175 Name, Value : PWChar;
1176 END;
1178 FUNCTION cmsDictAlloc(ContextID: cmsContext): cmsHANDLE; StdCall;
1179 PROCEDURE cmsDictFree(hDict: cmsHANDLE); StdCall;
1180 FUNCTION cmsDictDup(hDict: cmsHANDLE): cmsHANDLE; StdCall;
1182 FUNCTION cmsDictAddEntry(hDict: cmsHANDLE; Name, Value: PWChar; DisplayName, DisplayValue : LPcmsMLU): cmsBool; StdCall;
1183 FUNCTION cmsDictGetEntryList(hDict: cmsHANDLE): LPcmsDICTentry; StdCall;
1184 FUNCTION cmsDictNextEntry(e : LPcmsDICTentry): LPcmsDICTentry; StdCall;
1186 // Access to Profile data ----------------------------------------------------------------------------------------------
1187 FUNCTION cmsCreateProfilePlaceholder(ContextID: cmsContext): cmsHPROFILE; StdCall;
1189 FUNCTION cmsGetProfileContextID(hProfile: cmsHPROFILE):cmsContext; StdCall;
1190 FUNCTION cmsGetTagCount(hProfile: cmsHPROFILE): cmsInt32Number; StdCall;
1191 FUNCTION cmsGetTagSignature(hProfile: cmsHPROFILE; n: cmsUInt32Number): cmsTagSignature; StdCall;
1192 FUNCTION cmsIsTag(hProfile: cmsHPROFILE; sig: cmsTagSignature ): cmsBool; StdCall;
1194 // Read and write pre-formatted data
1195 FUNCTION cmsReadTag(hProfile: cmsHPROFILE; sig: cmsTagSignature ): Pointer; StdCall;
1196 FUNCTION cmsWriteTag(hProfile: cmsHPROFILE; sig: cmsTagSignature; data: Pointer): cmsBool; StdCall;
1197 FUNCTION cmsLinkTag(hProfile: cmsHPROFILE; sig: cmsTagSignature; dest: cmsTagSignature): cmsBool; StdCall;
1198 FUNCTION cmsTagLinkedTo(hProfile: cmsHPROFILE; sig: cmsTagSignature):cmsTagSignature; StdCall;
1200 // Read and write raw data
1201 FUNCTION cmsReadRawTag(hProfile: cmsHPROFILE; sig: cmsTagSignature; Buffer: Pointer; BufferSize: cmsUInt32Number): cmsInt32Number; StdCall;
1202 FUNCTION cmsWriteRawTag(hProfile: cmsHPROFILE; sig: cmsTagSignature; data: Pointer; Size: cmsUInt32Number): cmsBool; StdCall;
1204 // Access header data
1205 Const
1207 cmsEmbeddedProfileFalse = $00000000;
1208 cmsEmbeddedProfileTrue = $00000001;
1209 cmsUseAnywhere = $00000000;
1210 cmsUseWithEmbeddedDataOnly = $00000002;
1212 FUNCTION cmsGetHeaderFlags(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall;
1213 PROCEDURE cmsGetHeaderAttributes(hProfile: cmsHPROFILE; Flags: LPcmsUInt64Number); StdCall;
1214 PROCEDURE cmsGetHeaderProfileID(hProfile: cmsHPROFILE; ProfileID: LPcmsUInt8Number); StdCall;
1216 // TODO:
1217 // FUNCTION cmsGetHeaderCreationDateTime(hProfile: cmsHPROFILE; struct tm *Dest): cmsBool; StdCall;
1219 FUNCTION cmsGetHeaderRenderingIntent(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall;
1220 PROCEDURE cmsSetHeaderFlags(hProfile: cmsHPROFILE; Flags: cmsUInt32Number); StdCall;
1221 FUNCTION cmsGetHeaderManufacturer(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall;
1222 PROCEDURE cmsSetHeaderManufacturer(hProfile: cmsHPROFILE; manufacturer: cmsUInt32Number ); StdCall;
1223 FUNCTION cmsGetHeaderModel(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall;
1224 PROCEDURE cmsSetHeaderModel(hProfile: cmsHPROFILE; model: cmsUInt32Number ); StdCall;
1225 PROCEDURE cmsSetHeaderAttributes(hProfile: cmsHPROFILE; Flags: cmsUInt64Number); StdCall;
1226 PROCEDURE cmsSetHeaderProfileID(hProfile: cmsHPROFILE; ProfileID: LPcmsUInt8Number); StdCall;
1227 PROCEDURE cmsSetHeaderRenderingIntent(hProfile: cmsHPROFILE; RenderingIntent: cmsUInt32Number ); StdCall;
1229 FUNCTION cmsGetPCS(hProfile: cmsHPROFILE):cmsColorSpaceSignature; StdCall;
1230 PROCEDURE cmsSetPCS(hProfile: cmsHPROFILE; pcs: cmsColorSpaceSignature); StdCall;
1231 FUNCTION cmsGetColorSpace(hProfile: cmsHPROFILE): cmsColorSpaceSignature; StdCall;
1232 PROCEDURE cmsSetColorSpace(hProfile: cmsHPROFILE; sig: cmsColorSpaceSignature); StdCall;
1233 FUNCTION cmsGetDeviceClass(hProfile: cmsHPROFILE): cmsProfileClassSignature; StdCall;
1234 PROCEDURE cmsSetDeviceClass(hProfile: cmsHPROFILE; sig: cmsProfileClassSignature); StdCall;
1235 PROCEDURE cmsSetProfileVersion(hProfile: cmsHPROFILE; Version: cmsFloat64Number); StdCall;
1236 FUNCTION cmsGetProfileVersion(hProfile: cmsHPROFILE): cmsFloat64Number; StdCall;
1238 FUNCTION cmsGetEncodedICCversion(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall;
1239 PROCEDURE cmsSetEncodedICCversion(hProfile: cmsHPROFILE; Version: cmsUInt32Number); StdCall;
1242 Const
1244 // How profiles may be used
1245 LCMS_USED_AS_INPUT = 0;
1246 LCMS_USED_AS_OUTPUT = 1;
1247 LCMS_USED_AS_PROOF = 2;
1249 FUNCTION cmsIsIntentSupported(hProfile: cmsHPROFILE; Intent: cmsUInt32Number; UsedDirection: cmsUInt32Number): cmsBool; StdCall;
1250 FUNCTION cmsIsMatrixShaper(hProfile: cmsHPROFILE): cmsBool; StdCall;
1251 FUNCTION cmsIsCLUT(hProfile: cmsHPROFILE; Intent: cmsUInt32Number; UsedDirection: cmsUInt32Number): cmsBool; StdCall;
1253 // Translate form/to our notation to ICC
1254 FUNCTION _cmsICCcolorSpace(OurNotation: Integer): cmsColorSpaceSignature; StdCall;
1255 FUNCTION _cmsLCMScolorSpace(ProfileSpace: cmsColorSpaceSignature): Integer; StdCall;
1257 FUNCTION cmsChannelsOf( ColorSpace: cmsColorSpaceSignature): cmsUInt32Number; StdCall;
1259 // Build a suitable formatter for the colorspace of this profile
1260 FUNCTION cmsFormatterForColorspaceOfProfile(hProfile: cmsHPROFILE; nBytes: cmsUInt32Number; lIsFloat: cmsBool): cmsUInt32Number; StdCall;
1261 FUNCTION cmsFormatterForPCSOfProfile(hProfile: cmsHPROFILE; nBytes: cmsUInt32Number; lIsFloat: cmsBool): cmsUInt32Number; StdCall;
1263 Type
1265 // Localized info
1266 cmsInfoType = (
1267 cmsInfoDescription = 0,
1268 cmsInfoManufacturer = 1,
1269 cmsInfoModel = 2,
1270 cmsInfoCopyright = 3
1273 FUNCTION cmsGetProfileInfo(hProfile: cmsHPROFILE; Info: cmsInfoType; LanguageCode, CountryCode: PAnsiChar;
1274 Buffer: PWChar; BufferSize: cmsUInt32Number): cmsUInt32Number; StdCall;
1276 FUNCTION cmsGetProfileInfoASCII(hProfile: cmsHPROFILE; Info: cmsInfoType; LanguageCode, CountryCode: PAnsiChar;
1277 Buffer: PAnsiChar; BufferSize: cmsUInt32Number): cmsUInt32Number; StdCall;
1279 // IO handlers ----------------------------------------------------------------------------------------------------------
1281 Type
1283 LPcmsIOHANDLER = Pointer;
1285 FUNCTION cmsOpenIOhandlerFromFile(ContextID: cmsContext; FileName, AccessMode: PAnsiChar): LPcmsIOHANDLER; StdCall;
1286 // FUNCTION cmsOpenIOhandlerFromStream(ContextID: cmsContext; FILE* Stream): LPcmsIOHANDLER; StdCall;
1287 FUNCTION cmsOpenIOhandlerFromMem(ContextID: cmsContext; Buffer: Pointer; size: cmsUInt32Number; AccessMode: PAnsiChar): LPcmsIOHANDLER; StdCall;
1288 FUNCTION cmsOpenIOhandlerFromNULL(ContextID: cmsContext): LPcmsIOHANDLER; StdCall;
1289 FUNCTION cmsCloseIOhandler(io: LPcmsIOHANDLER): cmsBool; StdCall;
1291 // MD5 message digest --------------------------------------------------------------------------------------------------
1293 FUNCTION cmsMD5computeID(hProfile: cmsHPROFILE): cmsBool; StdCall;
1295 // Profile high level funtions ------------------------------------------------------------------------------------------
1297 FUNCTION cmsOpenProfileFromFile(ICCProfile : PAnsiChar; sAccess: PAnsiChar): cmsHPROFILE; StdCall;
1298 FUNCTION cmsOpenProfileFromFileTHR(ContextID: cmsContext; ICCProfile, sAccess: PAnsiChar): cmsHPROFILE; StdCall;
1299 // FUNCTION CMSEXPORT cmsOpenProfileFromStream(FILE* ICCProfile, const char* sAccess): cmsHPROFILE; StdCall;
1300 // FUNCTION CMSEXPORT cmsOpenProfileFromStreamTHR(ContextID: cmsContext; FILE* ICCProfile, const char* sAccess): cmsHPROFILE; StdCall;
1301 FUNCTION cmsOpenProfileFromMem(MemPtr: Pointer; dwSize: cmsUInt32Number): cmsHPROFILE; StdCall;
1302 FUNCTION cmsOpenProfileFromMemTHR(ContextID: cmsContext; MemPtr: Pointer; dwSize: cmsUInt32Number): cmsHPROFILE; StdCall;
1303 FUNCTION cmsOpenProfileFromIOhandlerTHR(ContextID: cmsContext; io: LPcmsIOHANDLER): cmsHPROFILE; StdCall;
1304 FUNCTION cmsCloseProfile(hProfile: cmsHPROFILE): cmsBool; StdCall;
1306 FUNCTION cmsSaveProfileToFile(hProfile: cmsHPROFILE; FileName: PAnsiChar): cmsBool; StdCall;
1307 // FUNCTION CMSEXPORT cmsSaveProfileToStream(hProfile: cmsHPROFILE, FILE* Stream): cmsBool; StdCall;
1308 FUNCTION cmsSaveProfileToMem(hProfile: cmsHPROFILE; MemPtr: Pointer; BytesNeeded: LPcmsUInt32Number): cmsBool; StdCall;
1309 FUNCTION cmsSaveProfileToIOhandler(hProfile: cmsHPROFILE; io: LPcmsIOHANDLER):cmsUInt32Number; StdCall;
1311 // Predefined virtual profiles ------------------------------------------------------------------------------------------
1313 FUNCTION cmsCreateRGBProfileTHR(ContextID: cmsContext;
1314 WhitePoint: LPcmsCIExyY;
1315 Primaries: LPcmsCIExyYTRIPLE;
1316 TransferFunction: LPLPcmsToneCurveArray): cmsHPROFILE; StdCall;
1318 FUNCTION cmsCreateRGBProfile(WhitePoint: LPcmsCIExyY;
1319 Primaries: LPcmsCIExyYTRIPLE;
1320 TransferFunction: LPLPcmsToneCurveArray): cmsHPROFILE; StdCall;
1322 FUNCTION cmsCreateGrayProfileTHR(ContextID: cmsContext;
1323 WhitePoint: LPcmsCIExyY;
1324 TransferFunction: LPcmsToneCurve): cmsHPROFILE; StdCall;
1326 FUNCTION cmsCreateGrayProfile(WhitePoint: LPcmsCIExyY;
1327 TransferFunction: LPcmsToneCurve): cmsHPROFILE; StdCall;
1329 FUNCTION cmsCreateLinearizationDeviceLinkTHR(ContextID: cmsContext;
1330 ColorSpace: cmsColorSpaceSignature;
1331 TransferFunctions: LPLPcmsToneCurveArray): cmsHPROFILE; StdCall;
1333 FUNCTION cmsCreateLinearizationDeviceLink(ColorSpace: cmsColorSpaceSignature;
1334 TransferFunctions: LPLPcmsToneCurveArray): cmsHPROFILE; StdCall;
1336 FUNCTION cmsCreateInkLimitingDeviceLinkTHR(ContextID: cmsContext;
1337 ColorSpace: cmsColorSpaceSignature; Limit: cmsFloat64Number): cmsHPROFILE; StdCall;
1339 FUNCTION cmsCreateInkLimitingDeviceLink(ColorSpace: cmsColorSpaceSignature; Limit: cmsFloat64Number): cmsHPROFILE; StdCall;
1342 FUNCTION cmsCreateLab2ProfileTHR(ContextID: cmsContext; WhitePoint: LPcmsCIExyY): cmsHPROFILE; StdCall;
1343 FUNCTION cmsCreateLab2Profile(WhitePoint: LPcmsCIExyY): cmsHPROFILE; StdCall;
1344 FUNCTION cmsCreateLab4ProfileTHR(ContextID: cmsContext; WhitePoint: LPcmsCIExyY): cmsHPROFILE; StdCall;
1345 FUNCTION cmsCreateLab4Profile(WhitePoint: LPcmsCIExyY): cmsHPROFILE; StdCall;
1347 FUNCTION cmsCreateXYZProfileTHR(ContextID: cmsContext): cmsHPROFILE; StdCall;
1348 FUNCTION cmsCreateXYZProfile: cmsHPROFILE; StdCall;
1350 FUNCTION cmsCreate_sRGBProfileTHR(ContextID: cmsContext): cmsHPROFILE; StdCall;
1351 FUNCTION cmsCreate_sRGBProfile: cmsHPROFILE; StdCall;
1353 FUNCTION cmsCreateBCHSWabstractProfileTHR(ContextID: cmsContext;
1354 nLUTPoints: Integer;
1355 Bright,
1356 Contrast,
1357 Hue,
1358 Saturation: cmsFloat64Number;
1359 TempSrc,
1360 TempDest: Integer): cmsHPROFILE; StdCall;
1362 FUNCTION cmsCreateBCHSWabstractProfile( nLUTPoints: Integer;
1363 Bright,
1364 Contrast,
1365 Hue,
1366 Saturation: cmsFloat64Number;
1367 TempSrc,
1368 TempDest: Integer): cmsHPROFILE; StdCall;
1370 FUNCTION cmsCreateNULLProfileTHR(ContextID: cmsContext): cmsHPROFILE; StdCall;
1371 FUNCTION cmsCreateNULLProfile: cmsHPROFILE; StdCall;
1373 // Converts a transform to a devicelink profile
1374 FUNCTION cmsTransform2DeviceLink(hTransform: cmsHTRANSFORM; Version: cmsFloat64Number; dwFlags: cmsUInt32Number): cmsHPROFILE; StdCall;
1376 // Intents ----------------------------------------------------------------------------------------------
1378 Const
1380 // ICC Intents
1381 INTENT_PERCEPTUAL = 0;
1382 INTENT_RELATIVE_COLORIMETRIC = 1;
1383 INTENT_SATURATION = 2;
1384 INTENT_ABSOLUTE_COLORIMETRIC = 3;
1386 // Non-ICC intents
1387 INTENT_PRESERVE_K_ONLY_PERCEPTUAL = 10;
1388 INTENT_PRESERVE_K_ONLY_RELATIVE_COLORIMETRIC = 11;
1389 INTENT_PRESERVE_K_ONLY_SATURATION = 12;
1390 INTENT_PRESERVE_K_PLANE_PERCEPTUAL = 13;
1391 INTENT_PRESERVE_K_PLANE_RELATIVE_COLORIMETRIC = 14;
1392 INTENT_PRESERVE_K_PLANE_SATURATION = 15;
1394 Type
1395 LPPAnsiChar = ^PAnsiChar;
1397 // Call with NULL as parameters to get the intent count
1398 FUNCTION cmsGetSupportedIntents(nMax: cmsUInt32Number; Codes: LPcmsUInt32Number; Descriptions: LPPAnsiChar): cmsUInt32Number; StdCall;
1400 Const
1402 // Flags
1404 cmsFLAGS_NOCACHE = $0040; // Inhibit 1-pixel cache
1405 cmsFLAGS_NOOPTIMIZE = $0100; // Inhibit optimizations
1406 cmsFLAGS_NULLTRANSFORM = $0200; // Don't transform anyway
1408 // Proofing flags
1409 cmsFLAGS_GAMUTCHECK = $1000; // Out of Gamut alarm
1410 cmsFLAGS_SOFTPROOFING = $4000; // Do softproofing
1412 // Misc
1413 cmsFLAGS_BLACKPOINTCOMPENSATION = $2000;
1414 cmsFLAGS_NOWHITEONWHITEFIXUP = $0004; // Don't fix scum dot
1415 cmsFLAGS_HIGHRESPRECALC = $0400; // Use more memory to give better accurancy
1416 cmsFLAGS_LOWRESPRECALC = $0800; // Use less memory to minimize resouces
1418 // For devicelink creation
1419 cmsFLAGS_8BITS_DEVICELINK = $0008; // Create 8 bits devicelinks
1420 cmsFLAGS_GUESSDEVICECLASS = $0020; // Guess device class (for transform2devicelink)
1421 cmsFLAGS_KEEP_SEQUENCE = $0080; // Keep profile sequence for devicelink creation
1423 // Specific to a particular optimizations
1424 cmsFLAGS_FORCE_CLUT = $0002; // Force CLUT optimization
1425 cmsFLAGS_CLUT_POST_LINEARIZATION = $0001; // create postlinearization tables if possible
1426 cmsFLAGS_CLUT_PRE_LINEARIZATION = $0010; // create prelinearization tables if possible
1428 // CRD special
1429 cmsFLAGS_NODEFAULTRESOURCEDEF = $01000000;
1431 // Fine-tune control over number of gridpoints
1432 FUNCTION cmsFLAGS_GRIDPOINTS(n: Integer): Integer;
1435 // Transforms ---------------------------------------------------------------------------------------------------
1437 type
1438 LPcmsHPROFILEArray = ^cmsHPROFILEArray;
1439 cmsHPROFILEArray = array[0..0] of cmsHPROFILE;
1441 LPcmsBoolArray = ^cmsBoolArray;
1442 cmsBoolArray = array[0..0] of cmsBool;
1444 FUNCTION cmsCreateTransformTHR(ContextID: cmsContext;
1445 Input: cmsHPROFILE;
1446 InputFormat: cmsUInt32Number;
1447 Output: cmsHPROFILE;
1448 OutputFormat: cmsUInt32Number;
1449 Intent: cmsUInt32Number;
1450 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall;
1452 FUNCTION cmsCreateTransform(Input: cmsHPROFILE;
1453 InputFormat: cmsUInt32Number;
1454 Output: cmsHPROFILE;
1455 OutputFormat: cmsUInt32Number;
1456 Intent: cmsUInt32Number;
1457 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall;
1459 FUNCTION cmsCreateProofingTransformTHR(ContextID: cmsContext;
1460 Input: cmsHPROFILE;
1461 InputFormat: cmsUInt32Number;
1462 Output: cmsHPROFILE;
1463 OutputFormat: cmsUInt32Number;
1464 Proofing: cmsHPROFILE;
1465 Intent: cmsUInt32Number;
1466 ProofingIntent: cmsUInt32Number;
1467 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall;
1469 FUNCTION cmsCreateProofingTransform(Input: cmsHPROFILE;
1470 InputFormat: cmsUInt32Number;
1471 Output: cmsHPROFILE;
1472 OutputFormat: cmsUInt32Number;
1473 Proofing: cmsHPROFILE;
1474 Intent: cmsUInt32Number;
1475 ProofingIntent: cmsUInt32Number;
1476 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall;
1478 FUNCTION cmsCreateMultiprofileTransformTHR(ContextID: cmsContext;
1479 hProfiles: LPcmsHPROFILEArray;
1480 nProfiles: cmsUInt32Number;
1481 InputFormat: cmsUInt32Number;
1482 OutputFormat: cmsUInt32Number;
1483 Intent: cmsUInt32Number;
1484 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall;
1487 FUNCTION cmsCreateMultiprofileTransform( hProfiles: LPcmsHPROFILEArray;
1488 nProfiles: cmsUInt32Number;
1489 InputFormat: cmsUInt32Number;
1490 OutputFormat: cmsUInt32Number;
1491 Intent: cmsUInt32Number;
1492 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall;
1495 FUNCTION cmsCreateExtendedTransform(ContextID: cmsContext;
1496 nProfiles: cmsUInt32Number;
1497 hProfiles: LPcmsHPROFILEArray;
1498 BPC: LPcmsBoolArray;
1499 Intents: LPcmsUInt32NumberArray;
1500 AdaptationStates: LPcmsFloat64NumberArray;
1501 hGamutProfile: cmsHPROFILE;
1502 nGamutPCSposition: cmsUInt32Number;
1503 InputFormat,
1504 OutputFormat: cmsUInt32Number;
1505 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall;
1507 PROCEDURE cmsDeleteTransform(hTransform: cmsHTRANSFORM); StdCall;
1509 PROCEDURE cmsDoTransform(Transform: cmsHTRANSFORM; InputBuffer, OutputBuffer: Pointer; size: cmsUInt32Number); StdCall;
1511 PROCEDURE cmsSetAlarmCodes( NewAlarm: LPcmsUInt16NumberArray); StdCall;
1512 PROCEDURE cmsGetAlarmCodes(NewAlarm: LPcmsUInt16NumberArray); StdCall;
1514 // Adaptation state for absolute colorimetric intent
1515 FUNCTION cmsSetAdaptationState(d: cmsFloat64Number):cmsFloat64Number; StdCall;
1517 // Grab the ContextID from an open transform. Returns NULL if a NULL transform is passed
1518 FUNCTION cmsGetTransformContextID(hTransform: cmsHTRANSFORM):cmsContext; StdCall;
1520 // For backwards compatibility
1521 FUNCTION cmsChangeBuffersFormat(hTransform: cmsHTRANSFORM; InputFormat, OutputFormat: cmsUInt32Number): cmsBool; StdCall;
1525 // PostScript ColorRenderingDictionary and ColorSpaceArray ----------------------------------------------------
1527 Type
1529 cmsPSResourceType = (cmsPS_RESOURCE_CSA, cmsPS_RESOURCE_CRD ) ;
1531 // lcms2 unified method to access postscript color resources
1532 FUNCTION cmsGetPostScriptColorResource(ContextID: cmsContext; RType: cmsPSResourceType;
1533 hProfile: cmsHPROFILE;
1534 Intent: cmsUInt32Number;
1535 dwFlags: cmsUInt32Number;
1536 io: LPcmsIOHANDLER): cmsUInt32Number; StdCall;
1538 FUNCTION cmsGetPostScriptCSA(ContextID: cmsContext; hProfile: cmsHPROFILE; Intent: cmsUInt32Number; dwFlags: cmsUInt32Number; Buffer: Pointer; dwBufferLen: cmsUInt32Number ): cmsUInt32Number; StdCall;
1539 FUNCTION cmsGetPostScriptCRD(ContextID: cmsContext; hProfile: cmsHPROFILE; Intent: cmsUInt32Number; dwFlags: cmsUInt32Number; Buffer: Pointer; dwBufferLen: cmsUInt32Number): cmsUInt32Number; StdCall;
1542 // IT8.7 / CGATS.17-20$ handling -----------------------------------------------------------------------------
1545 // CGATS.13 parser
1547 FUNCTION cmsIT8Alloc: cmsHANDLE; StdCall;
1548 PROCEDURE cmsIT8Free(hIT8: cmsHANDLE); StdCall;
1550 // Tables
1552 FUNCTION cmsIT8TableCount(hIT8: cmsHANDLE): Integer; StdCall;
1553 FUNCTION cmsIT8SetTable(hIT8: cmsHANDLE; nTable: Integer): Integer; StdCall;
1555 // Persistence
1556 FUNCTION cmsIT8LoadFromFile(cFileName: PAnsiChar): cmsHANDLE; StdCall;
1557 FUNCTION cmsIT8LoadFromMem(Ptr: Pointer; size :DWord): cmsHANDLE; StdCall;
1559 FUNCTION cmsIT8SaveToFile(hIT8: cmsHANDLE; cFileName: PAnsiChar): cmsBool; StdCall;
1560 FUNCTION cmsIT8SaveToMem(hIT8: cmsHANDLE; MemPtr: Pointer; BytesNeeded: LPcmsUInt32Number): cmsBool; StdCall;
1561 // Properties
1563 FUNCTION cmsIT8GetSheetType(hIT8: cmsHANDLE): PAnsiChar; StdCall;
1564 FUNCTION cmsIT8SetSheetType(hIT8: cmsHANDLE; TheType: PAnsiChar): cmsBool; StdCall;
1566 FUNCTION cmsIT8SetComment(hIT8: cmsHANDLE; cComment: PAnsiChar): cmsBool; StdCall;
1568 FUNCTION cmsIT8SetPropertyStr(hIT8: cmsHANDLE; cProp, Str: PAnsiChar): cmsBool; StdCall;
1569 FUNCTION cmsIT8SetPropertyDbl(hIT8: cmsHANDLE; cProp: PAnsiChar; Val: Double): cmsBool; StdCall;
1570 FUNCTION cmsIT8SetPropertyHex(hIT8: cmsHANDLE; cProp: PAnsiChar; Val: Integer): cmsBool; StdCall;
1571 FUNCTION cmsIT8SetPropertyUncooked(hIT8: cmsHANDLE; Key, Buffer: PAnsiChar): cmsBool; StdCall;
1574 FUNCTION cmsIT8GetProperty(hIT8: cmsHANDLE; cProp: PAnsiChar): PAnsiChar; StdCall;
1575 FUNCTION cmsIT8GetPropertyDbl(hIT8: cmsHANDLE; cProp: PAnsiChar): Double; StdCall;
1576 FUNCTION cmsIT8EnumProperties(hIT8: cmsHANDLE; var PropertyNames: LPPAnsiChar): Integer; StdCall;
1578 // Datasets
1580 FUNCTION cmsIT8GetDataRowCol(hIT8: cmsHANDLE; row, col: Integer): PAnsiChar; StdCall;
1581 FUNCTION cmsIT8GetDataRowColDbl(hIT8: cmsHANDLE; row, col: Integer): Double; StdCall;
1583 FUNCTION cmsIT8SetDataRowCol(hIT8: cmsHANDLE; row, col: Integer; Val: PAnsiChar): cmsBool; StdCall;
1584 FUNCTION cmsIT8SetDataRowColDbl(hIT8: cmsHANDLE; row, col: Integer; Val: Double): cmsBool; StdCall;
1586 FUNCTION cmsIT8GetData(hIT8: cmsHANDLE; cPatch, cSample: PAnsiChar): PAnsiChar; StdCall;
1588 FUNCTION cmsIT8GetDataDbl(hIT8: cmsHANDLE;cPatch, cSample: PAnsiChar): Double; StdCall;
1590 FUNCTION cmsIT8SetData(hIT8: cmsHANDLE; cPatch, cSample, Val: PAnsiChar): cmsBool; StdCall;
1592 FUNCTION cmsIT8SetDataDbl(hIT8: cmsHANDLE; cPatch, cSample: PAnsiChar; Val: Double): cmsBool; StdCall;
1594 FUNCTION cmsIT8SetDataFormat(hIT8: cmsHANDLE; n: Integer; Sample: PAnsiChar): cmsBool; StdCall;
1595 FUNCTION cmsIT8EnumDataFormat(hIT8: cmsHANDLE; var SampleNames: LPPAnsiChar): Integer; StdCall;
1596 FUNCTION cmsIT8GetPatchName(hIT8: cmsHANDLE; nPatch: Integer; Buffer: PAnsiChar): PAnsiChar; StdCall;
1598 // The LABEL extension
1599 FUNCTION cmsIT8SetTableByLabel(hIT8: cmsHANDLE; cSet, cField, ExpectedType: PAnsiChar): Integer; StdCall;
1601 FUNCTION cmsIT8FindDataFormat(hIT8: cmsHANDLE; cSample: PAnsiChar): Integer; StdCall;
1603 // Formatter for double
1604 PROCEDURE cmsIT8DefineDblFormat(hIT8: cmsHANDLE; Formatter: PAnsiChar); StdCall;
1606 // Gamut boundary description routines ------------------------------------------------------------------------------
1608 FUNCTION cmsGBDAlloc(ContextID: cmsContext):cmsHANDLE; StdCall;
1609 PROCEDURE cmsGBDFree(hGBD: cmsHANDLE); StdCall;
1610 FUNCTION cmsGDBAddPoint(hGBD: cmsHANDLE; Lab: LPcmsCIELab): cmsBool; StdCall;
1611 FUNCTION cmsGDBCompute(hGDB: cmsHANDLE; dwFlags: cmsUInt32Number): cmsBool; StdCall;
1612 FUNCTION cmsGDBCheckPoint(hGBD: cmsHANDLE; Lab: LPcmsCIELab): cmsBool; StdCall;
1614 // Feature detection ----------------------------------------------------------------------------------------------
1616 // Estimate the black point
1617 FUNCTION cmsDetectBlackPoint( BlackPoint: LPcmsCIEXYZ; hProfile: cmsHPROFILE; Intent: cmsUInt32Number; dwFlags: cmsUInt32Number): cmsBool; StdCall;
1618 FUNCTION cmsDetectDestinationBlackPoint( BlackPoint: LPcmsCIEXYZ; hProfile: cmsHPROFILE; Intent: cmsUInt32Number; dwFlags: cmsUInt32Number): cmsBool; StdCall;
1621 // Estimate total area coverage
1622 FUNCTION cmsDetectTAC(hProfile: cmsHPROFILE): cmsFloat64Number; StdCall;
1625 // Poor man's gamut mapping
1626 FUNCTION cmsDesaturateLab(Lab: LPcmsCIELab; amax, amin, bmax, bmin: cmsFloat64Number): cmsBool; StdCall;
1629 IMPLEMENTATION
1633 FUNCTION FLOAT_SH(a: cmsUInt32Number): cmsUInt32Number; begin FLOAT_SH := ((a) shl 22) end;
1634 FUNCTION OPTIMIZED_SH(s: cmsUInt32Number): cmsUInt32Number; begin OPTIMIZED_SH := ((s) shl 21) end;
1635 FUNCTION COLORSPACE_SH(s: cmsUInt32Number):cmsUInt32Number; begin COLORSPACE_SH := ((s) shl 16) end;
1636 FUNCTION SWAPFIRST_SH(s: cmsUInt32Number):cmsUInt32Number; begin SWAPFIRST_SH := ((s) shl 14) end;
1637 FUNCTION FLAVOR_SH(s: cmsUInt32Number):cmsUInt32Number; begin FLAVOR_SH := ((s) shl 13) end;
1638 FUNCTION PLANAR_SH(p: cmsUInt32Number):cmsUInt32Number; begin PLANAR_SH := ((p) shl 12) end;
1639 FUNCTION ENDIAN16_SH(e: cmsUInt32Number):cmsUInt32Number; begin ENDIAN16_SH := ((e) shl 11) end;
1640 FUNCTION DOSWAP_SH(e: cmsUInt32Number):cmsUInt32Number; begin DOSWAP_SH := ((e) shl 10) end;
1641 FUNCTION EXTRA_SH(e: cmsUInt32Number):cmsUInt32Number; begin EXTRA_SH := ((e) shl 7) end;
1642 FUNCTION CHANNELS_SH(c: cmsUInt32Number):cmsUInt32Number; begin CHANNELS_SH := ((c) shl 3) end;
1643 FUNCTION BYTES_SH(b: cmsUInt32Number):cmsUInt32Number; begin BYTES_SH := (b) end;
1646 FUNCTION T_FLOAT(a: cmsUInt32Number): cmsUInt32Number; begin T_FLOAT := (((a) shr 22) and 1) end;
1647 FUNCTION T_OPTIMIZED(o: cmsUInt32Number): cmsUInt32Number; begin T_OPTIMIZED := (((o) shr 21) and 1) end;
1648 FUNCTION T_COLORSPACE(s: cmsUInt32Number): cmsUInt32Number; begin T_COLORSPACE := (((s) shr 16) and 31) end;
1649 FUNCTION T_SWAPFIRST(s: cmsUInt32Number): cmsUInt32Number; begin T_SWAPFIRST := (((s) shr 14) and 1) end;
1650 FUNCTION T_FLAVOR(s: cmsUInt32Number): cmsUInt32Number; begin T_FLAVOR := (((s) shr 13) and 1) end;
1651 FUNCTION T_PLANAR(p: cmsUInt32Number): cmsUInt32Number; begin T_PLANAR := (((p) shr 12) and 1) end;
1652 FUNCTION T_ENDIAN16(e: cmsUInt32Number): cmsUInt32Number; begin T_ENDIAN16 := (((e) shr 11) and 1) end;
1653 FUNCTION T_DOSWAP(e: cmsUInt32Number): cmsUInt32Number; begin T_DOSWAP := (((e) shr 10) and 1) end;
1654 FUNCTION T_EXTRA(e: cmsUInt32Number): cmsUInt32Number; begin T_EXTRA := (((e) shr 7) and 7) end;
1655 FUNCTION T_CHANNELS(c: cmsUInt32Number): cmsUInt32Number; begin T_CHANNELS := (((c) shr 3) and 15) end;
1656 FUNCTION T_BYTES(b: cmsUInt32Number): cmsUInt32Number; begin T_BYTES := ((b) and 7) end;
1663 FUNCTION cmsPlugin(Plugin: Pointer): cmsBool; StdCall; external 'lcms2.dll';
1664 PROCEDURE cmsUnregisterPlugins; StdCall; external 'lcms2.dll';
1665 PROCEDURE cmsSetLogErrorHandler(Fn: cmsLogErrorHandlerFunction); StdCall; external 'lcms2.dll';
1666 FUNCTION cmsD50_XYZ: LPcmsCIEXYZ; StdCall; external 'lcms2.dll';
1667 FUNCTION cmsD50_xyY: LPcmsCIExyY; StdCall; external 'lcms2.dll';
1668 PROCEDURE cmsXYZ2xyY(Dest: LPcmsCIExyY; Source: LPcmsCIEXYZ); StdCall; external 'lcms2.dll';
1669 PROCEDURE cmsxyY2XYZ(Dest: LPcmsCIEXYZ; Source: LPcmsCIExyY); StdCall; external 'lcms2.dll';
1670 PROCEDURE cmsLab2XYZ(WhitePoint: LPcmsCIEXYZ; xyz: LPcmsCIEXYZ; Lab: LPcmsCIELab); StdCall; external 'lcms2.dll';
1671 PROCEDURE cmsXYZ2Lab(WhitePoint: LPcmsCIEXYZ; Lab: LPcmsCIELab; xyz: LPcmsCIEXYZ); StdCall; external 'lcms2.dll';
1672 PROCEDURE cmsLab2LCh(LCh: LPcmsCIELCh; Lab: LPcmsCIELab); StdCall; external 'lcms2.dll';
1673 PROCEDURE cmsLCh2Lab(Lab: LPcmsCIELab; LCh: LPcmsCIELCh); StdCall; external 'lcms2.dll';
1674 PROCEDURE cmsLabEncoded2Float(Lab: LPcmsCIELab; wLab: Pointer); StdCall; external 'lcms2.dll';
1675 PROCEDURE cmsLabEncoded2FloatV2(Lab: LPcmsCIELab; wLab: Pointer); StdCall; external 'lcms2.dll';
1676 PROCEDURE cmsFloat2LabEncoded(wLab: Pointer; Lab: LPcmsCIELab); StdCall; external 'lcms2.dll';
1677 PROCEDURE cmsFloat2LabEncodedV2(wLab: Pointer; Lab: LPcmsCIELab); StdCall; external 'lcms2.dll';
1678 PROCEDURE cmsXYZEncoded2Float(fxyz : LPcmsCIEXYZ; XYZ: Pointer); StdCall; external 'lcms2.dll';
1679 PROCEDURE cmsFloat2XYZEncoded(XYZ: Pointer; fXYZ: LPcmsCIEXYZ); StdCall; external 'lcms2.dll';
1680 FUNCTION cmsDeltaE(Lab1, Lab2: LPcmsCIELab): Double; StdCall; external 'lcms2.dll';
1681 FUNCTION cmsCIE94DeltaE(Lab1, Lab2: LPcmsCIELab): Double; StdCall; external 'lcms2.dll';
1682 FUNCTION cmsBFDdeltaE(Lab1, Lab2: LPcmsCIELab): Double; StdCall; external 'lcms2.dll';
1683 FUNCTION cmsCMCdeltaE(Lab1, Lab2: LPcmsCIELab): Double; StdCall; external 'lcms2.dll';
1684 FUNCTION cmsCIE2000DeltaE(Lab1, Lab2: LPcmsCIELab; Kl, Kc, Kh: Double): Double; StdCall; external 'lcms2.dll';
1685 FUNCTION cmsWhitePointFromTemp(var WhitePoint: cmsCIExyY; TempK: cmsFloat64Number) : cmsBool; StdCall; external 'lcms2.dll';
1686 FUNCTION cmsTempFromWhitePoint(var TeampK: cmsFloat64Number; var WhitePoint: cmsCIExyY) : cmsBool; StdCall; external 'lcms2.dll';
1687 FUNCTION cmsAdaptToIlluminant(Result: LPcmsCIEXYZ; SourceWhitePt: LPcmsCIEXYZ;
1688 Illuminant: LPcmsCIEXYZ; Value: LPcmsCIEXYZ): cmsBool; StdCall; external 'lcms2.dll';
1689 FUNCTION cmsCIECAM02Init(pVC : LPcmsViewingConditions ) : Pointer; StdCall; external 'lcms2.dll';
1690 PROCEDURE cmsCIECAM02Done(hModel : Pointer); StdCall; external 'lcms2.dll';
1691 PROCEDURE cmsCIECAM02Forward(hModel: Pointer; pIn: LPcmsCIEXYZ; pOut: LPcmsJCh ); StdCall; external 'lcms2.dll';
1692 PROCEDURE cmsCIECAM02Reverse(hModel: Pointer; pIn: LPcmsJCh; pOut: LPcmsCIEXYZ ); StdCall; external 'lcms2.dll';
1693 FUNCTION cmsBuildSegmentedToneCurve(ContextID: cmsContext; nSegments: cmsInt32Number; Segments: LPcmsCurveSegmentArray): LPcmsToneCurve; StdCall; external 'lcms2.dll';
1694 FUNCTION cmsBuildParametricToneCurve(ContextID: cmsContext; CType: cmsInt32Number; Params: LPcmsFloat64NumberArray): LPcmsToneCurve; StdCall; external 'lcms2.dll';
1695 FUNCTION cmsBuildGamma(ContextID: cmsContext; Gamma: cmsFloat64Number): LPcmsToneCurve; StdCall; external 'lcms2.dll';
1696 FUNCTION cmsBuildTabulatedToneCurve16(ContextID: cmsContext; nEntries: cmsInt32Number; values: LPcmsUInt16NumberArray): LPcmsToneCurve; StdCall; external 'lcms2.dll';
1697 FUNCTION cmsBuildTabulatedToneCurveFloat(ContextID: cmsContext; nEntries: cmsUInt32Number; values: LPcmsFloat32NumberArray): LPcmsToneCurve; StdCall; external 'lcms2.dll';
1698 PROCEDURE cmsFreeToneCurve(Curve: LPcmsToneCurve); StdCall; external 'lcms2.dll';
1699 PROCEDURE cmsFreeToneCurveTriple(Curve: LPLPcmsToneCurveArray); StdCall; external 'lcms2.dll';
1700 FUNCTION cmsDupToneCurve(Src: LPcmsToneCurve): LPcmsToneCurve; StdCall; external 'lcms2.dll';
1701 FUNCTION cmsReverseToneCurve(InGamma: LPcmsToneCurve): LPcmsToneCurve; StdCall; external 'lcms2.dll';
1702 FUNCTION cmsReverseToneCurveEx(nResultSamples: cmsInt32Number; InGamma: LPcmsToneCurve): LPcmsToneCurve; StdCall; external 'lcms2.dll';
1703 FUNCTION cmsJoinToneCurve(ContextID: cmsContext; X, Y: LPcmsToneCurve; nPoints: cmsUInt32Number ): LPcmsToneCurve; StdCall; external 'lcms2.dll';
1704 FUNCTION cmsSmoothToneCurve(Tab: LPcmsToneCurve; lambda: cmsFloat64Number): cmsBool; StdCall; external 'lcms2.dll';
1705 FUNCTION cmsEvalToneCurveFloat(Curve: LPcmsToneCurve; v: cmsFloat32Number):cmsFloat32Number; StdCall; external 'lcms2.dll';
1706 FUNCTION cmsEvalToneCurve16(Curve: LPcmsToneCurve; v:cmsUInt16Number):cmsUInt16Number; StdCall; external 'lcms2.dll';
1707 FUNCTION cmsIsToneCurveMultisegment(InGamma: LPcmsToneCurve):cmsBool; StdCall; external 'lcms2.dll';
1708 FUNCTION cmsIsToneCurveLinear(Curve: LPcmsToneCurve):cmsBool; StdCall; external 'lcms2.dll';
1709 FUNCTION cmsIsToneCurveMonotonic(t: LPcmsToneCurve):cmsBool; StdCall; external 'lcms2.dll';
1710 FUNCTION cmsIsToneCurveDescending(t: LPcmsToneCurve):cmsBool; StdCall; external 'lcms2.dll';
1711 FUNCTION cmsGetToneCurveParametricType(t: LPcmsToneCurve):cmsInt32Number; StdCall; external 'lcms2.dll';
1712 FUNCTION cmsEstimateGamma(t: LPcmsToneCurve; Precision:cmsFloat64Number):cmsFloat64Number; StdCall; external 'lcms2.dll';
1713 FUNCTION cmsPipelineAlloc(ContextID: cmsContext; InputChannels, OutputChannels: cmsUInt32Number): LPcmsPipeline; StdCall; external 'lcms2.dll';
1714 PROCEDURE cmsPipelineFree(lut: LPcmsPipeline); StdCall; external 'lcms2.dll';
1715 FUNCTION cmsPipelineDup(Orig: LPcmsPipeline): LPcmsPipeline; StdCall; external 'lcms2.dll';
1716 FUNCTION cmsPipelineInputChannels(lut: LPcmsPipeline): cmsUInt32Number; StdCall; external 'lcms2.dll';
1717 FUNCTION cmsPipelineOutputChannels(lut: LPcmsPipeline): cmsUInt32Number; StdCall; external 'lcms2.dll';
1718 FUNCTION cmsPipelineStageCount(lut: LPcmsPipeline): cmsUInt32Number; StdCall; external 'lcms2.dll';
1719 FUNCTION cmsPipelineGetPtrToFirstStage(lut: LPcmsPipeline): LPcmsStage; StdCall; external 'lcms2.dll';
1720 FUNCTION cmsPipelineGetPtrToLastStage(lut: LPcmsPipeline): LPcmsStage; StdCall; external 'lcms2.dll';
1722 PROCEDURE cmsPipelineEval16(Inv, Outv: LPcmsUInt16NumberArray; lut: LPcmsPipeline); StdCall; external 'lcms2.dll';
1723 PROCEDURE cmsPipelineEvalFloat(Inv, Outv: LPcmsFloat32NumberArray; lut: LPcmsPipeline); StdCall; external 'lcms2.dll';
1725 FUNCTION cmsPipelineEvalReverseFloat(Target, Result, Hint: LPcmsFloat32NumberArray; lut: LPcmsPipeline): cmsBool; StdCall; external 'lcms2.dll';
1726 FUNCTION cmsPipelineCat(l1, l2: LPcmsPipeline): cmsBool; StdCall; external 'lcms2.dll';
1727 FUNCTION cmsPipelineSetSaveAs8bitsFlag(lut: LPcmsPipeline; On: cmsBool): cmsBool; StdCall; external 'lcms2.dll';
1728 PROCEDURE cmsPipelineInsertStage(lut: LPcmsPipeline; loc: cmsStageLoc; mpe: LPcmsStage); StdCall; external 'lcms2.dll';
1729 PROCEDURE cmsPipelineUnlinkStage(lut: LPcmsPipeline; loc: cmsStageLoc; mpe: LPLPcmsStage); StdCall; external 'lcms2.dll';
1730 FUNCTION cmsStageAllocIdentity(ContextID: cmsContext; nChannels: cmsUInt32Number): LPcmsStage; StdCall; external 'lcms2.dll';
1731 FUNCTION cmsStageAllocToneCurves(ContextID: cmsContext; nChannels: cmsUInt32Number; Curves: LPLPcmsToneCurveArray): LPcmsStage; StdCall; external 'lcms2.dll';
1732 FUNCTION cmsStageAllocMatrix(ContextID: cmsContext; Rows, Cols: cmsUInt32Number; Matrix, Offset: LPcmsFloat64NumberArray): LPcmsStage; StdCall; external 'lcms2.dll';
1733 FUNCTION cmsStageAllocCLut16bit(ContextID: cmsContext; nGridPoints: cmsUInt32Number; inputChan, outputChan: cmsUInt32Number; Table: LPcmsUInt16NumberArray): LPcmsStage; StdCall; external 'lcms2.dll';
1734 FUNCTION cmsStageAllocCLutFloat(ContextID: cmsContext; nGridPoints: cmsUInt32Number; inputChan, outputChan: cmsUInt32Number; Table: LPcmsFloat32NumberArray): LPcmsStage; StdCall; external 'lcms2.dll';
1735 FUNCTION cmsStageAllocCLut16bitGranular(ContextID: cmsContext; nGridPoints: LPcmsUInt32NumberArray; inputChan, outputChan: cmsUInt32Number; Table: LPcmsUInt16NumberArray): LPcmsStage; StdCall; external 'lcms2.dll';
1736 FUNCTION cmsStageAllocCLutFloatGranular(ContextID: cmsContext; nGridPoints: LPcmsUInt32NumberArray; inputChan, outputChan: cmsUInt32Number; Table: LPcmsFloat32NumberArray): LPcmsStage; StdCall; external 'lcms2.dll';
1737 FUNCTION cmsStageDup(mpe: LPcmsStage): LPcmsStage; StdCall; external 'lcms2.dll';
1738 PROCEDURE cmsStageFree(mpe: LPcmsStage); StdCall; external 'lcms2.dll';
1739 FUNCTION cmsStageNext(mpe: LPcmsStage): LPcmsStage; StdCall; external 'lcms2.dll';
1740 FUNCTION cmsStageInputChannels(mpe: LPcmsStage): cmsUInt32Number; StdCall; external 'lcms2.dll';
1741 FUNCTION cmsStageOutputChannels(mpe: LPcmsStage): cmsUInt32Number; StdCall; external 'lcms2.dll';
1742 FUNCTION cmsStageType(mpe: LPcmsStage): cmsStageSignature; StdCall; external 'lcms2.dll';
1743 FUNCTION cmsStageData(mpe: LPcmsStage): Pointer; StdCall; external 'lcms2.dll';
1744 FUNCTION cmsStageSampleCLut16bit(mpe: LPcmsStage; Sampler: cmsSAMPLER16; Cargo: Pointer; dwFlags: cmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
1745 FUNCTION cmsStageSampleCLutFloat(mpe: LPcmsStage; Sampler: cmsSAMPLERFLOAT; Cargo: Pointer; dwFlags: cmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
1746 FUNCTION cmsSliceSpace16(nInputs: cmsUInt32Number; clutPoints: LPcmsUInt32NumberArray;
1747 Sampler: cmsSAMPLER16; Cargo: Pointer): cmsBool; StdCall; external 'lcms2.dll';
1749 FUNCTION cmsSliceSpaceFloat(nInputs: cmsUInt32Number; clutPoints: LPcmsUInt32NumberArray;
1750 Sampler: cmsSAMPLERFLOAT; Cargo: Pointer): cmsBool; StdCall; external 'lcms2.dll';
1751 FUNCTION cmsMLUalloc(ContextID: cmsContext; nItems: cmsUInt32Number): LPcmsMLU; StdCall; external 'lcms2.dll';
1752 PROCEDURE cmsMLUfree(mlu: LPcmsMLU); StdCall; external 'lcms2.dll';
1753 FUNCTION cmsMLUdup(mlu: LPcmsMLU): LPcmsMLU; StdCall; external 'lcms2.dll';
1755 FUNCTION cmsMLUsetASCII(mlu: LPcmsMLU; LanguageCode, CountryCode, ASCIIString: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
1756 FUNCTION cmsMLUsetWide(mlu: LPcmsMLU; LanguageCode, CountryCode: PAnsiChar; WideString: PWChar): cmsBool; StdCall; external 'lcms2.dll';
1758 FUNCTION cmsMLUgetASCII(mlu: LPcmsMLU; LanguageCode, CountryCode: PAnsiChar; Buffer: PAnsiChar; BufferSize: cmsUInt32Number): cmsUInt32Number; StdCall; external 'lcms2.dll';
1760 FUNCTION cmsMLUgetWide(mlu: LPcmsMLU; LanguageCode, CountryCode: PAnsiChar; Buffer: PWChar; BufferSize: cmsUInt32Number): cmsUInt32Number; StdCall; external 'lcms2.dll';
1762 FUNCTION cmsMLUgetTranslation(mlu: LPcmsMLU; LanguageCode, CountryCode, ObtainedLanguage, ObtainedCountry: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
1764 FUNCTION cmsAllocNamedColorList(ContextID: cmsContext; n, ColorantCount :cmsUInt32Number;
1765 Prefix, Suffix: PAnsiChar): LPcmsNAMEDCOLORLIST; StdCall; external 'lcms2.dll';
1767 PROCEDURE cmsFreeNamedColorList(v: LPcmsNAMEDCOLORLIST); StdCall; external 'lcms2.dll';
1768 FUNCTION cmsDupNamedColorList(v: LPcmsNAMEDCOLORLIST): LPcmsNAMEDCOLORLIST; StdCall; external 'lcms2.dll';
1769 FUNCTION cmsAppendNamedColor(v: LPcmsNAMEDCOLORLIST; Name: PAnsiChar;
1770 PCS, Colorant : LPcmsUInt16NumberArray): cmsBool; StdCall; external 'lcms2.dll';
1772 FUNCTION cmsNamedColorCount(v: LPcmsNAMEDCOLORLIST): cmsUInt32Number; StdCall; external 'lcms2.dll';
1773 FUNCTION cmsNamedColorIndex(v: LPcmsNAMEDCOLORLIST; Name: PAnsiChar): cmsInt32Number; StdCall; external 'lcms2.dll';
1775 FUNCTION cmsNamedColorInfo(v: LPcmsNAMEDCOLORLIST; nColor : cmsUInt32Number;
1776 Name,Prefix, Suffix : PAnsiChar;
1777 PCS, Colorant : LPcmsUInt16NumberArray): cmsBool; StdCall; external 'lcms2.dll';
1779 FUNCTION cmsGetNamedColorList(xform: cmsHTRANSFORM ): LPcmsNAMEDCOLORLIST; StdCall; external 'lcms2.dll';
1781 FUNCTION cmsAllocProfileSequenceDescription(ContextID: cmsContext; n: cmsUInt32Number):LPcmsSEQ; StdCall; external 'lcms2.dll';
1782 FUNCTION cmsDupProfileSequenceDescription(pseq: LPcmsSEQ):LPcmsSEQ; StdCall; external 'lcms2.dll';
1783 PROCEDURE cmsFreeProfileSequenceDescription(pseq: LPcmsSEQ); StdCall; external 'lcms2.dll';
1785 FUNCTION cmsDictAlloc(ContextID: cmsContext): cmsHANDLE; StdCall; external 'lcms2.dll';
1786 PROCEDURE cmsDictFree(hDict: cmsHANDLE); StdCall; external 'lcms2.dll';
1787 FUNCTION cmsDictDup(hDict: cmsHANDLE): cmsHANDLE; StdCall; external 'lcms2.dll';
1789 FUNCTION cmsDictAddEntry(hDict: cmsHANDLE; Name, Value: PWChar; DisplayName, DisplayValue : LPcmsMLU): cmsBool; StdCall; external 'lcms2.dll';
1790 FUNCTION cmsDictGetEntryList(hDict: cmsHANDLE): LPcmsDICTentry; StdCall; external 'lcms2.dll';
1791 FUNCTION cmsDictNextEntry(e : LPcmsDICTentry): LPcmsDICTentry; StdCall; external 'lcms2.dll';
1793 FUNCTION cmsCreateProfilePlaceholder(ContextID: cmsContext): cmsHPROFILE; StdCall; external 'lcms2.dll';
1795 FUNCTION cmsGetProfileContextID(hProfile: cmsHPROFILE):cmsContext; StdCall; external 'lcms2.dll';
1796 FUNCTION cmsGetTagCount(hProfile: cmsHPROFILE): cmsInt32Number; StdCall; external 'lcms2.dll';
1797 FUNCTION cmsGetTagSignature(hProfile: cmsHPROFILE; n: cmsUInt32Number): cmsTagSignature; StdCall; external 'lcms2.dll';
1798 FUNCTION cmsIsTag(hProfile: cmsHPROFILE; sig: cmsTagSignature ): cmsBool; StdCall; external 'lcms2.dll';
1800 FUNCTION cmsReadTag(hProfile: cmsHPROFILE; sig: cmsTagSignature ): Pointer; StdCall; external 'lcms2.dll';
1801 FUNCTION cmsWriteTag(hProfile: cmsHPROFILE; sig: cmsTagSignature; data: Pointer): cmsBool; StdCall; external 'lcms2.dll';
1802 FUNCTION cmsLinkTag(hProfile: cmsHPROFILE; sig: cmsTagSignature; dest: cmsTagSignature): cmsBool; StdCall; external 'lcms2.dll';
1803 FUNCTION cmsTagLinkedTo(hProfile: cmsHPROFILE; sig: cmsTagSignature):cmsTagSignature; StdCall; external 'lcms2.dll';
1805 FUNCTION cmsReadRawTag(hProfile: cmsHPROFILE; sig: cmsTagSignature; Buffer: Pointer; BufferSize: cmsUInt32Number): cmsInt32Number; StdCall; external 'lcms2.dll';
1806 FUNCTION cmsWriteRawTag(hProfile: cmsHPROFILE; sig: cmsTagSignature; data: Pointer; Size: cmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
1808 FUNCTION cmsGetHeaderFlags(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall; external 'lcms2.dll';
1809 PROCEDURE cmsGetHeaderAttributes(hProfile: cmsHPROFILE; Flags: LPcmsUInt64Number); StdCall; external 'lcms2.dll';
1810 PROCEDURE cmsGetHeaderProfileID(hProfile: cmsHPROFILE; ProfileID: LPcmsUInt8Number); StdCall; external 'lcms2.dll';
1812 FUNCTION cmsGetHeaderRenderingIntent(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall; external 'lcms2.dll';
1813 PROCEDURE cmsSetHeaderFlags(hProfile: cmsHPROFILE; Flags: cmsUInt32Number); StdCall; external 'lcms2.dll';
1814 FUNCTION cmsGetHeaderManufacturer(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall; external 'lcms2.dll';
1815 PROCEDURE cmsSetHeaderManufacturer(hProfile: cmsHPROFILE; manufacturer: cmsUInt32Number ); StdCall; external 'lcms2.dll';
1816 FUNCTION cmsGetHeaderModel(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall; external 'lcms2.dll';
1817 PROCEDURE cmsSetHeaderModel(hProfile: cmsHPROFILE; model: cmsUInt32Number ); StdCall; external 'lcms2.dll';
1818 PROCEDURE cmsSetHeaderAttributes(hProfile: cmsHPROFILE; Flags: cmsUInt64Number); StdCall; external 'lcms2.dll';
1819 PROCEDURE cmsSetHeaderProfileID(hProfile: cmsHPROFILE; ProfileID: LPcmsUInt8Number); StdCall; external 'lcms2.dll';
1820 PROCEDURE cmsSetHeaderRenderingIntent(hProfile: cmsHPROFILE; RenderingIntent: cmsUInt32Number ); StdCall; external 'lcms2.dll';
1822 FUNCTION cmsGetPCS(hProfile: cmsHPROFILE):cmsColorSpaceSignature; StdCall; external 'lcms2.dll';
1823 PROCEDURE cmsSetPCS(hProfile: cmsHPROFILE; pcs: cmsColorSpaceSignature); StdCall; external 'lcms2.dll';
1824 FUNCTION cmsGetColorSpace(hProfile: cmsHPROFILE): cmsColorSpaceSignature; StdCall; external 'lcms2.dll';
1825 PROCEDURE cmsSetColorSpace(hProfile: cmsHPROFILE; sig: cmsColorSpaceSignature); StdCall; external 'lcms2.dll';
1826 FUNCTION cmsGetDeviceClass(hProfile: cmsHPROFILE): cmsProfileClassSignature; StdCall; external 'lcms2.dll';
1827 PROCEDURE cmsSetDeviceClass(hProfile: cmsHPROFILE; sig: cmsProfileClassSignature); StdCall; external 'lcms2.dll';
1828 PROCEDURE cmsSetProfileVersion(hProfile: cmsHPROFILE; Version: cmsFloat64Number); StdCall; external 'lcms2.dll';
1829 FUNCTION cmsGetProfileVersion(hProfile: cmsHPROFILE): cmsFloat64Number; StdCall; external 'lcms2.dll';
1831 FUNCTION cmsGetEncodedICCversion(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall; external 'lcms2.dll';
1832 PROCEDURE cmsSetEncodedICCversion(hProfile: cmsHPROFILE; Version: cmsUInt32Number); StdCall; external 'lcms2.dll';
1835 FUNCTION cmsIsIntentSupported(hProfile: cmsHPROFILE; Intent: cmsUInt32Number; UsedDirection: cmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
1836 FUNCTION cmsIsMatrixShaper(hProfile: cmsHPROFILE): cmsBool; StdCall; external 'lcms2.dll';
1837 FUNCTION cmsIsCLUT(hProfile: cmsHPROFILE; Intent: cmsUInt32Number; UsedDirection: cmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
1838 FUNCTION _cmsICCcolorSpace(OurNotation: Integer): cmsColorSpaceSignature; StdCall; external 'lcms2.dll';
1839 FUNCTION _cmsLCMScolorSpace(ProfileSpace: cmsColorSpaceSignature): Integer; StdCall; external 'lcms2.dll';
1841 FUNCTION cmsChannelsOf( ColorSpace: cmsColorSpaceSignature): cmsUInt32Number; StdCall; external 'lcms2.dll';
1843 FUNCTION cmsFormatterForColorspaceOfProfile(hProfile: cmsHPROFILE; nBytes: cmsUInt32Number; lIsFloat: cmsBool): cmsUInt32Number; StdCall; external 'lcms2.dll';
1844 FUNCTION cmsFormatterForPCSOfProfile(hProfile: cmsHPROFILE; nBytes: cmsUInt32Number; lIsFloat: cmsBool): cmsUInt32Number; StdCall; external 'lcms2.dll';
1847 FUNCTION cmsGetProfileInfo(hProfile: cmsHPROFILE; Info: cmsInfoType; LanguageCode, CountryCode: PAnsiChar;
1848 Buffer: PWChar; BufferSize: cmsUInt32Number): cmsUInt32Number; StdCall; external 'lcms2.dll';
1850 FUNCTION cmsGetProfileInfoASCII(hProfile: cmsHPROFILE; Info: cmsInfoType; LanguageCode, CountryCode: PAnsiChar;
1851 Buffer: PAnsiChar; BufferSize: cmsUInt32Number): cmsUInt32Number; StdCall; external 'lcms2.dll';
1854 FUNCTION cmsOpenIOhandlerFromFile(ContextID: cmsContext; FileName, AccessMode: PAnsiChar): LPcmsIOHANDLER; StdCall; external 'lcms2.dll';
1855 // FUNCTION cmsOpenIOhandlerFromStream(ContextID: cmsContext; FILE* Stream): LPcmsIOHANDLER; StdCall; external 'lcms2.dll';
1856 FUNCTION cmsOpenIOhandlerFromMem(ContextID: cmsContext; Buffer: Pointer; size: cmsUInt32Number; AccessMode: PAnsiChar): LPcmsIOHANDLER; StdCall; external 'lcms2.dll';
1857 FUNCTION cmsOpenIOhandlerFromNULL(ContextID: cmsContext): LPcmsIOHANDLER; StdCall; external 'lcms2.dll';
1858 FUNCTION cmsCloseIOhandler(io: LPcmsIOHANDLER): cmsBool; StdCall; external 'lcms2.dll';
1860 FUNCTION cmsMD5computeID(hProfile: cmsHPROFILE): cmsBool; StdCall; external 'lcms2.dll';
1862 FUNCTION cmsOpenProfileFromFile(ICCProfile : PAnsiChar; sAccess: PAnsiChar): cmsHPROFILE; StdCall; external 'lcms2.dll';
1863 FUNCTION cmsOpenProfileFromFileTHR(ContextID: cmsContext; ICCProfile, sAccess: PAnsiChar): cmsHPROFILE; StdCall; external 'lcms2.dll';
1864 // FUNCTION CMSEXPORT cmsOpenProfileFromStream(FILE* ICCProfile, const char* sAccess): cmsHPROFILE; StdCall; external 'lcms2.dll';
1865 // FUNCTION CMSEXPORT cmsOpenProfileFromStreamTHR(ContextID: cmsContext; FILE* ICCProfile, const char* sAccess): cmsHPROFILE; StdCall; external 'lcms2.dll';
1866 FUNCTION cmsOpenProfileFromMem(MemPtr: Pointer; dwSize: cmsUInt32Number): cmsHPROFILE; StdCall; external 'lcms2.dll';
1867 FUNCTION cmsOpenProfileFromMemTHR(ContextID: cmsContext; MemPtr: Pointer; dwSize: cmsUInt32Number): cmsHPROFILE; StdCall; external 'lcms2.dll';
1868 FUNCTION cmsOpenProfileFromIOhandlerTHR(ContextID: cmsContext; io: LPcmsIOHANDLER): cmsHPROFILE; StdCall; external 'lcms2.dll';
1869 FUNCTION cmsCloseProfile(hProfile: cmsHPROFILE): cmsBool; StdCall; external 'lcms2.dll';
1871 FUNCTION cmsSaveProfileToFile(hProfile: cmsHPROFILE; FileName: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
1872 // FUNCTION CMSEXPORT cmsSaveProfileToStream(hProfile: cmsHPROFILE, FILE* Stream): cmsBool; StdCall; external 'lcms2.dll';
1873 FUNCTION cmsSaveProfileToMem(hProfile: cmsHPROFILE; MemPtr: Pointer; BytesNeeded: LPcmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
1874 FUNCTION cmsSaveProfileToIOhandler(hProfile: cmsHPROFILE; io: LPcmsIOHANDLER):cmsUInt32Number; StdCall; external 'lcms2.dll';
1876 FUNCTION cmsCreateRGBProfileTHR(ContextID: cmsContext;
1877 WhitePoint: LPcmsCIExyY;
1878 Primaries: LPcmsCIExyYTRIPLE;
1879 TransferFunction: LPLPcmsToneCurveArray): cmsHPROFILE; StdCall; external 'lcms2.dll';
1881 FUNCTION cmsCreateRGBProfile(WhitePoint: LPcmsCIExyY;
1882 Primaries: LPcmsCIExyYTRIPLE;
1883 TransferFunction: LPLPcmsToneCurveArray): cmsHPROFILE; StdCall; external 'lcms2.dll';
1885 FUNCTION cmsCreateGrayProfileTHR(ContextID: cmsContext;
1886 WhitePoint: LPcmsCIExyY;
1887 TransferFunction: LPcmsToneCurve): cmsHPROFILE; StdCall; external 'lcms2.dll';
1889 FUNCTION cmsCreateGrayProfile(WhitePoint: LPcmsCIExyY;
1890 TransferFunction: LPcmsToneCurve): cmsHPROFILE; StdCall; external 'lcms2.dll';
1892 FUNCTION cmsCreateLinearizationDeviceLinkTHR(ContextID: cmsContext;
1893 ColorSpace: cmsColorSpaceSignature;
1894 TransferFunctions: LPLPcmsToneCurveArray): cmsHPROFILE; StdCall; external 'lcms2.dll';
1896 FUNCTION cmsCreateLinearizationDeviceLink(ColorSpace: cmsColorSpaceSignature;
1897 TransferFunctions: LPLPcmsToneCurveArray): cmsHPROFILE; StdCall; external 'lcms2.dll';
1899 FUNCTION cmsCreateInkLimitingDeviceLinkTHR(ContextID: cmsContext;
1900 ColorSpace: cmsColorSpaceSignature; Limit: cmsFloat64Number): cmsHPROFILE; StdCall; external 'lcms2.dll';
1902 FUNCTION cmsCreateInkLimitingDeviceLink(ColorSpace: cmsColorSpaceSignature; Limit: cmsFloat64Number): cmsHPROFILE; StdCall; external 'lcms2.dll';
1905 FUNCTION cmsCreateLab2ProfileTHR(ContextID: cmsContext; WhitePoint: LPcmsCIExyY): cmsHPROFILE; StdCall; external 'lcms2.dll';
1906 FUNCTION cmsCreateLab2Profile(WhitePoint: LPcmsCIExyY): cmsHPROFILE; StdCall; external 'lcms2.dll';
1907 FUNCTION cmsCreateLab4ProfileTHR(ContextID: cmsContext; WhitePoint: LPcmsCIExyY): cmsHPROFILE; StdCall; external 'lcms2.dll';
1908 FUNCTION cmsCreateLab4Profile(WhitePoint: LPcmsCIExyY): cmsHPROFILE; StdCall; external 'lcms2.dll';
1910 FUNCTION cmsCreateXYZProfileTHR(ContextID: cmsContext): cmsHPROFILE; StdCall; external 'lcms2.dll';
1911 FUNCTION cmsCreateXYZProfile: cmsHPROFILE; StdCall; external 'lcms2.dll';
1913 FUNCTION cmsCreate_sRGBProfileTHR(ContextID: cmsContext): cmsHPROFILE; StdCall; external 'lcms2.dll';
1914 FUNCTION cmsCreate_sRGBProfile: cmsHPROFILE; StdCall; external 'lcms2.dll';
1916 FUNCTION cmsCreateBCHSWabstractProfileTHR(ContextID: cmsContext;
1917 nLUTPoints: Integer;
1918 Bright,
1919 Contrast,
1920 Hue,
1921 Saturation: cmsFloat64Number;
1922 TempSrc,
1923 TempDest: Integer): cmsHPROFILE; StdCall; external 'lcms2.dll';
1925 FUNCTION cmsCreateBCHSWabstractProfile( nLUTPoints: Integer;
1926 Bright,
1927 Contrast,
1928 Hue,
1929 Saturation: cmsFloat64Number;
1930 TempSrc,
1931 TempDest: Integer): cmsHPROFILE; StdCall; external 'lcms2.dll';
1933 FUNCTION cmsCreateNULLProfileTHR(ContextID: cmsContext): cmsHPROFILE; StdCall; external 'lcms2.dll';
1934 FUNCTION cmsCreateNULLProfile: cmsHPROFILE; StdCall; external 'lcms2.dll';
1936 // Converts a transform to a devicelink profile
1937 FUNCTION cmsTransform2DeviceLink(hTransform: cmsHTRANSFORM; Version: cmsFloat64Number; dwFlags: cmsUInt32Number): cmsHPROFILE; StdCall; external 'lcms2.dll';
1939 // Call with NULL as parameters to get the intent count
1940 FUNCTION cmsGetSupportedIntents(nMax: cmsUInt32Number; Codes: LPcmsUInt32Number; Descriptions: LPPAnsiChar): cmsUInt32Number; StdCall; external 'lcms2.dll';
1942 FUNCTION cmsFLAGS_GRIDPOINTS(n: Integer): Integer; begin cmsFLAGS_GRIDPOINTS := (((n) and $FF) shl 16) end;
1945 FUNCTION cmsCreateTransformTHR(ContextID: cmsContext;
1946 Input: cmsHPROFILE;
1947 InputFormat: cmsUInt32Number;
1948 Output: cmsHPROFILE;
1949 OutputFormat: cmsUInt32Number;
1950 Intent: cmsUInt32Number;
1951 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall; external 'lcms2.dll';
1953 FUNCTION cmsCreateTransform(Input: cmsHPROFILE;
1954 InputFormat: cmsUInt32Number;
1955 Output: cmsHPROFILE;
1956 OutputFormat: cmsUInt32Number;
1957 Intent: cmsUInt32Number;
1958 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall; external 'lcms2.dll';
1960 FUNCTION cmsCreateProofingTransformTHR(ContextID: cmsContext;
1961 Input: cmsHPROFILE;
1962 InputFormat: cmsUInt32Number;
1963 Output: cmsHPROFILE;
1964 OutputFormat: cmsUInt32Number;
1965 Proofing: cmsHPROFILE;
1966 Intent: cmsUInt32Number;
1967 ProofingIntent: cmsUInt32Number;
1968 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall; external 'lcms2.dll';
1970 FUNCTION cmsCreateProofingTransform(Input: cmsHPROFILE;
1971 InputFormat: cmsUInt32Number;
1972 Output: cmsHPROFILE;
1973 OutputFormat: cmsUInt32Number;
1974 Proofing: cmsHPROFILE;
1975 Intent: cmsUInt32Number;
1976 ProofingIntent: cmsUInt32Number;
1977 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall; external 'lcms2.dll';
1979 FUNCTION cmsCreateMultiprofileTransformTHR(ContextID: cmsContext;
1980 hProfiles: LPcmsHPROFILEArray;
1981 nProfiles: cmsUInt32Number;
1982 InputFormat: cmsUInt32Number;
1983 OutputFormat: cmsUInt32Number;
1984 Intent: cmsUInt32Number;
1985 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall; external 'lcms2.dll';
1988 FUNCTION cmsCreateMultiprofileTransform( hProfiles: LPcmsHPROFILEArray;
1989 nProfiles: cmsUInt32Number;
1990 InputFormat: cmsUInt32Number;
1991 OutputFormat: cmsUInt32Number;
1992 Intent: cmsUInt32Number;
1993 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall; external 'lcms2.dll';
1996 FUNCTION cmsCreateExtendedTransform(ContextID: cmsContext;
1997 nProfiles: cmsUInt32Number;
1998 hProfiles: LPcmsHPROFILEArray;
1999 BPC: LPcmsBoolArray;
2000 Intents: LPcmsUInt32NumberArray;
2001 AdaptationStates: LPcmsFloat64NumberArray;
2002 hGamutProfile: cmsHPROFILE;
2003 nGamutPCSposition: cmsUInt32Number;
2004 InputFormat,
2005 OutputFormat: cmsUInt32Number;
2006 dwFlags: cmsUInt32Number): cmsHTRANSFORM; StdCall; external 'lcms2.dll';
2008 PROCEDURE cmsDeleteTransform(hTransform: cmsHTRANSFORM); StdCall; external 'lcms2.dll';
2010 PROCEDURE cmsDoTransform(Transform: cmsHTRANSFORM; InputBuffer, OutputBuffer: Pointer; size: cmsUInt32Number); StdCall; external 'lcms2.dll';
2012 PROCEDURE cmsSetAlarmCodes( NewAlarm: LPcmsUInt16NumberArray); StdCall; external 'lcms2.dll';
2013 PROCEDURE cmsGetAlarmCodes(NewAlarm: LPcmsUInt16NumberArray); StdCall; external 'lcms2.dll';
2015 // Adaptation state for absolute colorimetric intent
2016 FUNCTION cmsSetAdaptationState(d: cmsFloat64Number):cmsFloat64Number; StdCall; external 'lcms2.dll';
2018 // Grab the ContextID from an open transform. Returns NULL if a NULL transform is passed
2019 FUNCTION cmsGetTransformContextID(hTransform: cmsHTRANSFORM):cmsContext; StdCall; external 'lcms2.dll';
2021 // For backwards compatibility
2022 FUNCTION cmsChangeBuffersFormat(hTransform: cmsHTRANSFORM; InputFormat, OutputFormat: cmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
2025 // lcms2 unified method to access postscript color resources
2026 FUNCTION cmsGetPostScriptColorResource(ContextID: cmsContext; RType: cmsPSResourceType;
2027 hProfile: cmsHPROFILE;
2028 Intent: cmsUInt32Number;
2029 dwFlags: cmsUInt32Number;
2030 io: LPcmsIOHANDLER): cmsUInt32Number; StdCall; external 'lcms2.dll';
2032 FUNCTION cmsGetPostScriptCSA(ContextID: cmsContext; hProfile: cmsHPROFILE; Intent: cmsUInt32Number; dwFlags: cmsUInt32Number; Buffer: Pointer; dwBufferLen: cmsUInt32Number ): cmsUInt32Number; StdCall; external 'lcms2.dll';
2033 FUNCTION cmsGetPostScriptCRD(ContextID: cmsContext; hProfile: cmsHPROFILE; Intent: cmsUInt32Number; dwFlags: cmsUInt32Number; Buffer: Pointer; dwBufferLen: cmsUInt32Number): cmsUInt32Number; StdCall; external 'lcms2.dll';
2036 // CGATS.13 parser
2038 FUNCTION cmsIT8Alloc: cmsHANDLE; StdCall; external 'lcms2.dll';
2039 PROCEDURE cmsIT8Free(hIT8: cmsHANDLE); StdCall; external 'lcms2.dll';
2041 // Tables
2043 FUNCTION cmsIT8TableCount(hIT8: cmsHANDLE): Integer; StdCall; external 'lcms2.dll';
2044 FUNCTION cmsIT8SetTable(hIT8: cmsHANDLE; nTable: Integer): Integer; StdCall; external 'lcms2.dll';
2046 // Persistence
2047 FUNCTION cmsIT8LoadFromFile(cFileName: PAnsiChar): cmsHANDLE; StdCall; external 'lcms2.dll';
2048 FUNCTION cmsIT8LoadFromMem(Ptr: Pointer; size :DWord): cmsHANDLE; StdCall; external 'lcms2.dll';
2050 FUNCTION cmsIT8SaveToFile(hIT8: cmsHANDLE; cFileName: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
2051 FUNCTION cmsIT8SaveToMem(hIT8: cmsHANDLE; MemPtr: Pointer; BytesNeeded: LPcmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
2052 // Properties
2054 FUNCTION cmsIT8GetSheetType(hIT8: cmsHANDLE): PAnsiChar; StdCall; external 'lcms2.dll';
2055 FUNCTION cmsIT8SetSheetType(hIT8: cmsHANDLE; TheType: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
2057 FUNCTION cmsIT8SetComment(hIT8: cmsHANDLE; cComment: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
2059 FUNCTION cmsIT8SetPropertyStr(hIT8: cmsHANDLE; cProp, Str: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
2060 FUNCTION cmsIT8SetPropertyDbl(hIT8: cmsHANDLE; cProp: PAnsiChar; Val: Double): cmsBool; StdCall; external 'lcms2.dll';
2061 FUNCTION cmsIT8SetPropertyHex(hIT8: cmsHANDLE; cProp: PAnsiChar; Val: Integer): cmsBool; StdCall; external 'lcms2.dll';
2062 FUNCTION cmsIT8SetPropertyUncooked(hIT8: cmsHANDLE; Key, Buffer: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
2065 FUNCTION cmsIT8GetProperty(hIT8: cmsHANDLE; cProp: PAnsiChar): PAnsiChar; StdCall; external 'lcms2.dll';
2066 FUNCTION cmsIT8GetPropertyDbl(hIT8: cmsHANDLE; cProp: PAnsiChar): Double; StdCall; external 'lcms2.dll';
2067 FUNCTION cmsIT8EnumProperties(hIT8: cmsHANDLE; var PropertyNames: LPPAnsiChar): Integer; StdCall; external 'lcms2.dll';
2069 // Datasets
2071 FUNCTION cmsIT8GetDataRowCol(hIT8: cmsHANDLE; row, col: Integer): PAnsiChar; StdCall; external 'lcms2.dll';
2072 FUNCTION cmsIT8GetDataRowColDbl(hIT8: cmsHANDLE; row, col: Integer): Double; StdCall; external 'lcms2.dll';
2074 FUNCTION cmsIT8SetDataRowCol(hIT8: cmsHANDLE; row, col: Integer; Val: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
2075 FUNCTION cmsIT8SetDataRowColDbl(hIT8: cmsHANDLE; row, col: Integer; Val: Double): cmsBool; StdCall; external 'lcms2.dll';
2077 FUNCTION cmsIT8GetData(hIT8: cmsHANDLE; cPatch, cSample: PAnsiChar): PAnsiChar; StdCall; external 'lcms2.dll';
2079 FUNCTION cmsIT8GetDataDbl(hIT8: cmsHANDLE;cPatch, cSample: PAnsiChar): Double; StdCall; external 'lcms2.dll';
2081 FUNCTION cmsIT8SetData(hIT8: cmsHANDLE; cPatch, cSample, Val: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
2083 FUNCTION cmsIT8SetDataDbl(hIT8: cmsHANDLE; cPatch, cSample: PAnsiChar; Val: Double): cmsBool; StdCall; external 'lcms2.dll';
2085 FUNCTION cmsIT8SetDataFormat(hIT8: cmsHANDLE; n: Integer; Sample: PAnsiChar): cmsBool; StdCall; external 'lcms2.dll';
2086 FUNCTION cmsIT8EnumDataFormat(hIT8: cmsHANDLE; var SampleNames: LPPAnsiChar): Integer; StdCall; external 'lcms2.dll';
2087 FUNCTION cmsIT8GetPatchName(hIT8: cmsHANDLE; nPatch: Integer; Buffer: PAnsiChar): PAnsiChar; StdCall; external 'lcms2.dll';
2089 // The LABEL extension
2091 FUNCTION cmsIT8SetTableByLabel(hIT8: cmsHANDLE; cSet, cField, ExpectedType: PAnsiChar): Integer; StdCall; external 'lcms2.dll';
2093 FUNCTION cmsIT8FindDataFormat(hIT8: cmsHANDLE; cSample: PAnsiChar): Integer; StdCall; external 'lcms2.dll';
2095 // Formatter for double
2096 PROCEDURE cmsIT8DefineDblFormat(hIT8: cmsHANDLE; Formatter: PAnsiChar); StdCall; external 'lcms2.dll';
2098 FUNCTION cmsGBDAlloc(ContextID: cmsContext):cmsHANDLE; StdCall; external 'lcms2.dll';
2099 PROCEDURE cmsGBDFree(hGBD: cmsHANDLE); StdCall; external 'lcms2.dll';
2100 FUNCTION cmsGDBAddPoint(hGBD: cmsHANDLE; Lab: LPcmsCIELab): cmsBool; StdCall; external 'lcms2.dll';
2101 FUNCTION cmsGDBCompute(hGDB: cmsHANDLE; dwFlags: cmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
2102 FUNCTION cmsGDBCheckPoint(hGBD: cmsHANDLE; Lab: LPcmsCIELab): cmsBool; StdCall; external 'lcms2.dll';
2104 FUNCTION cmsDetectBlackPoint( BlackPoint: LPcmsCIEXYZ; hProfile: cmsHPROFILE; Intent: cmsUInt32Number; dwFlags: cmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
2105 FUNCTION cmsDetectDestinationBlackPoint( BlackPoint: LPcmsCIEXYZ; hProfile: cmsHPROFILE; Intent: cmsUInt32Number; dwFlags: cmsUInt32Number): cmsBool; StdCall; external 'lcms2.dll';
2107 FUNCTION cmsDetectTAC(hProfile: cmsHPROFILE): cmsFloat64Number; StdCall; external 'lcms2.dll';
2109 FUNCTION cmsDesaturateLab(Lab: LPcmsCIELab; amax, amin, bmax, bmin: cmsFloat64Number): cmsBool; StdCall; external 'lcms2.dll';
2111 END.