1 #![allow(dead_code,
2 non_camel_case_types,
3 non_upper_case_globals,
4 non_snake_case)]
5
6 //! Little Color Management System
7 //! Copyright (c) 1998-2014 Marti Maria Saguer
8 //!
9 //! Permission is hereby granted, free of charge, to any person obtaining
10 //! a copy of this software and associated documentation files (the "Software"),
11 //! to deal in the Software without restriction, including without limitation
12 //! the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 //! and/or sell copies of the Software, and to permit persons to whom the Software
14 //! is furnished to do so, subject to the following conditions:
15 //!
16 //! The above copyright notice and this permission notice shall be included in
17 //! all copies or substantial portions of the Software.
18 //!
19 //! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 //! EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
21 //! THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 //! NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 //! LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 //! OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 //! WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 //!
27 //!---------------------------------------------------------------------------------
28 //!
29 //! Version 2.8
30
31 use std::os::raw::{c_char, c_int, c_long, c_void};
32 #[doc(hidden)]
33 use libc;
34 use std::mem;
35 use libc::FILE;
36 use std::default::Default;
37
38 // That one is missing in Rust's libc
39 #[cfg(not(windows))]
40 #[doc(hidden)]
41 pub type tm = libc::tm;
42 #[cfg(windows)]
43 #[doc(hidden)]
44 #[repr(C)]
45 #[derive(Copy, Clone, PartialEq, Eq, Debug)]
46 pub struct tm {
47 tm_sec: c_int,
48 tm_min: c_int,
49 tm_hour: c_int,
50 tm_mday: c_int,
51 tm_mon: c_int,
52 tm_year: c_int,
53 tm_wday: c_int,
54 tm_yday: c_int,
55 tm_isdst: c_int,
56 }
57
58 #[doc(hidden)]
59 pub type wchar_t = libc::wchar_t;
60 pub type Signature = u32;
61 pub type S15Fixed16Number = i32;
62 pub type Bool = c_int;
63
64
65 /// D50 XYZ normalized to Y=1.0
66 pub const D50X: f64 = 0.9642;
67 pub const D50Y: f64 = 1.0;
68 pub const D50Z: f64 = 0.8249;
69
70 /// V4 perceptual black
71 pub const PERCEPTUAL_BLACK_X: f64 = 0.00336;
72 pub const PERCEPTUAL_BLACK_Y: f64 = 0.0034731;
73 pub const PERCEPTUAL_BLACK_Z: f64 = 0.00287;
74
75 /// Definitions in ICC spec
76 /// 'acsp'
77 pub const MagicNumber: Signature = 0x61637370;
78 /// 'lcms'
79 pub const lcmsSignature: Signature = 0x6c636d73;
80
81 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
82 #[repr(u32)]
83 #[derive(Debug)]
84 pub enum TagTypeSignature {
85 /// 'chrm'
86 ChromaticityType = 0x6368726D,
87 /// 'clro'
88 ColorantOrderType = 0x636C726F,
89 /// 'clrt'
90 ColorantTableType = 0x636C7274,
91 /// 'crdi'
92 CrdInfoType = 0x63726469,
93 /// 'curv'
94 CurveType = 0x63757276,
95 /// 'data'
96 DataType = 0x64617461,
97 /// 'dict'
98 DictType = 0x64696374,
99 /// 'dtim'
100 DateTimeType = 0x6474696D,
101 /// 'devs'
102 DeviceSettingsType = 0x64657673,
103 /// 'mft2'
104 Lut16Type = 0x6d667432,
105 /// 'mft1'
106 Lut8Type = 0x6d667431,
107 /// 'mAB '
108 LutAtoBType = 0x6d414220,
109 /// 'mBA '
110 LutBtoAType = 0x6d424120,
111 /// 'meas'
112 MeasurementType = 0x6D656173,
113 /// 'mluc'
114 MultiLocalizedUnicodeType = 0x6D6C7563,
115 /// 'mpet'
116 MultiProcessElementType = 0x6D706574,
117 /// 'ncol' -- DEPRECATED!
118 NamedColorType = 0x6E636F6C,
119 /// 'ncl2'
120 NamedColor2Type = 0x6E636C32,
121 /// 'para'
122 ParametricCurveType = 0x70617261,
123 /// 'pseq'
124 ProfileSequenceDescType = 0x70736571,
125 /// 'psid'
126 ProfileSequenceIdType = 0x70736964,
127 /// 'rcs2'
128 ResponseCurveSet16Type = 0x72637332,
129 /// 'sf32'
130 S15Fixed16ArrayType = 0x73663332,
131 /// 'scrn'
132 ScreeningType = 0x7363726E,
133 /// 'sig '
134 SignatureType = 0x73696720,
135 /// 'text'
136 TextType = 0x74657874,
137 /// 'desc'
138 TextDescriptionType = 0x64657363,
139 /// 'uf32'
140 U16Fixed16ArrayType = 0x75663332,
141 /// 'bfd '
142 UcrBgType = 0x62666420,
143 /// 'ui16'
144 UInt16ArrayType = 0x75693136,
145 /// 'ui32'
146 UInt32ArrayType = 0x75693332,
147 /// 'ui64'
148 UInt64ArrayType = 0x75693634,
149 /// 'ui08'
150 UInt8ArrayType = 0x75693038,
151 /// 'vcgt'
152 VcgtType = 0x76636774,
153 /// 'view'
154 ViewingConditionsType = 0x76696577,
155 /// 'XYZ '
156 XYZType = 0x58595A20
157 }
158
159 pub const BlueMatrixColumnTag: TagSignature = TagSignature::BlueColorantTag;
160 pub const GreenMatrixColumnTag: TagSignature = TagSignature::GreenColorantTag;
161 pub const RedMatrixColumnTag: TagSignature = TagSignature::RedColorantTag;
162
163 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
164 #[repr(u32)]
165 #[derive(Debug)]
166 pub enum TagSignature {
167 /// 'A2B0'
168 AToB0Tag = 0x41324230,
169 /// 'A2B1'
170 AToB1Tag = 0x41324231,
171 /// 'A2B2'
172 AToB2Tag = 0x41324232,
173 /// 'bXYZ'
174 BlueColorantTag = 0x6258595A,
175 /// 'bTRC'
176 BlueTRCTag = 0x62545243,
177 /// 'B2A0'
178 BToA0Tag = 0x42324130,
179 /// 'B2A1'
180 BToA1Tag = 0x42324131,
181 /// 'B2A2'
182 BToA2Tag = 0x42324132,
183 /// 'calt'
184 CalibrationDateTimeTag = 0x63616C74,
185 /// 'targ'
186 CharTargetTag = 0x74617267,
187 /// 'chad'
188 ChromaticAdaptationTag = 0x63686164,
189 /// 'chrm'
190 ChromaticityTag = 0x6368726D,
191 /// 'clro'
192 ColorantOrderTag = 0x636C726F,
193 /// 'clrt'
194 ColorantTableTag = 0x636C7274,
195 /// 'clot'
196 ColorantTableOutTag = 0x636C6F74,
197 /// 'ciis'
198 ColorimetricIntentImageStateTag = 0x63696973,
199 /// 'cprt'
200 CopyrightTag = 0x63707274,
201 /// 'crdi'
202 CrdInfoTag = 0x63726469,
203 /// 'data'
204 DataTag = 0x64617461,
205 /// 'dtim'
206 DateTimeTag = 0x6474696D,
207 /// 'dmnd'
208 DeviceMfgDescTag = 0x646D6E64,
209 /// 'dmdd'
210 DeviceModelDescTag = 0x646D6464,
211 /// 'devs'
212 DeviceSettingsTag = 0x64657673,
213 /// 'D2B0'
214 DToB0Tag = 0x44324230,
215 /// 'D2B1'
216 DToB1Tag = 0x44324231,
217 /// 'D2B2'
218 DToB2Tag = 0x44324232,
219 /// 'D2B3'
220 DToB3Tag = 0x44324233,
221 /// 'B2D0'
222 BToD0Tag = 0x42324430,
223 /// 'B2D1'
224 BToD1Tag = 0x42324431,
225 /// 'B2D2'
226 BToD2Tag = 0x42324432,
227 /// 'B2D3'
228 BToD3Tag = 0x42324433,
229 /// 'gamt'
230 GamutTag = 0x67616D74,
231 /// 'kTRC'
232 GrayTRCTag = 0x6b545243,
233 /// 'gXYZ'
234 GreenColorantTag = 0x6758595A,
235 /// 'gTRC'
236 GreenTRCTag = 0x67545243,
237 /// 'lumi'
238 LuminanceTag = 0x6C756D69,
239 /// 'meas'
240 MeasurementTag = 0x6D656173,
241 /// 'bkpt'
242 MediaBlackPointTag = 0x626B7074,
243 /// 'wtpt'
244 MediaWhitePointTag = 0x77747074,
245 /// 'ncol' // Deprecated by the ICC
246 NamedColorTag = 0x6E636F6C,
247 /// 'ncl2'
248 NamedColor2Tag = 0x6E636C32,
249 /// 'resp'
250 OutputResponseTag = 0x72657370,
251 /// 'rig0'
252 PerceptualRenderingIntentGamutTag = 0x72696730,
253 /// 'pre0'
254 Preview0Tag = 0x70726530,
255 /// 'pre1'
256 Preview1Tag = 0x70726531,
257 /// 'pre2'
258 Preview2Tag = 0x70726532,
259 /// 'desc'
260 ProfileDescriptionTag = 0x64657363,
261 /// 'dscm'
262 ProfileDescriptionMLTag = 0x6473636D,
263 /// 'pseq'
264 ProfileSequenceDescTag = 0x70736571,
265 /// 'psid'
266 ProfileSequenceIdTag = 0x70736964,
267 /// 'psd0'
268 Ps2CRD0Tag = 0x70736430,
269 /// 'psd1'
270 Ps2CRD1Tag = 0x70736431,
271 /// 'psd2'
272 Ps2CRD2Tag = 0x70736432,
273 /// 'psd3'
274 Ps2CRD3Tag = 0x70736433,
275 /// 'ps2s'
276 Ps2CSATag = 0x70733273,
277 /// 'ps2i'
278 Ps2RenderingIntentTag = 0x70733269,
279 /// 'rXYZ'
280 RedColorantTag = 0x7258595A,
281 /// 'rTRC'
282 RedTRCTag = 0x72545243,
283 /// 'rig2'
284 SaturationRenderingIntentGamutTag = 0x72696732,
285 /// 'scrd'
286 ScreeningDescTag = 0x73637264,
287 /// 'scrn'
288 ScreeningTag = 0x7363726E,
289 /// 'tech'
290 TechnologyTag = 0x74656368,
291 /// 'bfd '
292 UcrBgTag = 0x62666420,
293 /// 'vued'
294 ViewingCondDescTag = 0x76756564,
295 /// 'view'
296 ViewingConditionsTag = 0x76696577,
297 /// 'vcgt'
298 VcgtTag = 0x76636774,
299 /// 'meta'
300 MetaTag = 0x6D657461,
301 /// 'arts'
302 ArgyllArtsTag = 0x61727473,
303 }
304 pub use self::TagSignature::*;
305
306 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
307 #[repr(u32)]
308 #[derive(Debug)]
309 pub enum TechnologySignature {
310 /// 'dcam'
311 DigitalCamera = 0x6463616D,
312 /// 'fscn'
313 FilmScanner = 0x6673636E,
314 /// 'rscn'
315 ReflectiveScanner = 0x7273636E,
316 /// 'ijet'
317 InkJetPrinter = 0x696A6574,
318 /// 'twax'
319 ThermalWaxPrinter = 0x74776178,
320 /// 'epho'
321 ElectrophotographicPrinter = 0x6570686F,
322 /// 'esta'
323 ElectrostaticPrinter = 0x65737461,
324 /// 'dsub'
325 DyeSublimationPrinter = 0x64737562,
326 /// 'rpho'
327 PhotographicPaperPrinter = 0x7270686F,
328 /// 'fprn'
329 FilmWriter = 0x6670726E,
330 /// 'vidm'
331 VideoMonitor = 0x7669646D,
332 /// 'vidc'
333 VideoCamera = 0x76696463,
334 /// 'pjtv'
335 ProjectionTelevision = 0x706A7476,
336 /// 'CRT '
337 CRTDisplay = 0x43525420,
338 /// 'PMD '
339 PMDisplay = 0x504D4420,
340 /// 'AMD '
341 AMDisplay = 0x414D4420,
342 /// 'KPCD'
343 PhotoCD = 0x4B504344,
344 /// 'imgs'
345 PhotoImageSetter = 0x696D6773,
346 /// 'grav'
347 Gravure = 0x67726176,
348 /// 'offs'
349 OffsetLithography = 0x6F666673,
350 /// 'silk'
351 Silkscreen = 0x73696C6B,
352 /// 'flex'
353 Flexography = 0x666C6578,
354 /// 'mpfs'
355 MotionPictureFilmScanner = 0x6D706673,
356 /// 'mpfr'
357 MotionPictureFilmRecorder = 0x6D706672,
358 /// 'dmpc'
359 DigitalMotionPictureCamera = 0x646D7063,
360 /// 'dcpj'
361 DigitalCinemaProjector = 0x64636A70
362 }
363
364 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
365 #[repr(u32)]
366 #[derive(Debug)]
367 pub enum ColorSpaceSignature {
368 /// 'XYZ '
369 XYZData = 0x58595A20,
370 /// 'Lab '
371 LabData = 0x4C616220,
372 /// 'Luv '
373 LuvData = 0x4C757620,
374 /// 'YCbr'
375 YCbCrData = 0x59436272,
376 /// 'Yxy '
377 YxyData = 0x59787920,
378 /// 'RGB '
379 RgbData = 0x52474220,
380 /// 'GRAY'
381 GrayData = 0x47524159,
382 /// 'HSV '
383 HsvData = 0x48535620,
384 /// 'HLS '
385 HlsData = 0x484C5320,
386 /// 'CMYK'
387 CmykData = 0x434D594B,
388 /// 'CMY '
389 CmyData = 0x434D5920,
390 /// 'MCH1'
391 MCH1Data = 0x4D434831,
392 /// 'MCH2'
393 MCH2Data = 0x4D434832,
394 /// 'MCH3'
395 MCH3Data = 0x4D434833,
396 /// 'MCH4'
397 MCH4Data = 0x4D434834,
398 /// 'MCH5'
399 MCH5Data = 0x4D434835,
400 /// 'MCH6'
401 MCH6Data = 0x4D434836,
402 /// 'MCH7'
403 MCH7Data = 0x4D434837,
404 /// 'MCH8'
405 MCH8Data = 0x4D434838,
406 /// 'MCH9'
407 MCH9Data = 0x4D434839,
408 /// 'MCHA'
409 MCHAData = 0x4D434841,
410 /// 'MCHB'
411 MCHBData = 0x4D434842,
412 /// 'MCHC'
413 MCHCData = 0x4D434843,
414 /// 'MCHD'
415 MCHDData = 0x4D434844,
416 /// 'MCHE'
417 MCHEData = 0x4D434845,
418 /// 'MCHF'
419 MCHFData = 0x4D434846,
420 /// 'nmcl'
421 NamedData = 0x6e6d636c,
422 /// '1CLR'
423 Sig1colorData = 0x31434C52,
424 /// '2CLR'
425 Sig2colorData = 0x32434C52,
426 /// '3CLR'
427 Sig3colorData = 0x33434C52,
428 /// '4CLR'
429 Sig4colorData = 0x34434C52,
430 /// '5CLR'
431 Sig5colorData = 0x35434C52,
432 /// '6CLR'
433 Sig6colorData = 0x36434C52,
434 /// '7CLR'
435 Sig7colorData = 0x37434C52,
436 /// '8CLR'
437 Sig8colorData = 0x38434C52,
438 /// '9CLR'
439 Sig9colorData = 0x39434C52,
440 /// 'ACLR'
441 Sig10colorData = 0x41434C52,
442 /// 'BCLR'
443 Sig11colorData = 0x42434C52,
444 /// 'CCLR'
445 Sig12colorData = 0x43434C52,
446 /// 'DCLR'
447 Sig13colorData = 0x44434C52,
448 /// 'ECLR'
449 Sig14colorData = 0x45434C52,
450 /// 'FCLR'
451 Sig15colorData = 0x46434C52,
452 /// 'LuvK'
453 LuvKData = 0x4C75764B
454 }
455
456 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
457 #[repr(u32)]
458 #[derive(Debug)]
459 pub enum ProfileClassSignature {
460 /// 'scnr'
461 InputClass = 0x73636E72,
462 /// 'mntr'
463 DisplayClass = 0x6D6E7472,
464 /// 'prtr'
465 OutputClass = 0x70727472,
466 /// 'link'
467 LinkClass = 0x6C696E6B,
468 /// 'abst'
469 AbstractClass = 0x61627374,
470 /// 'spac'
471 ColorSpaceClass = 0x73706163,
472 /// 'nmcl'
473 NamedColorClass = 0x6e6d636c
474 }
475
476 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
477 #[repr(u32)]
478 #[derive(Debug)]
479 pub enum PlatformSignature {
480 /// 'APPL'
481 Macintosh = 0x4150504C,
482 /// 'MSFT'
483 Microsoft = 0x4D534654,
484 /// 'SUNW'
485 Solaris = 0x53554E57,
486 /// 'SGI '
487 SGI = 0x53474920,
488 /// 'TGNT'
489 Taligent = 0x54474E54,
490 /// '*nix' // From argyll -- Not official
491 Unices = 0x2A6E6978
492 }
493
494 ///'prmg'
495 pub const PerceptualReferenceMediumGamut:u32 = 0x70726d67;
496
497 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
498 #[repr(u32)]
499 #[derive(Debug)]
500 pub enum ColorimetricIntentImageState {
501 ///'scoe'
502 SceneColorimetryEstimates = 0x73636F65,
503 ///'sape'
504 SceneAppearanceEstimates = 0x73617065,
505 ///'fpce'
506 FocalPlaneColorimetryEstimates = 0x66706365,
507 ///'rhoc'
508 ReflectionHardcopyOriginalColorimetry = 0x72686F63,
509 ///'rpoc'
510 ReflectionPrintOutputColorimetry = 0x72706F63,
511 }
512 pub use crate::ColorimetricIntentImageState::*;
513
514 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
515 #[repr(u32)]
516 #[derive(Debug)]
517 pub enum StageSignature {
518 ///'cvst'
519 CurveSetElemType = 0x63767374,
520 ///'matf'
521 MatrixElemType = 0x6D617466,
522 ///'clut'
523 CLutElemType = 0x636C7574,
524
525 /// 'bACS'
526 BAcsElemType = 0x62414353,
527 /// 'eACS'
528 EAcsElemType = 0x65414353,
529
530 /// Custom from here, not in the ICC Spec
531 /// 'l2x '
532 XYZ2LabElemType = 0x6C327820,
533 /// 'x2l '
534 Lab2XYZElemType = 0x78326C20,
535 /// 'ncl '
536 NamedColorElemType = 0x6E636C20,
537 /// '2 4 '
538 LabV2toV4 = 0x32203420,
539 /// '4 2 '
540 LabV4toV2 = 0x34203220,
541
542 /// Identities
543 /// 'idn '
544 IdentityElemType = 0x69646E20,
545
546 /// Float to floatPCS
547 /// 'd2l '
548 Lab2FloatPCS = 0x64326C20,
549 /// 'l2d '
550 FloatPCS2Lab = 0x6C326420,
551 /// 'd2x '
552 XYZ2FloatPCS = 0x64327820,
553 /// 'x2d '
554 FloatPCS2XYZ = 0x78326420,
555 /// 'clp '
556 ClipNegativesElemType = 0x636c7020
557 }
558
559 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
560 #[repr(u32)]
561 #[derive(Debug)]
562 pub enum CurveSegSignature {
563 /// 'parf'
564 FormulaCurveSeg = 0x70617266,
565 /// 'samf'
566 SampledCurveSeg = 0x73616D66,
567 /// 'curf'
568 SegmentedCurve = 0x63757266
569 }
570
571 ///'StaA'
572 pub const StatusA:u32 = 0x53746141;
573 ///'StaE'
574 pub const StatusE:u32 = 0x53746145;
575 ///'StaI'
576 pub const StatusI:u32 = 0x53746149;
577 ///'StaT'
578 pub const StatusT:u32 = 0x53746154;
579 ///'StaM'
580 pub const StatusM:u32 = 0x5374614D;
581 ///'DN '
582 pub const DN:u32 = 0x444E2020;
583 ///'DN P'
584 pub const DNP:u32 = 0x444E2050;
585 ///'DNN '
586 pub const DNN:u32 = 0x444E4E20;
587 ///'DNNP'
588 pub const DNNP:u32 = 0x444E4E50;
589
590 /// Device attributes, currently defined values correspond to the low 4 bytes
591 /// of the 8 byte attribute quantity
592 pub const Reflective:u32 = 0;
593 pub const Transparency:u32 = 1;
594 pub const Glossy:u32 = 0;
595 pub const Matte:u32 = 2;
596
597 #[repr(C)]
598 #[derive(Copy, Clone)]
599 #[derive(Debug)]
600 pub struct ICCData {
601 pub len: u32,
602 pub flag: u32,
603 pub data: [u8; 1],
604 }
605
606 impl Default for ICCData {
default() -> Self607 fn default() -> Self { unsafe { mem::zeroed() } }
608 }
609
610 #[repr(C)]
611 #[derive(Copy, Clone, PartialEq, Eq)]
612 #[derive(Debug)]
613 pub struct DateTimeNumber {
614 pub year: u16,
615 pub month: u16,
616 pub day: u16,
617 pub hours: u16,
618 pub minutes: u16,
619 pub seconds: u16,
620 }
621
622 impl Default for DateTimeNumber {
default() -> Self623 fn default() -> Self { unsafe { mem::zeroed() } }
624 }
625
626 #[repr(C)]
627 #[derive(Copy, Clone, PartialEq, Eq)]
628 #[derive(Debug)]
629 pub struct EncodedXYZNumber {
630 pub X: S15Fixed16Number,
631 pub Y: S15Fixed16Number,
632 pub Z: S15Fixed16Number,
633 }
634
635 impl Default for EncodedXYZNumber {
default() -> Self636 fn default() -> Self { unsafe { mem::zeroed() } }
637 }
638
639 #[repr(C)]
640 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
641 #[derive(Debug)]
642 /// Profile ID as computed by MD5 algorithm
643 pub struct ProfileID {
644 pub ID32: [u32; 4],
645 }
646
647 impl Default for ProfileID {
default() -> Self648 fn default() -> Self { unsafe { mem::zeroed() } }
649 }
650
651 #[repr(C)]
652 #[derive(Copy, Clone)]
653 #[derive(Debug)]
654 pub struct ICCHeader {
655 /// Profile size in bytes
656 pub size: u32,
657 /// CMM for this profile
658 pub cmmId: Signature,
659 /// Format version number
660 pub version: u32,
661 /// Type of profile
662 pub deviceClass: ProfileClassSignature,
663 /// Color space of data
664 pub colorSpace: ColorSpaceSignature,
665 /// PCS, XYZ or Lab only
666 pub pcs: ColorSpaceSignature,
667 /// Date profile was created
668 pub date: DateTimeNumber,
669 /// Magic Number to identify an ICC profile
670 pub magic: Signature,
671 /// Primary Platform
672 pub platform: PlatformSignature,
673 /// Various bit settings
674 pub flags: u32,
675 /// Device manufacturer
676 pub manufacturer: Signature,
677 /// Device model number
678 pub model: u32,
679 /// Device attributes
680 pub attributes: u64,
681 /// Rendering intent
682 pub renderingIntent: Intent,
683 /// Profile illuminant
684 pub illuminant: EncodedXYZNumber,
685 /// Profile creator
686 pub creator: Signature,
687 /// Profile ID using MD5
688 pub profileID: ProfileID,
689 /// Reserved for future use
690 pub reserved: [i8; 28],
691 }
692 impl Default for ICCHeader {
default() -> Self693 fn default() -> Self { unsafe { mem::zeroed() } }
694 }
695
696 #[repr(C)]
697 #[derive(Copy, Clone)]
698 #[derive(Debug)]
699 pub struct TagBase {
700 pub sig: TagTypeSignature,
701 pub reserved: [i8; 4],
702 }
703 impl Default for TagBase {
default() -> Self704 fn default() -> Self { unsafe { mem::zeroed() } }
705 }
706
707 #[repr(C)]
708 #[derive(Copy, Clone, PartialEq)]
709 #[derive(Debug)]
710 pub struct TagEntry {
711 pub sig: TagSignature,
712 pub offset: u32,
713 pub size: u32,
714 }
715 impl Default for TagEntry {
default() -> Self716 fn default() -> Self { unsafe { mem::zeroed() } }
717 }
718
719 pub type HANDLE = *mut c_void;
720 #[repr(C)]
721 pub struct _HPROFILE { _opaque_type: [u8; 0] }
722 pub type HPROFILE = *mut _HPROFILE;
723 #[repr(C)]
724 pub struct _HTRANSFORM { _opaque_type: [u8; 0] }
725 pub type HTRANSFORM = *mut _HTRANSFORM;
726
727 /// Maximum number of channels in ICC profiles
728 pub const MAXCHANNELS: usize = 16;
729
730 #[repr(C)]
731 #[derive(Debug, Copy, Clone, PartialEq, Eq)]
732 pub struct PixelType(pub u32);
733
734 // Pixel types
735 /// Don't check colorspace
736 pub const PT_ANY: PixelType = PixelType(0);
737 /// 1 & 2 are reserved
738 pub const PT_GRAY: PixelType = PixelType(3);
739 pub const PT_RGB: PixelType = PixelType(4);
740 pub const PT_CMY: PixelType = PixelType(5);
741 pub const PT_CMYK: PixelType = PixelType(6);
742 pub const PT_YCbCr: PixelType = PixelType(7);
743 /// Lu'v'
744 pub const PT_YUV: PixelType = PixelType(8);
745 pub const PT_XYZ: PixelType = PixelType(9);
746 pub const PT_Lab: PixelType = PixelType(10);
747 /// Lu'v'K
748 pub const PT_YUVK: PixelType = PixelType(11);
749 pub const PT_HSV: PixelType = PixelType(12);
750 pub const PT_HLS: PixelType = PixelType(13);
751 pub const PT_Yxy: PixelType = PixelType(14);
752
753 pub const PT_MCH1: PixelType = PixelType(15);
754 pub const PT_MCH2: PixelType = PixelType(16);
755 pub const PT_MCH3: PixelType = PixelType(17);
756 pub const PT_MCH4: PixelType = PixelType(18);
757 pub const PT_MCH5: PixelType = PixelType(19);
758 pub const PT_MCH6: PixelType = PixelType(20);
759 pub const PT_MCH7: PixelType = PixelType(21);
760 pub const PT_MCH8: PixelType = PixelType(22);
761 pub const PT_MCH9: PixelType = PixelType(23);
762 pub const PT_MCH10: PixelType = PixelType(24);
763 pub const PT_MCH11: PixelType = PixelType(25);
764 pub const PT_MCH12: PixelType = PixelType(26);
765 pub const PT_MCH13: PixelType = PixelType(27);
766 pub const PT_MCH14: PixelType = PixelType(28);
767 pub const PT_MCH15: PixelType = PixelType(29);
768
769 /// Identical to PT_Lab, but using the V2 old encoding
770 pub const PT_LabV2: PixelType = PixelType(30);
771
772 /// Format of pixel is defined by one cmsUInt32Number, using bit fields as follows
773 ///
774 /// 2 1 0
775 /// 3 2 10987 6 5 4 3 2 1 098 7654 321
776 /// A O TTTTT U Y F P X S EEE CCCC BBB
777 ///
778 /// A: Floating point -- With this flag we can differentiate 16 bits as float and as int
779 /// O: Optimized -- previous optimization already returns the final 8-bit value
780 /// T: Pixeltype
781 /// F: Flavor 0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)
782 /// P: Planar? 0=Chunky, 1=Planar
783 /// X: swap 16 bps endianness?
784 /// S: Do swap? ie, BGR, KYMC
785 /// E: Extra samples
786 /// C: Channels (Samples per pixel)
787 /// B: bytes per sample
788 /// Y: Swap first - changes ABGR to BGRA and KCMY to CMYK
789 #[repr(C)]
790 #[derive(Debug, Copy, Clone, PartialEq, Eq)]
791 pub struct PixelFormat(pub u32);
792
793 impl PixelFormat {
794 pub const GRAY_8: PixelFormat = PixelFormat(196617);
795 pub const GRAY_8_REV: PixelFormat = PixelFormat(204809);
796 pub const GRAY_16: PixelFormat = PixelFormat(196618);
797 pub const GRAY_16_REV: PixelFormat = PixelFormat(204810);
798 pub const GRAY_16_SE: PixelFormat = PixelFormat(198666);
799 pub const GRAYA_8: PixelFormat = PixelFormat(196745);
800 pub const GRAYA_16: PixelFormat = PixelFormat(196746);
801 pub const GRAYA_16_SE: PixelFormat = PixelFormat(198794);
802 pub const GRAYA_8_PLANAR: PixelFormat = PixelFormat(200841);
803 pub const GRAYA_16_PLANAR: PixelFormat = PixelFormat(200842);
804 pub const RGB_8: PixelFormat = PixelFormat(262169);
805 pub const RGB_8_PLANAR: PixelFormat = PixelFormat(266265);
806 pub const BGR_8: PixelFormat = PixelFormat(263193);
807 pub const BGR_8_PLANAR: PixelFormat = PixelFormat(267289);
808 pub const RGB_16: PixelFormat = PixelFormat(262170);
809 pub const RGB_16_PLANAR: PixelFormat = PixelFormat(266266);
810 pub const RGB_16_SE: PixelFormat = PixelFormat(264218);
811 pub const BGR_16: PixelFormat = PixelFormat(263194);
812 pub const BGR_16_PLANAR: PixelFormat = PixelFormat(267290);
813 pub const BGR_16_SE: PixelFormat = PixelFormat(265242);
814 pub const RGBA_8: PixelFormat = PixelFormat(262297);
815 pub const RGBA_8_PLANAR: PixelFormat = PixelFormat(266393);
816 pub const RGBA_16: PixelFormat = PixelFormat(262298);
817 pub const RGBA_16_PLANAR: PixelFormat = PixelFormat(266394);
818 pub const RGBA_16_SE: PixelFormat = PixelFormat(264346);
819 pub const ARGB_8: PixelFormat = PixelFormat(278681);
820 pub const ARGB_8_PLANAR: PixelFormat = PixelFormat(282777);
821 pub const ARGB_16: PixelFormat = PixelFormat(278682);
822 pub const ABGR_8: PixelFormat = PixelFormat(263321);
823 pub const ABGR_8_PLANAR: PixelFormat = PixelFormat(267417);
824 pub const ABGR_16: PixelFormat = PixelFormat(263322);
825 pub const ABGR_16_PLANAR: PixelFormat = PixelFormat(267418);
826 pub const ABGR_16_SE: PixelFormat = PixelFormat(265370);
827 pub const BGRA_8: PixelFormat = PixelFormat(279705);
828 pub const BGRA_8_PLANAR: PixelFormat = PixelFormat(283801);
829 pub const BGRA_16: PixelFormat = PixelFormat(279706);
830 pub const BGRA_16_SE: PixelFormat = PixelFormat(281754);
831 pub const CMY_8: PixelFormat = PixelFormat(327705);
832 pub const CMY_8_PLANAR: PixelFormat = PixelFormat(331801);
833 pub const CMY_16: PixelFormat = PixelFormat(327706);
834 pub const CMY_16_PLANAR: PixelFormat = PixelFormat(331802);
835 pub const CMY_16_SE: PixelFormat = PixelFormat(329754);
836 pub const CMYK_8: PixelFormat = PixelFormat(393249);
837 pub const CMYKA_8: PixelFormat = PixelFormat(393377);
838 pub const CMYK_8_REV: PixelFormat = PixelFormat(401441);
839 pub const CMYK_8_PLANAR: PixelFormat = PixelFormat(397345);
840 pub const CMYK_16: PixelFormat = PixelFormat(393250);
841 pub const CMYK_16_REV: PixelFormat = PixelFormat(401442);
842 pub const CMYK_16_PLANAR: PixelFormat = PixelFormat(397346);
843 pub const CMYK_16_SE: PixelFormat = PixelFormat(395298);
844 pub const KYMC_8: PixelFormat = PixelFormat(394273);
845 pub const KYMC_16: PixelFormat = PixelFormat(394274);
846 pub const KYMC_16_SE: PixelFormat = PixelFormat(396322);
847 pub const KCMY_8: PixelFormat = PixelFormat(409633);
848 pub const KCMY_8_REV: PixelFormat = PixelFormat(417825);
849 pub const KCMY_16: PixelFormat = PixelFormat(409634);
850 pub const KCMY_16_REV: PixelFormat = PixelFormat(417826);
851 pub const KCMY_16_SE: PixelFormat = PixelFormat(411682);
852 pub const CMYK5_8: PixelFormat = PixelFormat(1245225);
853 pub const CMYK5_16: PixelFormat = PixelFormat(1245226);
854 pub const CMYK5_16_SE: PixelFormat = PixelFormat(1247274);
855 pub const KYMC5_8: PixelFormat = PixelFormat(1246249);
856 pub const KYMC5_16: PixelFormat = PixelFormat(1246250);
857 pub const KYMC5_16_SE: PixelFormat = PixelFormat(1248298);
858 pub const CMYK6_8: PixelFormat = PixelFormat(1310769);
859 pub const CMYK6_8_PLANAR: PixelFormat = PixelFormat(1314865);
860 pub const CMYK6_16: PixelFormat = PixelFormat(1310770);
861 pub const CMYK6_16_PLANAR: PixelFormat = PixelFormat(1314866);
862 pub const CMYK6_16_SE: PixelFormat = PixelFormat(1312818);
863 pub const CMYK7_8: PixelFormat = PixelFormat(1376313);
864 pub const CMYK7_16: PixelFormat = PixelFormat(1376314);
865 pub const CMYK7_16_SE: PixelFormat = PixelFormat(1378362);
866 pub const KYMC7_8: PixelFormat = PixelFormat(1377337);
867 pub const KYMC7_16: PixelFormat = PixelFormat(1377338);
868 pub const KYMC7_16_SE: PixelFormat = PixelFormat(1379386);
869 pub const CMYK8_8: PixelFormat = PixelFormat(1441857);
870 pub const CMYK8_16: PixelFormat = PixelFormat(1441858);
871 pub const CMYK8_16_SE: PixelFormat = PixelFormat(1443906);
872 pub const KYMC8_8: PixelFormat = PixelFormat(1442881);
873 pub const KYMC8_16: PixelFormat = PixelFormat(1442882);
874 pub const KYMC8_16_SE: PixelFormat = PixelFormat(1444930);
875 pub const CMYK9_8: PixelFormat = PixelFormat(1507401);
876 pub const CMYK9_16: PixelFormat = PixelFormat(1507402);
877 pub const CMYK9_16_SE: PixelFormat = PixelFormat(1509450);
878 pub const KYMC9_8: PixelFormat = PixelFormat(1508425);
879 pub const KYMC9_16: PixelFormat = PixelFormat(1508426);
880 pub const KYMC9_16_SE: PixelFormat = PixelFormat(1510474);
881 pub const CMYK10_8: PixelFormat = PixelFormat(1572945);
882 pub const CMYK10_16: PixelFormat = PixelFormat(1572946);
883 pub const CMYK10_16_SE: PixelFormat = PixelFormat(1574994);
884 pub const KYMC10_8: PixelFormat = PixelFormat(1573969);
885 pub const KYMC10_16: PixelFormat = PixelFormat(1573970);
886 pub const KYMC10_16_SE: PixelFormat = PixelFormat(1576018);
887 pub const CMYK11_8: PixelFormat = PixelFormat(1638489);
888 pub const CMYK11_16: PixelFormat = PixelFormat(1638490);
889 pub const CMYK11_16_SE: PixelFormat = PixelFormat(1640538);
890 pub const KYMC11_8: PixelFormat = PixelFormat(1639513);
891 pub const KYMC11_16: PixelFormat = PixelFormat(1639514);
892 pub const KYMC11_16_SE: PixelFormat = PixelFormat(1641562);
893 pub const CMYK12_8: PixelFormat = PixelFormat(1704033);
894 pub const CMYK12_16: PixelFormat = PixelFormat(1704034);
895 pub const CMYK12_16_SE: PixelFormat = PixelFormat(1706082);
896 pub const KYMC12_8: PixelFormat = PixelFormat(1705057);
897 pub const KYMC12_16: PixelFormat = PixelFormat(1705058);
898 pub const KYMC12_16_SE: PixelFormat = PixelFormat(1707106);
899 pub const XYZ_16: PixelFormat = PixelFormat(589850);
900 pub const Lab_8: PixelFormat = PixelFormat(655385);
901 pub const LabV2_8: PixelFormat = PixelFormat(1966105);
902 pub const ALab_8: PixelFormat = PixelFormat(671897);
903 pub const ALabV2_8: PixelFormat = PixelFormat(1982617);
904 pub const Lab_16: PixelFormat = PixelFormat(655386);
905 pub const LabV2_16: PixelFormat = PixelFormat(1966106);
906 pub const Yxy_16: PixelFormat = PixelFormat(917530);
907 pub const YCbCr_8: PixelFormat = PixelFormat(458777);
908 pub const YCbCr_8_PLANAR: PixelFormat = PixelFormat(462873);
909 pub const YCbCr_16: PixelFormat = PixelFormat(458778);
910 pub const YCbCr_16_PLANAR: PixelFormat = PixelFormat(462874);
911 pub const YCbCr_16_SE: PixelFormat = PixelFormat(460826);
912 pub const YUV_8: PixelFormat = PixelFormat(524313);
913 pub const YUV_8_PLANAR: PixelFormat = PixelFormat(528409);
914 pub const YUV_16: PixelFormat = PixelFormat(524314);
915 pub const YUV_16_PLANAR: PixelFormat = PixelFormat(528410);
916 pub const YUV_16_SE: PixelFormat = PixelFormat(526362);
917 pub const HLS_8: PixelFormat = PixelFormat(851993);
918 pub const HLS_8_PLANAR: PixelFormat = PixelFormat(856089);
919 pub const HLS_16: PixelFormat = PixelFormat(851994);
920 pub const HLS_16_PLANAR: PixelFormat = PixelFormat(856090);
921 pub const HLS_16_SE: PixelFormat = PixelFormat(854042);
922 pub const HSV_8: PixelFormat = PixelFormat(786457);
923 pub const HSV_8_PLANAR: PixelFormat = PixelFormat(790553);
924 pub const HSV_16: PixelFormat = PixelFormat(786458);
925 pub const HSV_16_PLANAR: PixelFormat = PixelFormat(790554);
926 pub const HSV_16_SE: PixelFormat = PixelFormat(788506);
927 // Named color index. Only 16 bits allowed (don't check colorspace)
928 pub const NAMED_COLOR_INDEX: PixelFormat = PixelFormat(10);
929 pub const XYZ_FLT: PixelFormat = PixelFormat(4784156);
930 pub const Lab_FLT: PixelFormat = PixelFormat(4849692);
931 pub const LabA_FLT: PixelFormat = PixelFormat(4849820);
932 pub const GRAY_FLT: PixelFormat = PixelFormat(4390924);
933 pub const RGB_FLT: PixelFormat = PixelFormat(4456476);
934 pub const RGBA_FLT: PixelFormat = PixelFormat(4456604);
935 pub const ARGB_FLT: PixelFormat = PixelFormat(4472988);
936 pub const BGR_FLT: PixelFormat = PixelFormat(4457500);
937 pub const BGRA_FLT: PixelFormat = PixelFormat(4474012);
938 pub const CMYK_FLT: PixelFormat = PixelFormat(4587556);
939 pub const XYZ_DBL: PixelFormat = PixelFormat(4784152);
940 pub const Lab_DBL: PixelFormat = PixelFormat(4849688);
941 pub const GRAY_DBL: PixelFormat = PixelFormat(4390920);
942 pub const RGB_DBL: PixelFormat = PixelFormat(4456472);
943 pub const BGR_DBL: PixelFormat = PixelFormat(4457496);
944 pub const CMYK_DBL: PixelFormat = PixelFormat(4587552);
945 pub const GRAY_HALF_FLT: PixelFormat = PixelFormat(4390922);
946 pub const RGB_HALF_FLT: PixelFormat = PixelFormat(4456474);
947 pub const RGBA_HALF_FLT: PixelFormat = PixelFormat(4456602);
948 pub const CMYK_HALF_FLT: PixelFormat = PixelFormat(4587554);
949 pub const ARGB_HALF_FLT: PixelFormat = PixelFormat(4472986);
950 pub const BGR_HALF_FLT: PixelFormat = PixelFormat(4457498);
951 pub const BGRA_HALF_FLT: PixelFormat = PixelFormat(4474010);
952
953 /// A: Floating point -- With this flag we can differentiate 16 bits as float and as int
float(&self) -> bool954 pub fn float(&self) -> bool {
955 ((self.0 >> 22) & 1) != 0
956 }
957
958 /// O: Optimized -- previous optimization already returns the final 8-bit value
optimized(&self) -> bool959 pub fn optimized(&self) -> bool {
960 ((self.0 >> 21) & 1) != 0
961 }
962
963 /// T: Color space (`PT_*`)
pixel_type(&self) -> PixelType964 pub fn pixel_type(&self) -> PixelType {
965 PixelType((self.0 >> 16) & 31)
966 }
967
968 /// Y: Swap first - changes ABGR to BGRA and KCMY to CMYK
swapfirst(&self) -> bool969 pub fn swapfirst(&self) -> bool {
970 ((self.0 >> 14) & 1) != 0
971 }
972
973 /// F: Flavor 0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)
min_is_white(&self) -> bool974 pub fn min_is_white(&self) -> bool {
975 ((self.0 >> 13) & 1) != 0
976 }
977
978 /// P: Planar? 0=Chunky, 1=Planar
planar(&self) -> bool979 pub fn planar(&self) -> bool {
980 ((self.0 >> 12) & 1) != 0
981 }
982
983 /// X: swap 16 bps endianness?
endian16(&self) -> bool984 pub fn endian16(&self) -> bool {
985 ((self.0 >> 11) & 1) != 0
986 }
987
988 /// S: Do swap? ie, BGR, KYMC
doswap(&self) -> bool989 pub fn doswap(&self) -> bool {
990 ((self.0 >> 10) & 1) != 0
991 }
992
993 /// E: Extra samples
extra(&self) -> usize994 pub fn extra(&self) -> usize {
995 ((self.0 >> 7) & 7) as usize
996 }
997
998 /// C: Channels (Samples per pixel)
channels(&self) -> usize999 pub fn channels(&self) -> usize {
1000 ((self.0 >> 3) & 15) as usize
1001 }
1002
1003 /// B: bytes per sample
bytes_per_channel(&self) -> usize1004 pub fn bytes_per_channel(&self) -> usize {
1005 let res = (self.0 & 7) as usize;
1006 // 8 overflows the field
1007 if res != 0 {res} else {8}
1008 }
1009
1010 /// size of pixel
bytes_per_pixel(&self) -> usize1011 pub fn bytes_per_pixel(&self) -> usize {
1012 self.bytes_per_channel() * (self.extra() + self.channels())
1013 }
1014 }
1015
1016 #[test]
test_bpc()1017 fn test_bpc() {
1018 assert_eq!(8, PixelFormat::XYZ_DBL.bytes_per_channel());
1019 assert_eq!(8, PixelFormat::Lab_DBL.bytes_per_channel());
1020 assert_eq!(8, PixelFormat::GRAY_DBL.bytes_per_channel());
1021 assert_eq!(8, PixelFormat::RGB_DBL.bytes_per_channel());
1022 assert_eq!(8, PixelFormat::BGR_DBL.bytes_per_channel());
1023 assert_eq!(8, PixelFormat::CMYK_DBL.bytes_per_channel());
1024 }
1025
1026 #[test]
test_pixelformat()1027 fn test_pixelformat() {
1028 assert_eq!(4, PixelFormat::CMYKA_8.channels());
1029 assert_eq!(1, PixelFormat::CMYKA_8.extra());
1030
1031 assert!(!PixelFormat::CMYKA_8.doswap());
1032 assert_eq!(1, PixelFormat::CMYKA_8.bytes_per_channel());
1033 assert_eq!(5, PixelFormat::CMYKA_8.bytes_per_pixel());
1034
1035 assert_eq!(2, PixelFormat::CMYK_HALF_FLT.bytes_per_channel());
1036 assert_eq!(PT_CMYK, PixelFormat::CMYK_HALF_FLT.pixel_type());
1037 }
1038
1039 #[repr(C)]
1040 #[derive(Copy, Clone, PartialEq)]
1041 #[derive(Debug)]
1042 pub struct CIEXYZ {
1043 pub X: f64,
1044 pub Y: f64,
1045 pub Z: f64,
1046 }
1047 impl Default for CIEXYZ {
default() -> Self1048 fn default() -> Self { unsafe { mem::zeroed() } }
1049 }
1050
1051 #[repr(C)]
1052 #[derive(Copy, Clone, PartialEq)]
1053 #[derive(Debug)]
1054 pub struct CIExyY {
1055 pub x: f64,
1056 pub y: f64,
1057 pub Y: f64,
1058 }
1059 impl Default for CIExyY {
default() -> Self1060 fn default() -> Self { CIExyY{x:0., y:0., Y:1.} }
1061 }
1062
1063 #[repr(C)]
1064 #[derive(Copy, Clone, PartialEq)]
1065 #[derive(Debug)]
1066 pub struct CIELab {
1067 pub L: f64,
1068 pub a: f64,
1069 pub b: f64,
1070 }
1071 impl Default for CIELab {
default() -> Self1072 fn default() -> Self { unsafe { mem::zeroed() } }
1073 }
1074
1075 #[repr(C)]
1076 #[derive(Copy, Clone, PartialEq)]
1077 #[derive(Debug)]
1078 pub struct CIELCh {
1079 pub L: f64,
1080 pub C: f64,
1081 pub h: f64,
1082 }
1083 impl Default for CIELCh {
default() -> Self1084 fn default() -> Self { unsafe { mem::zeroed() } }
1085 }
1086
1087 #[repr(C)]
1088 #[derive(Copy, Clone, PartialEq)]
1089 #[derive(Debug)]
1090 pub struct JCh {
1091 pub J: f64,
1092 pub C: f64,
1093 pub h: f64,
1094 }
1095 impl Default for JCh {
default() -> Self1096 fn default() -> Self { unsafe { mem::zeroed() } }
1097 }
1098
1099 #[repr(C)]
1100 #[derive(Copy, Clone, PartialEq)]
1101 #[derive(Debug)]
1102 pub struct CIEXYZTRIPLE {
1103 pub Red: CIEXYZ,
1104 pub Green: CIEXYZ,
1105 pub Blue: CIEXYZ,
1106 }
1107
1108 #[repr(C)]
1109 #[derive(Copy, Clone, PartialEq)]
1110 #[derive(Debug)]
1111 pub struct CIExyYTRIPLE {
1112 pub Red: CIExyY,
1113 pub Green: CIExyY,
1114 pub Blue: CIExyY,
1115 }
1116
1117 /// Illuminant types for structs below
1118 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
1119 #[repr(u32)]
1120 #[derive(Debug)]
1121 pub enum IlluminantType {
1122 UNKNOWN = 0x0000000,
1123 D50 = 0x0000001,
1124 D65 = 0x0000002,
1125 D93 = 0x0000003,
1126 F2 = 0x0000004,
1127 D55 = 0x0000005,
1128 A = 0x0000006,
1129 E = 0x0000007,
1130 F8 = 0x0000008,
1131 }
1132
1133 #[repr(C)]
1134 #[derive(Copy, Clone)]
1135 #[derive(Debug)]
1136 pub struct ICCMeasurementConditions {
1137 pub Observer: u32,
1138 pub Backing: CIEXYZ,
1139 pub Geometry: u32,
1140 pub Flare: f64,
1141 pub IlluminantType: IlluminantType,
1142 }
1143 impl Default for ICCMeasurementConditions {
default() -> Self1144 fn default() -> Self { unsafe { mem::zeroed() } }
1145 }
1146
1147 #[repr(C)]
1148 #[derive(Copy, Clone)]
1149 #[derive(Debug)]
1150 pub struct ICCViewingConditions {
1151 pub IlluminantXYZ: CIEXYZ,
1152 pub SurroundXYZ: CIEXYZ,
1153 pub IlluminantType: IlluminantType,
1154 }
1155 impl Default for ICCViewingConditions {
default() -> Self1156 fn default() -> Self { unsafe { mem::zeroed() } }
1157 }
1158
1159
1160 #[repr(u32)]
1161 #[derive(Copy, Clone, Eq, PartialEq)]
1162 #[derive(Debug)]
1163 pub enum Surround {
1164 Avg = 1,
1165 Dim = 2,
1166 Dark = 3,
1167 Cutsheet = 4,
1168 }
1169
1170 pub const D_CALCULATE: f64 = -1.;
1171
1172 #[repr(C)]
1173 pub struct _cmsContext_struct { _opaque_type: [u8; 0] }
1174 // Each context holds its owns globals and its own plug-ins. There is a global context with the id = 0 for lecacy compatibility
1175 // though using the global context is not recommended. Proper context handling makes lcms more thread-safe.
1176 pub type Context = *mut _cmsContext_struct;
1177 pub type LogErrorHandlerFunction = ::std::option::Option<unsafe extern "C" fn(ContextID: Context, ErrorCode: u32, Text: *const c_char)>;
1178
1179 #[repr(C)]
1180 #[derive(Copy, Clone)]
1181 #[derive(Debug)]
1182 pub struct ViewingConditions {
1183 pub whitePoint: CIEXYZ,
1184 pub Yb: f64,
1185 pub La: f64,
1186 pub surround: Surround,
1187 pub D_value: f64,
1188 }
1189 impl Default for ViewingConditions {
default() -> Self1190 fn default() -> Self { unsafe { mem::zeroed() } }
1191 }
1192
1193 #[repr(C)]
1194 #[derive(Copy, Clone)]
1195 #[derive(Debug)]
1196 /// This describes a curve segment.
1197 ///
1198 /// For a table of supported types, see the manual. User can increase the number of
1199 /// available types by using a proper plug-in. Parametric segments allow 10 parameters at most
1200 pub struct CurveSegment {
1201 pub x0: f32,
1202 pub x1: f32,
1203 pub Type: i32,
1204 pub Params: [f64; 10],
1205 pub nGridPoints: u32,
1206 pub SampledPoints: *mut f32,
1207 }
1208 impl Default for CurveSegment {
default() -> Self1209 fn default() -> Self { unsafe { mem::zeroed() } }
1210 }
1211
1212 pub enum ToneCurve { }
1213 pub enum Pipeline { }
1214 pub enum Stage { }
1215
1216 #[derive(Copy, Clone, PartialEq, Eq)]
1217 #[repr(u32)]
1218 #[derive(Debug)]
1219 /// Where to place/locate the stages in the pipeline chain
1220 pub enum StageLoc {
1221 AT_BEGIN = 0,
1222 AT_END = 1,
1223 }
1224 pub type SAMPLER16 = unsafe extern "C" fn(input: *const u16, output: *mut u16, user_data: *mut c_void) -> i32;
1225 pub type SAMPLERFLOAT = unsafe extern "C" fn(input: *const f32, output: *mut f32, user_data: *mut c_void) -> i32;
1226
1227 #[repr(C)]
1228 pub struct MLU { _opaque_type: [u8; 0] }
1229
1230 #[repr(C)]
1231 #[derive(Copy, Clone)]
1232 #[derive(Debug)]
1233 pub struct UcrBg {
1234 pub Ucr: *mut ToneCurve,
1235 pub Bg: *mut ToneCurve,
1236 pub Desc: *mut MLU,
1237 }
1238
1239 pub const PRINTER_DEFAULT_SCREENS: u32 = 0x0001;
1240 pub const FREQUENCE_UNITS_LINES_CM: u32 = 0x0000;
1241 pub const FREQUENCE_UNITS_LINES_INCH: u32 = 0x0002;
1242
1243 #[repr(C)]
1244 #[derive(Copy, Clone)]
1245 #[derive(Debug)]
1246 pub enum SpotShape {
1247 UNKNOWN = 0,
1248 PRINTER_DEFAULT = 1,
1249 ROUND = 2,
1250 DIAMOND = 3,
1251 ELLIPSE = 4,
1252 LINE = 5,
1253 SQUARE = 6,
1254 CROSS = 7,
1255 }
1256
1257 #[repr(C)]
1258 #[derive(Copy, Clone)]
1259 #[derive(Debug)]
1260 pub struct ScreeningChannel {
1261 pub Frequency: f64,
1262 pub ScreenAngle: f64,
1263 pub SpotShape: SpotShape,
1264 }
1265 impl Default for ScreeningChannel {
default() -> Self1266 fn default() -> Self { unsafe { mem::zeroed() } }
1267 }
1268
1269 #[repr(C)]
1270 #[derive(Copy, Clone)]
1271 #[derive(Debug)]
1272 pub struct Screening {
1273 pub Flag: u32,
1274 pub nChannels: u32,
1275 pub Channels: [ScreeningChannel; 16],
1276 }
1277 impl Default for Screening {
default() -> Self1278 fn default() -> Self { unsafe { mem::zeroed() } }
1279 }
1280 #[repr(C)]
1281 pub struct NAMEDCOLORLIST { _opaque_type: [u8; 0] }
1282
1283 #[repr(C)]
1284 #[derive(Copy, Clone)]
1285 #[derive(Debug)]
1286 /// Profile sequence descriptor.
1287 ///
1288 /// Some fields come from profile sequence descriptor tag, others
1289 /// come from Profile Sequence Identifier Tag
1290 pub struct PSEQDESC {
1291 pub deviceMfg: Signature,
1292 pub deviceModel: Signature,
1293 pub attributes: u64,
1294 pub technology: TechnologySignature,
1295 pub ProfileID: ProfileID,
1296 pub Manufacturer: *mut MLU,
1297 pub Model: *mut MLU,
1298 pub Description: *mut MLU,
1299 }
1300
1301 #[repr(C)]
1302 #[derive(Copy, Clone)]
1303 #[derive(Debug)]
1304 pub struct SEQ {
1305 pub n: u32,
1306 pub ContextID: Context,
1307 pub seq: *mut PSEQDESC,
1308 }
1309
1310 pub const EmbeddedProfileFalse: u32 = 0x00000000;
1311 pub const EmbeddedProfileTrue: u32 = 0x00000001;
1312 pub const UseAnywhere: u32 = 0x00000000;
1313 pub const UseWithEmbeddedDataOnly: u32 = 0x00000002;
1314
1315 #[repr(C)]
1316 #[derive(Copy, Clone)]
1317 #[derive(Debug)]
1318 pub struct DICTentry {
1319 pub Next: *mut DICTentry,
1320 pub DisplayName: *mut MLU,
1321 pub DisplayValue: *mut MLU,
1322 pub Name: *mut wchar_t,
1323 pub Value: *mut wchar_t,
1324 }
1325
1326 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
1327 #[repr(u32)]
1328 #[derive(Debug)]
1329 pub enum InfoType {
1330 Description = 0,
1331 Manufacturer = 1,
1332 Model = 2,
1333 Copyright = 3,
1334 }
1335 #[repr(C)]
1336 pub struct IOHANDLER { _opaque_type: [u8; 0] }
1337
1338
1339 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
1340 #[repr(u32)]
1341 #[derive(Debug)]
1342 pub enum Intent {
1343 /// ICC Intents
1344 Perceptual = 0,
1345 RelativeColorimetric = 1,
1346 Saturation = 2,
1347 AbsoluteColorimetric = 3,
1348
1349 /// non-icc intents
1350 PreserveKOnlyPerceptual = 10,
1351 PreserveKOnlyRelativeColorimetric = 11,
1352 PreserveKOnlySaturation = 12,
1353 PreserveKPlanePerceptual = 13,
1354 PreserveKPlaneRelativeColorimetric = 14,
1355 PreserveKPlaneSaturation = 15,
1356 }
1357
1358 // Flags
1359
1360 /// Inhibit 1-pixel cache
1361 pub const FLAGS_NOCACHE: u32 = 0x0040;
1362 /// Inhibit optimizations
1363 pub const FLAGS_NOOPTIMIZE: u32 = 0x0100;
1364 /// Don't transform anyway
1365 pub const FLAGS_NULLTRANSFORM: u32 = 0x0200;
1366
1367 /// Proofing flags
1368 /// Out of Gamut alarm
1369 pub const FLAGS_GAMUTCHECK: u32 = 0x1000;
1370 /// Do softproofing
1371 pub const FLAGS_SOFTPROOFING: u32 = 0x4000;
1372
1373 // Misc
1374 pub const FLAGS_BLACKPOINTCOMPENSATION: u32 = 0x2000;
1375 /// Don't fix scum dot
1376 pub const FLAGS_NOWHITEONWHITEFIXUP: u32 = 0x0004;
1377 /// Use more memory to give better accurancy
1378 pub const FLAGS_HIGHRESPRECALC: u32 = 0x0400;
1379 /// Use less memory to minimize resources
1380 pub const FLAGS_LOWRESPRECALC: u32 = 0x0800;
1381
1382 /// For devicelink creation
1383 /// Create 8 bits devicelinks
1384 pub const FLAGS_8BITS_DEVICELINK: u32 = 0x0008;
1385 /// Guess device class (for transform2devicelink)
1386 pub const FLAGS_GUESSDEVICECLASS: u32 = 0x0020;
1387 /// Keep profile sequence for devicelink creation
1388 pub const FLAGS_KEEP_SEQUENCE: u32 = 0x0080;
1389
1390 /// Specific to a particular optimizations
1391 /// Force CLUT optimization
1392 pub const FLAGS_FORCE_CLUT: u32 = 0x0002;
1393 /// create postlinearization tables if possible
1394 pub const FLAGS_CLUT_POST_LINEARIZATION: u32 = 0x0001;
1395 /// create prelinearization tables if possible
1396 pub const FLAGS_CLUT_PRE_LINEARIZATION: u32 = 0x0010;
1397
1398 /// Specific to unbounded mode
1399 /// Prevent negative numbers in floating point transforms
1400 pub const FLAGS_NONEGATIVES: u32 = 0x8000;
1401
1402 /// Alpha channels are copied on `cmsDoTransform()`
1403 pub const FLAGS_COPY_ALPHA: u32 = 0x04000000;
1404
1405 // Fine-tune control over number of gridpoints
FLAGS_GRIDPOINTS(n: u32) -> u321406 pub fn FLAGS_GRIDPOINTS(n: u32) -> u32 { ((n) & 0xFF) << 16 }
1407
1408 /// CRD special
1409 pub const FLAGS_NODEFAULTRESOURCEDEF: u32 = 0x01000000;
1410
1411 /// Use this flag to prevent changes being written to destination.
1412 pub const SAMPLER_INSPECT: u32 = 0x01000000;
1413
1414 #[derive(Copy, Clone, PartialEq, Eq)]
1415 #[repr(u32)]
1416 #[derive(Debug)]
1417 pub enum PSResourceType {
1418 PS_RESOURCE_CSA = 0,
1419 PS_RESOURCE_CRD = 1,
1420 }
1421
1422 extern "C" {
cmsGetEncodedCMMversion() -> c_int1423 pub fn cmsGetEncodedCMMversion() -> c_int;
cmsstrcasecmp(s1: *const c_char, s2: *const c_char) -> c_int1424 pub fn cmsstrcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
cmsfilelength(f: *mut FILE) -> c_long1425 pub fn cmsfilelength(f: *mut FILE) -> c_long;
cmsCreateContext(Plugin: *mut c_void, UserData: *mut c_void) -> Context1426 pub fn cmsCreateContext(Plugin: *mut c_void, UserData: *mut c_void) -> Context;
cmsDeleteContext(ContexID: Context)1427 pub fn cmsDeleteContext(ContexID: Context);
cmsDupContext(ContextID: Context, NewUserData: *mut c_void) -> Context1428 pub fn cmsDupContext(ContextID: Context, NewUserData: *mut c_void) -> Context;
cmsGetContextUserData(ContextID: Context) -> *mut c_void1429 pub fn cmsGetContextUserData(ContextID: Context) -> *mut c_void;
cmsPlugin(Plugin: *mut c_void) -> Bool1430 pub fn cmsPlugin(Plugin: *mut c_void) -> Bool;
cmsPluginTHR(ContextID: Context, Plugin: *mut c_void) -> Bool1431 pub fn cmsPluginTHR(ContextID: Context, Plugin: *mut c_void) -> Bool;
cmsUnregisterPlugins()1432 pub fn cmsUnregisterPlugins();
cmsUnregisterPluginsTHR(ContextID: Context)1433 pub fn cmsUnregisterPluginsTHR(ContextID: Context);
cmsSetLogErrorHandler(Fn: LogErrorHandlerFunction)1434 pub fn cmsSetLogErrorHandler(Fn: LogErrorHandlerFunction);
cmsSetLogErrorHandlerTHR(ContextID: Context, Fn: LogErrorHandlerFunction)1435 pub fn cmsSetLogErrorHandlerTHR(ContextID: Context, Fn: LogErrorHandlerFunction);
cmsD50_XYZ() -> &'static CIEXYZ1436 pub fn cmsD50_XYZ() -> &'static CIEXYZ;
cmsD50_xyY() -> &'static CIExyY1437 pub fn cmsD50_xyY() -> &'static CIExyY;
cmsXYZ2xyY(Dest: *mut CIExyY, Source: *const CIEXYZ)1438 pub fn cmsXYZ2xyY(Dest: *mut CIExyY, Source: *const CIEXYZ);
cmsxyY2XYZ(Dest: *mut CIEXYZ, Source: *const CIExyY)1439 pub fn cmsxyY2XYZ(Dest: *mut CIEXYZ, Source: *const CIExyY);
cmsXYZ2Lab(WhitePoint: *const CIEXYZ, Lab: *mut CIELab, xyz: *const CIEXYZ)1440 pub fn cmsXYZ2Lab(WhitePoint: *const CIEXYZ, Lab: *mut CIELab, xyz: *const CIEXYZ);
cmsLab2XYZ(WhitePoint: *const CIEXYZ, xyz: *mut CIEXYZ, Lab: *const CIELab)1441 pub fn cmsLab2XYZ(WhitePoint: *const CIEXYZ, xyz: *mut CIEXYZ, Lab: *const CIELab);
cmsLab2LCh(LCh: *mut CIELCh, Lab: *const CIELab)1442 pub fn cmsLab2LCh(LCh: *mut CIELCh, Lab: *const CIELab);
cmsLCh2Lab(Lab: *mut CIELab, LCh: *const CIELCh)1443 pub fn cmsLCh2Lab(Lab: *mut CIELab, LCh: *const CIELCh);
cmsLabEncoded2Float(Lab: *mut CIELab, wLab: *const u16)1444 pub fn cmsLabEncoded2Float(Lab: *mut CIELab, wLab: *const u16);
cmsLabEncoded2FloatV2(Lab: *mut CIELab, wLab: *const u16)1445 pub fn cmsLabEncoded2FloatV2(Lab: *mut CIELab, wLab: *const u16);
cmsFloat2LabEncoded(wLab: *mut u16, Lab: *const CIELab)1446 pub fn cmsFloat2LabEncoded(wLab: *mut u16, Lab: *const CIELab);
cmsFloat2LabEncodedV2(wLab: *mut u16, Lab: *const CIELab)1447 pub fn cmsFloat2LabEncodedV2(wLab: *mut u16, Lab: *const CIELab);
cmsXYZEncoded2Float(fxyz: *mut CIEXYZ, XYZ: *const u16)1448 pub fn cmsXYZEncoded2Float(fxyz: *mut CIEXYZ, XYZ: *const u16);
cmsFloat2XYZEncoded(XYZ: *mut u16, fXYZ: *const CIEXYZ)1449 pub fn cmsFloat2XYZEncoded(XYZ: *mut u16, fXYZ: *const CIEXYZ);
cmsDeltaE(Lab1: *const CIELab, Lab2: *const CIELab) -> f641450 pub fn cmsDeltaE(Lab1: *const CIELab, Lab2: *const CIELab) -> f64;
cmsCIE94DeltaE(Lab1: *const CIELab, Lab2: *const CIELab) -> f641451 pub fn cmsCIE94DeltaE(Lab1: *const CIELab, Lab2: *const CIELab) -> f64;
cmsBFDdeltaE(Lab1: *const CIELab, Lab2: *const CIELab) -> f641452 pub fn cmsBFDdeltaE(Lab1: *const CIELab, Lab2: *const CIELab) -> f64;
cmsCMCdeltaE(Lab1: *const CIELab, Lab2: *const CIELab, l: f64, c: f64) -> f641453 pub fn cmsCMCdeltaE(Lab1: *const CIELab, Lab2: *const CIELab, l: f64, c: f64) -> f64;
cmsCIE2000DeltaE(Lab1: *const CIELab, Lab2: *const CIELab, Kl: f64, Kc: f64, Kh: f64) -> f641454 pub fn cmsCIE2000DeltaE(Lab1: *const CIELab, Lab2: *const CIELab, Kl: f64, Kc: f64, Kh: f64) -> f64;
cmsWhitePointFromTemp(WhitePoint: *mut CIExyY, TempK: f64) -> Bool1455 pub fn cmsWhitePointFromTemp(WhitePoint: *mut CIExyY, TempK: f64) -> Bool;
cmsTempFromWhitePoint(TempK: *mut f64, WhitePoint: *const CIExyY) -> Bool1456 pub fn cmsTempFromWhitePoint(TempK: *mut f64, WhitePoint: *const CIExyY) -> Bool;
cmsAdaptToIlluminant(Result: *mut CIEXYZ, SourceWhitePt: *const CIEXYZ, Illuminant: *const CIEXYZ, Value: *const CIEXYZ) -> Bool1457 pub fn cmsAdaptToIlluminant(Result: *mut CIEXYZ, SourceWhitePt: *const CIEXYZ, Illuminant: *const CIEXYZ, Value: *const CIEXYZ) -> Bool;
cmsCIECAM02Init(ContextID: Context, pVC: *const ViewingConditions) -> HANDLE1458 pub fn cmsCIECAM02Init(ContextID: Context, pVC: *const ViewingConditions) -> HANDLE;
cmsCIECAM02Done(hModel: HANDLE)1459 pub fn cmsCIECAM02Done(hModel: HANDLE);
cmsCIECAM02Forward(hModel: HANDLE, pIn: *const CIEXYZ, pOut: *mut JCh)1460 pub fn cmsCIECAM02Forward(hModel: HANDLE, pIn: *const CIEXYZ, pOut: *mut JCh);
cmsCIECAM02Reverse(hModel: HANDLE, pIn: *const JCh, pOut: *mut CIEXYZ)1461 pub fn cmsCIECAM02Reverse(hModel: HANDLE, pIn: *const JCh, pOut: *mut CIEXYZ);
cmsBuildSegmentedToneCurve(ContextID: Context, nSegments: u32, Segments: *const CurveSegment) -> *mut ToneCurve1462 pub fn cmsBuildSegmentedToneCurve(ContextID: Context, nSegments: u32, Segments: *const CurveSegment) -> *mut ToneCurve;
cmsBuildParametricToneCurve(ContextID: Context, Type: i32, Params: *const f64) -> *mut ToneCurve1463 pub fn cmsBuildParametricToneCurve(ContextID: Context, Type: i32, Params: *const f64) -> *mut ToneCurve;
cmsBuildGamma(ContextID: Context, Gamma: f64) -> *mut ToneCurve1464 pub fn cmsBuildGamma(ContextID: Context, Gamma: f64) -> *mut ToneCurve;
cmsBuildTabulatedToneCurve16(ContextID: Context, nEntries: u32, values: *const u16) -> *mut ToneCurve1465 pub fn cmsBuildTabulatedToneCurve16(ContextID: Context, nEntries: u32, values: *const u16) -> *mut ToneCurve;
cmsBuildTabulatedToneCurveFloat(ContextID: Context, nEntries: u32, values: *const f32) -> *mut ToneCurve1466 pub fn cmsBuildTabulatedToneCurveFloat(ContextID: Context, nEntries: u32, values: *const f32) -> *mut ToneCurve;
cmsFreeToneCurve(Curve: *mut ToneCurve)1467 pub fn cmsFreeToneCurve(Curve: *mut ToneCurve);
cmsFreeToneCurveTriple(Curve: *mut *mut ToneCurve)1468 pub fn cmsFreeToneCurveTriple(Curve: *mut *mut ToneCurve);
cmsDupToneCurve(Src: *const ToneCurve) -> *mut ToneCurve1469 pub fn cmsDupToneCurve(Src: *const ToneCurve) -> *mut ToneCurve;
cmsReverseToneCurve(InGamma: *const ToneCurve) -> *mut ToneCurve1470 pub fn cmsReverseToneCurve(InGamma: *const ToneCurve) -> *mut ToneCurve;
cmsReverseToneCurveEx(nResultSamples: u32, InGamma: *const ToneCurve) -> *mut ToneCurve1471 pub fn cmsReverseToneCurveEx(nResultSamples: u32, InGamma: *const ToneCurve) -> *mut ToneCurve;
cmsJoinToneCurve(ContextID: Context, X: *const ToneCurve, Y: *const ToneCurve, nPoints: u32) -> *mut ToneCurve1472 pub fn cmsJoinToneCurve(ContextID: Context, X: *const ToneCurve, Y: *const ToneCurve, nPoints: u32) -> *mut ToneCurve;
cmsSmoothToneCurve(Tab: *mut ToneCurve, lambda: f64) -> Bool1473 pub fn cmsSmoothToneCurve(Tab: *mut ToneCurve, lambda: f64) -> Bool;
cmsEvalToneCurveFloat(Curve: *const ToneCurve, v: f32) -> f321474 pub fn cmsEvalToneCurveFloat(Curve: *const ToneCurve, v: f32) -> f32;
cmsEvalToneCurve16(Curve: *const ToneCurve, v: u16) -> u161475 pub fn cmsEvalToneCurve16(Curve: *const ToneCurve, v: u16) -> u16;
cmsIsToneCurveMultisegment(InGamma: *const ToneCurve) -> Bool1476 pub fn cmsIsToneCurveMultisegment(InGamma: *const ToneCurve) -> Bool;
cmsIsToneCurveLinear(Curve: *const ToneCurve) -> Bool1477 pub fn cmsIsToneCurveLinear(Curve: *const ToneCurve) -> Bool;
cmsIsToneCurveMonotonic(t: *const ToneCurve) -> Bool1478 pub fn cmsIsToneCurveMonotonic(t: *const ToneCurve) -> Bool;
cmsIsToneCurveDescending(t: *const ToneCurve) -> Bool1479 pub fn cmsIsToneCurveDescending(t: *const ToneCurve) -> Bool;
cmsGetToneCurveParametricType(t: *const ToneCurve) -> i321480 pub fn cmsGetToneCurveParametricType(t: *const ToneCurve) -> i32;
cmsEstimateGamma(t: *const ToneCurve, Precision: f64) -> f641481 pub fn cmsEstimateGamma(t: *const ToneCurve, Precision: f64) -> f64;
cmsGetToneCurveEstimatedTableEntries(t: *const ToneCurve) -> u321482 pub fn cmsGetToneCurveEstimatedTableEntries(t: *const ToneCurve) -> u32;
cmsGetToneCurveEstimatedTable(t: *const ToneCurve) -> *const u161483 pub fn cmsGetToneCurveEstimatedTable(t: *const ToneCurve) -> *const u16;
cmsPipelineAlloc(ContextID: Context, InputChannels: u32, OutputChannels: u32) -> *mut Pipeline1484 pub fn cmsPipelineAlloc(ContextID: Context, InputChannels: u32, OutputChannels: u32) -> *mut Pipeline;
cmsPipelineFree(lut: *mut Pipeline)1485 pub fn cmsPipelineFree(lut: *mut Pipeline);
cmsPipelineDup(Orig: *const Pipeline) -> *mut Pipeline1486 pub fn cmsPipelineDup(Orig: *const Pipeline) -> *mut Pipeline;
cmsGetPipelineContextID(lut: *const Pipeline) -> Context1487 pub fn cmsGetPipelineContextID(lut: *const Pipeline) -> Context;
cmsPipelineInputChannels(lut: *const Pipeline) -> u321488 pub fn cmsPipelineInputChannels(lut: *const Pipeline) -> u32;
cmsPipelineOutputChannels(lut: *const Pipeline) -> u321489 pub fn cmsPipelineOutputChannels(lut: *const Pipeline) -> u32;
cmsPipelineStageCount(lut: *const Pipeline) -> u321490 pub fn cmsPipelineStageCount(lut: *const Pipeline) -> u32;
cmsPipelineGetPtrToFirstStage(lut: *const Pipeline) -> *mut Stage1491 pub fn cmsPipelineGetPtrToFirstStage(lut: *const Pipeline) -> *mut Stage;
cmsPipelineGetPtrToLastStage(lut: *const Pipeline) -> *mut Stage1492 pub fn cmsPipelineGetPtrToLastStage(lut: *const Pipeline) -> *mut Stage;
cmsPipelineEval16(In: *const u16, Out: *mut u16, lut: *const Pipeline)1493 pub fn cmsPipelineEval16(In: *const u16, Out: *mut u16, lut: *const Pipeline);
cmsPipelineEvalFloat(In: *const f32, Out: *mut f32, lut: *const Pipeline)1494 pub fn cmsPipelineEvalFloat(In: *const f32, Out: *mut f32, lut: *const Pipeline);
cmsPipelineEvalReverseFloat(Target: *mut f32, Result: *mut f32, Hint: *mut f32, lut: *const Pipeline) -> Bool1495 pub fn cmsPipelineEvalReverseFloat(Target: *mut f32, Result: *mut f32, Hint: *mut f32, lut: *const Pipeline) -> Bool;
cmsPipelineCat(l1: *mut Pipeline, l2: *const Pipeline) -> Bool1496 pub fn cmsPipelineCat(l1: *mut Pipeline, l2: *const Pipeline) -> Bool;
cmsPipelineSetSaveAs8bitsFlag(lut: *mut Pipeline, On: Bool) -> Bool1497 pub fn cmsPipelineSetSaveAs8bitsFlag(lut: *mut Pipeline, On: Bool) -> Bool;
cmsPipelineInsertStage(lut: *mut Pipeline, loc: StageLoc, mpe: *mut Stage) -> bool1498 pub fn cmsPipelineInsertStage(lut: *mut Pipeline, loc: StageLoc, mpe: *mut Stage) -> bool;
cmsPipelineUnlinkStage(lut: *mut Pipeline, loc: StageLoc, mpe: *mut *mut Stage)1499 pub fn cmsPipelineUnlinkStage(lut: *mut Pipeline, loc: StageLoc, mpe: *mut *mut Stage);
1500 /// This function is quite useful to analyze the structure of a Pipeline and retrieve the Stage elements
1501 /// that conform the Pipeline.
1502 ///
1503 /// It should be called with the Pipeline, the number of expected elements and
1504 /// then a list of expected types followed with a list of double pointers to Stage elements. If
1505 /// the function founds a match with current pipeline, it fills the pointers and returns TRUE
1506 /// if not, returns FALSE without touching anything.
cmsPipelineCheckAndRetreiveStages(Lut: *const Pipeline, n: u32, ...) -> Bool1507 pub fn cmsPipelineCheckAndRetreiveStages(Lut: *const Pipeline, n: u32, ...) -> Bool;
cmsStageAllocIdentity(ContextID: Context, nChannels: u32) -> *mut Stage1508 pub fn cmsStageAllocIdentity(ContextID: Context, nChannels: u32) -> *mut Stage;
cmsStageAllocToneCurves(ContextID: Context, nChannels: u32, Curves: *const *const ToneCurve) -> *mut Stage1509 pub fn cmsStageAllocToneCurves(ContextID: Context, nChannels: u32, Curves: *const *const ToneCurve) -> *mut Stage;
cmsStageAllocMatrix(ContextID: Context, Rows: u32, Cols: u32, Matrix: *const f64, Offset: *const f64) -> *mut Stage1510 pub fn cmsStageAllocMatrix(ContextID: Context, Rows: u32, Cols: u32, Matrix: *const f64, Offset: *const f64) -> *mut Stage;
cmsStageAllocCLut16bit(ContextID: Context, nGridPoints: u32, inputChan: u32, outputChan: u32, Table: *const u16) -> *mut Stage1511 pub fn cmsStageAllocCLut16bit(ContextID: Context, nGridPoints: u32, inputChan: u32, outputChan: u32, Table: *const u16) -> *mut Stage;
cmsStageAllocCLutFloat(ContextID: Context, nGridPoints: u32, inputChan: u32, outputChan: u32, Table: *const f32) -> *mut Stage1512 pub fn cmsStageAllocCLutFloat(ContextID: Context, nGridPoints: u32, inputChan: u32, outputChan: u32, Table: *const f32) -> *mut Stage;
cmsStageAllocCLut16bitGranular(ContextID: Context, clutPoints: *const u32, inputChan: u32, outputChan: u32, Table: *const u16) -> *mut Stage1513 pub fn cmsStageAllocCLut16bitGranular(ContextID: Context, clutPoints: *const u32, inputChan: u32, outputChan: u32, Table: *const u16) -> *mut Stage;
cmsStageAllocCLutFloatGranular(ContextID: Context, clutPoints: *const u32, inputChan: u32, outputChan: u32, Table: *const f32) -> *mut Stage1514 pub fn cmsStageAllocCLutFloatGranular(ContextID: Context, clutPoints: *const u32, inputChan: u32, outputChan: u32, Table: *const f32) -> *mut Stage;
cmsStageDup(mpe: *mut Stage) -> *mut Stage1515 pub fn cmsStageDup(mpe: *mut Stage) -> *mut Stage;
cmsStageFree(mpe: *mut Stage)1516 pub fn cmsStageFree(mpe: *mut Stage);
cmsStageNext(mpe: *const Stage) -> *mut Stage1517 pub fn cmsStageNext(mpe: *const Stage) -> *mut Stage;
cmsStageInputChannels(mpe: *const Stage) -> u321518 pub fn cmsStageInputChannels(mpe: *const Stage) -> u32;
cmsStageOutputChannels(mpe: *const Stage) -> u321519 pub fn cmsStageOutputChannels(mpe: *const Stage) -> u32;
cmsStageType(mpe: *const Stage) -> StageSignature1520 pub fn cmsStageType(mpe: *const Stage) -> StageSignature;
cmsStageData(mpe: *const Stage) -> *mut c_void1521 pub fn cmsStageData(mpe: *const Stage) -> *mut c_void;
cmsStageSampleCLut16bit(mpe: *mut Stage, Sampler: SAMPLER16, Cargo: *mut c_void, dwFlags: u32) -> Bool1522 pub fn cmsStageSampleCLut16bit(mpe: *mut Stage, Sampler: SAMPLER16, Cargo: *mut c_void, dwFlags: u32) -> Bool;
cmsStageSampleCLutFloat(mpe: *mut Stage, Sampler: SAMPLERFLOAT, Cargo: *mut c_void, dwFlags: u32) -> Bool1523 pub fn cmsStageSampleCLutFloat(mpe: *mut Stage, Sampler: SAMPLERFLOAT, Cargo: *mut c_void, dwFlags: u32) -> Bool;
cmsSliceSpace16(nInputs: u32, clutPoints: *const u32, Sampler: SAMPLER16, Cargo: *mut c_void) -> Bool1524 pub fn cmsSliceSpace16(nInputs: u32, clutPoints: *const u32, Sampler: SAMPLER16, Cargo: *mut c_void) -> Bool;
cmsSliceSpaceFloat(nInputs: u32, clutPoints: *const u32, Sampler: SAMPLERFLOAT, Cargo: *mut c_void) -> Bool1525 pub fn cmsSliceSpaceFloat(nInputs: u32, clutPoints: *const u32, Sampler: SAMPLERFLOAT, Cargo: *mut c_void) -> Bool;
cmsMLUalloc(ContextID: Context, nItems: u32) -> *mut MLU1526 pub fn cmsMLUalloc(ContextID: Context, nItems: u32) -> *mut MLU;
cmsMLUfree(mlu: *mut MLU)1527 pub fn cmsMLUfree(mlu: *mut MLU);
cmsMLUdup(mlu: *const MLU) -> *mut MLU1528 pub fn cmsMLUdup(mlu: *const MLU) -> *mut MLU;
cmsMLUsetASCII(mlu: *mut MLU, LanguageCode: *const c_char, CountryCode: *const c_char, ASCIIString: *const c_char) -> Bool1529 pub fn cmsMLUsetASCII(mlu: *mut MLU, LanguageCode: *const c_char, CountryCode: *const c_char, ASCIIString: *const c_char) -> Bool;
cmsMLUsetWide(mlu: *mut MLU, LanguageCode: *const c_char, CountryCode: *const c_char, WideString: *const wchar_t) -> Bool1530 pub fn cmsMLUsetWide(mlu: *mut MLU, LanguageCode: *const c_char, CountryCode: *const c_char, WideString: *const wchar_t) -> Bool;
cmsMLUgetASCII(mlu: *const MLU, LanguageCode: *const c_char, CountryCode: *const c_char, Buffer: *mut c_char, BufferSize: u32) -> u321531 pub fn cmsMLUgetASCII(mlu: *const MLU, LanguageCode: *const c_char, CountryCode: *const c_char, Buffer: *mut c_char, BufferSize: u32) -> u32;
cmsMLUgetWide(mlu: *const MLU, LanguageCode: *const c_char, CountryCode: *const c_char, Buffer: *mut wchar_t, BufferSize: u32) -> u321532 pub fn cmsMLUgetWide(mlu: *const MLU, LanguageCode: *const c_char, CountryCode: *const c_char, Buffer: *mut wchar_t, BufferSize: u32) -> u32;
cmsMLUgetTranslation(mlu: *const MLU, LanguageCode: *const c_char, CountryCode: *const c_char, ObtainedLanguage: *mut c_char, ObtainedCountry: *mut c_char) -> Bool1533 pub fn cmsMLUgetTranslation(mlu: *const MLU, LanguageCode: *const c_char, CountryCode: *const c_char, ObtainedLanguage: *mut c_char, ObtainedCountry: *mut c_char) -> Bool;
cmsMLUtranslationsCount(mlu: *const MLU) -> u321534 pub fn cmsMLUtranslationsCount(mlu: *const MLU) -> u32;
cmsMLUtranslationsCodes(mlu: *const MLU, idx: u32, LanguageCode: *mut c_char, CountryCode: *mut c_char) -> Bool1535 pub fn cmsMLUtranslationsCodes(mlu: *const MLU, idx: u32, LanguageCode: *mut c_char, CountryCode: *mut c_char) -> Bool;
cmsAllocNamedColorList(ContextID: Context, n: u32, ColorantCount: u32, Prefix: *const c_char, Suffix: *const c_char) -> *mut NAMEDCOLORLIST1536 pub fn cmsAllocNamedColorList(ContextID: Context, n: u32, ColorantCount: u32, Prefix: *const c_char, Suffix: *const c_char) -> *mut NAMEDCOLORLIST;
cmsFreeNamedColorList(v: *mut NAMEDCOLORLIST)1537 pub fn cmsFreeNamedColorList(v: *mut NAMEDCOLORLIST);
cmsDupNamedColorList(v: *const NAMEDCOLORLIST) -> *mut NAMEDCOLORLIST1538 pub fn cmsDupNamedColorList(v: *const NAMEDCOLORLIST) -> *mut NAMEDCOLORLIST;
cmsAppendNamedColor(v: *mut NAMEDCOLORLIST, Name: *const c_char, PCS: *mut u16, Colorant: *mut u16) -> Bool1539 pub fn cmsAppendNamedColor(v: *mut NAMEDCOLORLIST, Name: *const c_char, PCS: *mut u16, Colorant: *mut u16) -> Bool;
cmsNamedColorCount(v: *const NAMEDCOLORLIST) -> u321540 pub fn cmsNamedColorCount(v: *const NAMEDCOLORLIST) -> u32;
cmsNamedColorIndex(v: *const NAMEDCOLORLIST, Name: *const c_char) -> i321541 pub fn cmsNamedColorIndex(v: *const NAMEDCOLORLIST, Name: *const c_char) -> i32;
cmsNamedColorInfo(NamedColorList: *const NAMEDCOLORLIST, nColor: u32, Name: *mut c_char, Prefix: *mut c_char, Suffix: *mut c_char, PCS: *mut u16, Colorant: *mut u16) -> Bool1542 pub fn cmsNamedColorInfo(NamedColorList: *const NAMEDCOLORLIST, nColor: u32, Name: *mut c_char, Prefix: *mut c_char, Suffix: *mut c_char, PCS: *mut u16, Colorant: *mut u16) -> Bool;
cmsGetNamedColorList(xform: HTRANSFORM) -> *mut NAMEDCOLORLIST1543 pub fn cmsGetNamedColorList(xform: HTRANSFORM) -> *mut NAMEDCOLORLIST;
cmsAllocProfileSequenceDescription(ContextID: Context, n: u32) -> *mut SEQ1544 pub fn cmsAllocProfileSequenceDescription(ContextID: Context, n: u32) -> *mut SEQ;
cmsDupProfileSequenceDescription(pseq: *const SEQ) -> *mut SEQ1545 pub fn cmsDupProfileSequenceDescription(pseq: *const SEQ) -> *mut SEQ;
cmsFreeProfileSequenceDescription(pseq: *mut SEQ)1546 pub fn cmsFreeProfileSequenceDescription(pseq: *mut SEQ);
cmsDictAlloc(ContextID: Context) -> HANDLE1547 pub fn cmsDictAlloc(ContextID: Context) -> HANDLE;
cmsDictFree(hDict: HANDLE)1548 pub fn cmsDictFree(hDict: HANDLE);
cmsDictDup(hDict: HANDLE) -> HANDLE1549 pub fn cmsDictDup(hDict: HANDLE) -> HANDLE;
cmsDictAddEntry(hDict: HANDLE, Name: *const wchar_t, Value: *const wchar_t, DisplayName: *const MLU, DisplayValue: *const MLU) -> Bool1550 pub fn cmsDictAddEntry(hDict: HANDLE, Name: *const wchar_t, Value: *const wchar_t, DisplayName: *const MLU, DisplayValue: *const MLU) -> Bool;
cmsDictGetEntryList(hDict: HANDLE) -> *const DICTentry1551 pub fn cmsDictGetEntryList(hDict: HANDLE) -> *const DICTentry;
cmsDictNextEntry(e: *const DICTentry) -> *const DICTentry1552 pub fn cmsDictNextEntry(e: *const DICTentry) -> *const DICTentry;
cmsCreateProfilePlaceholder(ContextID: Context) -> HPROFILE1553 pub fn cmsCreateProfilePlaceholder(ContextID: Context) -> HPROFILE;
cmsGetProfileContextID(hProfile: HPROFILE) -> Context1554 pub fn cmsGetProfileContextID(hProfile: HPROFILE) -> Context;
cmsGetTagCount(hProfile: HPROFILE) -> i321555 pub fn cmsGetTagCount(hProfile: HPROFILE) -> i32;
cmsGetTagSignature(hProfile: HPROFILE, n: u32) -> TagSignature1556 pub fn cmsGetTagSignature(hProfile: HPROFILE, n: u32) -> TagSignature;
cmsIsTag(hProfile: HPROFILE, sig: TagSignature) -> Bool1557 pub fn cmsIsTag(hProfile: HPROFILE, sig: TagSignature) -> Bool;
cmsReadTag(hProfile: HPROFILE, sig: TagSignature) -> *mut c_void1558 pub fn cmsReadTag(hProfile: HPROFILE, sig: TagSignature) -> *mut c_void;
cmsWriteTag(hProfile: HPROFILE, sig: TagSignature, data: *const c_void) -> Bool1559 pub fn cmsWriteTag(hProfile: HPROFILE, sig: TagSignature, data: *const c_void) -> Bool;
cmsLinkTag(hProfile: HPROFILE, sig: TagSignature, dest: TagSignature) -> Bool1560 pub fn cmsLinkTag(hProfile: HPROFILE, sig: TagSignature, dest: TagSignature) -> Bool;
cmsTagLinkedTo(hProfile: HPROFILE, sig: TagSignature) -> TagSignature1561 pub fn cmsTagLinkedTo(hProfile: HPROFILE, sig: TagSignature) -> TagSignature;
cmsReadRawTag(hProfile: HPROFILE, sig: TagSignature, Buffer: *mut c_void, BufferSize: u32) -> u321562 pub fn cmsReadRawTag(hProfile: HPROFILE, sig: TagSignature, Buffer: *mut c_void, BufferSize: u32) -> u32;
cmsWriteRawTag(hProfile: HPROFILE, sig: TagSignature, data: *const c_void, Size: u32) -> Bool1563 pub fn cmsWriteRawTag(hProfile: HPROFILE, sig: TagSignature, data: *const c_void, Size: u32) -> Bool;
cmsGetHeaderFlags(hProfile: HPROFILE) -> u321564 pub fn cmsGetHeaderFlags(hProfile: HPROFILE) -> u32;
cmsGetHeaderAttributes(hProfile: HPROFILE, Flags: *mut u64)1565 pub fn cmsGetHeaderAttributes(hProfile: HPROFILE, Flags: *mut u64);
cmsGetHeaderProfileID(hProfile: HPROFILE, ProfileID: *mut u8)1566 pub fn cmsGetHeaderProfileID(hProfile: HPROFILE, ProfileID: *mut u8);
cmsGetHeaderCreationDateTime(hProfile: HPROFILE, Dest: *mut tm) -> Bool1567 pub fn cmsGetHeaderCreationDateTime(hProfile: HPROFILE, Dest: *mut tm) -> Bool;
cmsGetHeaderRenderingIntent(hProfile: HPROFILE) -> Intent1568 pub fn cmsGetHeaderRenderingIntent(hProfile: HPROFILE) -> Intent;
cmsSetHeaderFlags(hProfile: HPROFILE, Flags: u32)1569 pub fn cmsSetHeaderFlags(hProfile: HPROFILE, Flags: u32);
cmsGetHeaderManufacturer(hProfile: HPROFILE) -> u321570 pub fn cmsGetHeaderManufacturer(hProfile: HPROFILE) -> u32;
cmsSetHeaderManufacturer(hProfile: HPROFILE, manufacturer: u32)1571 pub fn cmsSetHeaderManufacturer(hProfile: HPROFILE, manufacturer: u32);
cmsGetHeaderCreator(hProfile: HPROFILE) -> u321572 pub fn cmsGetHeaderCreator(hProfile: HPROFILE) -> u32;
cmsGetHeaderModel(hProfile: HPROFILE) -> u321573 pub fn cmsGetHeaderModel(hProfile: HPROFILE) -> u32;
cmsSetHeaderModel(hProfile: HPROFILE, model: u32)1574 pub fn cmsSetHeaderModel(hProfile: HPROFILE, model: u32);
cmsSetHeaderAttributes(hProfile: HPROFILE, Flags: u64)1575 pub fn cmsSetHeaderAttributes(hProfile: HPROFILE, Flags: u64);
cmsSetHeaderProfileID(hProfile: HPROFILE, ProfileID: *mut u8)1576 pub fn cmsSetHeaderProfileID(hProfile: HPROFILE, ProfileID: *mut u8);
cmsSetHeaderRenderingIntent(hProfile: HPROFILE, RenderingIntent: Intent)1577 pub fn cmsSetHeaderRenderingIntent(hProfile: HPROFILE, RenderingIntent: Intent);
cmsGetPCS(hProfile: HPROFILE) -> ColorSpaceSignature1578 pub fn cmsGetPCS(hProfile: HPROFILE) -> ColorSpaceSignature;
cmsSetPCS(hProfile: HPROFILE, pcs: ColorSpaceSignature)1579 pub fn cmsSetPCS(hProfile: HPROFILE, pcs: ColorSpaceSignature);
cmsGetColorSpace(hProfile: HPROFILE) -> ColorSpaceSignature1580 pub fn cmsGetColorSpace(hProfile: HPROFILE) -> ColorSpaceSignature;
cmsSetColorSpace(hProfile: HPROFILE, sig: ColorSpaceSignature)1581 pub fn cmsSetColorSpace(hProfile: HPROFILE, sig: ColorSpaceSignature);
cmsGetDeviceClass(hProfile: HPROFILE) -> ProfileClassSignature1582 pub fn cmsGetDeviceClass(hProfile: HPROFILE) -> ProfileClassSignature;
cmsSetDeviceClass(hProfile: HPROFILE, sig: ProfileClassSignature)1583 pub fn cmsSetDeviceClass(hProfile: HPROFILE, sig: ProfileClassSignature);
cmsSetProfileVersion(hProfile: HPROFILE, Version: f64)1584 pub fn cmsSetProfileVersion(hProfile: HPROFILE, Version: f64);
cmsGetProfileVersion(hProfile: HPROFILE) -> f641585 pub fn cmsGetProfileVersion(hProfile: HPROFILE) -> f64;
cmsGetEncodedICCversion(hProfile: HPROFILE) -> u321586 pub fn cmsGetEncodedICCversion(hProfile: HPROFILE) -> u32;
cmsSetEncodedICCversion(hProfile: HPROFILE, Version: u32)1587 pub fn cmsSetEncodedICCversion(hProfile: HPROFILE, Version: u32);
cmsIsIntentSupported(hProfile: HPROFILE, Intent: Intent, UsedDirection: u32) -> Bool1588 pub fn cmsIsIntentSupported(hProfile: HPROFILE, Intent: Intent, UsedDirection: u32) -> Bool;
cmsIsMatrixShaper(hProfile: HPROFILE) -> Bool1589 pub fn cmsIsMatrixShaper(hProfile: HPROFILE) -> Bool;
cmsIsCLUT(hProfile: HPROFILE, Intent: Intent, UsedDirection: u32) -> Bool1590 pub fn cmsIsCLUT(hProfile: HPROFILE, Intent: Intent, UsedDirection: u32) -> Bool;
_cmsICCcolorSpace(OurNotation: c_int) -> ColorSpaceSignature1591 pub fn _cmsICCcolorSpace(OurNotation: c_int) -> ColorSpaceSignature;
_cmsLCMScolorSpace(ProfileSpace: ColorSpaceSignature) -> c_int1592 pub fn _cmsLCMScolorSpace(ProfileSpace: ColorSpaceSignature) -> c_int;
cmsChannelsOf(ColorSpace: ColorSpaceSignature) -> u321593 pub fn cmsChannelsOf(ColorSpace: ColorSpaceSignature) -> u32;
cmsFormatterForColorspaceOfProfile(hProfile: HPROFILE, nBytes: u32, lIsFloat: Bool) -> u321594 pub fn cmsFormatterForColorspaceOfProfile(hProfile: HPROFILE, nBytes: u32, lIsFloat: Bool) -> u32;
cmsFormatterForPCSOfProfile(hProfile: HPROFILE, nBytes: u32, lIsFloat: Bool) -> u321595 pub fn cmsFormatterForPCSOfProfile(hProfile: HPROFILE, nBytes: u32, lIsFloat: Bool) -> u32;
cmsGetProfileInfo(hProfile: HPROFILE, Info: InfoType, LanguageCode: *const c_char, CountryCode: *const c_char, Buffer: *mut wchar_t, BufferSize: u32) -> u321596 pub fn cmsGetProfileInfo(hProfile: HPROFILE, Info: InfoType, LanguageCode: *const c_char, CountryCode: *const c_char, Buffer: *mut wchar_t, BufferSize: u32) -> u32;
cmsGetProfileInfoASCII(hProfile: HPROFILE, Info: InfoType, LanguageCode: *const c_char, CountryCode: *const c_char, Buffer: *mut c_char, BufferSize: u32) -> u321597 pub fn cmsGetProfileInfoASCII(hProfile: HPROFILE, Info: InfoType, LanguageCode: *const c_char, CountryCode: *const c_char, Buffer: *mut c_char, BufferSize: u32) -> u32;
cmsOpenIOhandlerFromFile(ContextID: Context, FileName: *const c_char, AccessMode: *const c_char) -> *mut IOHANDLER1598 pub fn cmsOpenIOhandlerFromFile(ContextID: Context, FileName: *const c_char, AccessMode: *const c_char) -> *mut IOHANDLER;
cmsOpenIOhandlerFromStream(ContextID: Context, Stream: *mut FILE) -> *mut IOHANDLER1599 pub fn cmsOpenIOhandlerFromStream(ContextID: Context, Stream: *mut FILE) -> *mut IOHANDLER;
cmsOpenIOhandlerFromMem(ContextID: Context, Buffer: *mut c_void, size: u32, AccessMode: *const c_char) -> *mut IOHANDLER1600 pub fn cmsOpenIOhandlerFromMem(ContextID: Context, Buffer: *mut c_void, size: u32, AccessMode: *const c_char) -> *mut IOHANDLER;
cmsOpenIOhandlerFromNULL(ContextID: Context) -> *mut IOHANDLER1601 pub fn cmsOpenIOhandlerFromNULL(ContextID: Context) -> *mut IOHANDLER;
cmsGetProfileIOhandler(hProfile: HPROFILE) -> *mut IOHANDLER1602 pub fn cmsGetProfileIOhandler(hProfile: HPROFILE) -> *mut IOHANDLER;
cmsCloseIOhandler(io: *mut IOHANDLER) -> Bool1603 pub fn cmsCloseIOhandler(io: *mut IOHANDLER) -> Bool;
cmsMD5computeID(hProfile: HPROFILE) -> Bool1604 pub fn cmsMD5computeID(hProfile: HPROFILE) -> Bool;
cmsOpenProfileFromFile(ICCProfile: *const c_char, sAccess: *const c_char) -> HPROFILE1605 pub fn cmsOpenProfileFromFile(ICCProfile: *const c_char, sAccess: *const c_char) -> HPROFILE;
cmsOpenProfileFromFileTHR(ContextID: Context, ICCProfile: *const c_char, sAccess: *const c_char) -> HPROFILE1606 pub fn cmsOpenProfileFromFileTHR(ContextID: Context, ICCProfile: *const c_char, sAccess: *const c_char) -> HPROFILE;
cmsOpenProfileFromStream(ICCProfile: *mut FILE, sAccess: *const c_char) -> HPROFILE1607 pub fn cmsOpenProfileFromStream(ICCProfile: *mut FILE, sAccess: *const c_char) -> HPROFILE;
cmsOpenProfileFromStreamTHR(ContextID: Context, ICCProfile: *mut FILE, sAccess: *const c_char) -> HPROFILE1608 pub fn cmsOpenProfileFromStreamTHR(ContextID: Context, ICCProfile: *mut FILE, sAccess: *const c_char) -> HPROFILE;
cmsOpenProfileFromMem(MemPtr: *const c_void, dwSize: u32) -> HPROFILE1609 pub fn cmsOpenProfileFromMem(MemPtr: *const c_void, dwSize: u32) -> HPROFILE;
cmsOpenProfileFromMemTHR(ContextID: Context, MemPtr: *const c_void, dwSize: u32) -> HPROFILE1610 pub fn cmsOpenProfileFromMemTHR(ContextID: Context, MemPtr: *const c_void, dwSize: u32) -> HPROFILE;
cmsOpenProfileFromIOhandlerTHR(ContextID: Context, io: *mut IOHANDLER) -> HPROFILE1611 pub fn cmsOpenProfileFromIOhandlerTHR(ContextID: Context, io: *mut IOHANDLER) -> HPROFILE;
cmsOpenProfileFromIOhandler2THR(ContextID: Context, io: *mut IOHANDLER, write: Bool) -> HPROFILE1612 pub fn cmsOpenProfileFromIOhandler2THR(ContextID: Context, io: *mut IOHANDLER, write: Bool) -> HPROFILE;
cmsCloseProfile(hProfile: HPROFILE) -> Bool1613 pub fn cmsCloseProfile(hProfile: HPROFILE) -> Bool;
cmsSaveProfileToFile(hProfile: HPROFILE, FileName: *const c_char) -> Bool1614 pub fn cmsSaveProfileToFile(hProfile: HPROFILE, FileName: *const c_char) -> Bool;
cmsSaveProfileToStream(hProfile: HPROFILE, Stream: *mut FILE) -> Bool1615 pub fn cmsSaveProfileToStream(hProfile: HPROFILE, Stream: *mut FILE) -> Bool;
cmsSaveProfileToMem(hProfile: HPROFILE, MemPtr: *mut c_void, BytesNeeded: *mut u32) -> Bool1616 pub fn cmsSaveProfileToMem(hProfile: HPROFILE, MemPtr: *mut c_void, BytesNeeded: *mut u32) -> Bool;
cmsSaveProfileToIOhandler(hProfile: HPROFILE, io: *mut IOHANDLER) -> u321617 pub fn cmsSaveProfileToIOhandler(hProfile: HPROFILE, io: *mut IOHANDLER) -> u32;
cmsCreateRGBProfileTHR(ContextID: Context, WhitePoint: *const CIExyY, Primaries: *const CIExyYTRIPLE, TransferFunction: *const *const ToneCurve) -> HPROFILE1618 pub fn cmsCreateRGBProfileTHR(ContextID: Context, WhitePoint: *const CIExyY, Primaries: *const CIExyYTRIPLE, TransferFunction: *const *const ToneCurve) -> HPROFILE;
cmsCreateRGBProfile(WhitePoint: *const CIExyY, Primaries: *const CIExyYTRIPLE, TransferFunction: *const *const ToneCurve) -> HPROFILE1619 pub fn cmsCreateRGBProfile(WhitePoint: *const CIExyY, Primaries: *const CIExyYTRIPLE, TransferFunction: *const *const ToneCurve) -> HPROFILE;
cmsCreateGrayProfileTHR(ContextID: Context, WhitePoint: *const CIExyY, TransferFunction: *const ToneCurve) -> HPROFILE1620 pub fn cmsCreateGrayProfileTHR(ContextID: Context, WhitePoint: *const CIExyY, TransferFunction: *const ToneCurve) -> HPROFILE;
cmsCreateGrayProfile(WhitePoint: *const CIExyY, TransferFunction: *const ToneCurve) -> HPROFILE1621 pub fn cmsCreateGrayProfile(WhitePoint: *const CIExyY, TransferFunction: *const ToneCurve) -> HPROFILE;
cmsCreateLinearizationDeviceLinkTHR(ContextID: Context, ColorSpace: ColorSpaceSignature, TransferFunctions: *const *const ToneCurve) -> HPROFILE1622 pub fn cmsCreateLinearizationDeviceLinkTHR(ContextID: Context, ColorSpace: ColorSpaceSignature, TransferFunctions: *const *const ToneCurve) -> HPROFILE;
cmsCreateLinearizationDeviceLink(ColorSpace: ColorSpaceSignature, TransferFunctions: *const *const ToneCurve) -> HPROFILE1623 pub fn cmsCreateLinearizationDeviceLink(ColorSpace: ColorSpaceSignature, TransferFunctions: *const *const ToneCurve) -> HPROFILE;
cmsCreateInkLimitingDeviceLinkTHR(ContextID: Context, ColorSpace: ColorSpaceSignature, Limit: f64) -> HPROFILE1624 pub fn cmsCreateInkLimitingDeviceLinkTHR(ContextID: Context, ColorSpace: ColorSpaceSignature, Limit: f64) -> HPROFILE;
cmsCreateInkLimitingDeviceLink(ColorSpace: ColorSpaceSignature, Limit: f64) -> HPROFILE1625 pub fn cmsCreateInkLimitingDeviceLink(ColorSpace: ColorSpaceSignature, Limit: f64) -> HPROFILE;
cmsCreateLab2ProfileTHR(ContextID: Context, WhitePoint: *const CIExyY) -> HPROFILE1626 pub fn cmsCreateLab2ProfileTHR(ContextID: Context, WhitePoint: *const CIExyY) -> HPROFILE;
cmsCreateLab2Profile(WhitePoint: *const CIExyY) -> HPROFILE1627 pub fn cmsCreateLab2Profile(WhitePoint: *const CIExyY) -> HPROFILE;
cmsCreateLab4ProfileTHR(ContextID: Context, WhitePoint: *const CIExyY) -> HPROFILE1628 pub fn cmsCreateLab4ProfileTHR(ContextID: Context, WhitePoint: *const CIExyY) -> HPROFILE;
cmsCreateLab4Profile(WhitePoint: *const CIExyY) -> HPROFILE1629 pub fn cmsCreateLab4Profile(WhitePoint: *const CIExyY) -> HPROFILE;
cmsCreateXYZProfileTHR(ContextID: Context) -> HPROFILE1630 pub fn cmsCreateXYZProfileTHR(ContextID: Context) -> HPROFILE;
cmsCreateXYZProfile() -> HPROFILE1631 pub fn cmsCreateXYZProfile() -> HPROFILE;
cmsCreate_sRGBProfileTHR(ContextID: Context) -> HPROFILE1632 pub fn cmsCreate_sRGBProfileTHR(ContextID: Context) -> HPROFILE;
cmsCreate_sRGBProfile() -> HPROFILE1633 pub fn cmsCreate_sRGBProfile() -> HPROFILE;
cmsCreateBCHSWabstractProfileTHR(ContextID: Context, nLUTPoints: u32, Bright: f64, Contrast: f64, Hue: f64, Saturation: f64, TempSrc: u32, TempDest: u32) -> HPROFILE1634 pub fn cmsCreateBCHSWabstractProfileTHR(ContextID: Context, nLUTPoints: u32, Bright: f64, Contrast: f64, Hue: f64, Saturation: f64, TempSrc: u32, TempDest: u32) -> HPROFILE;
cmsCreateBCHSWabstractProfile(nLUTPoints: u32, Bright: f64, Contrast: f64, Hue: f64, Saturation: f64, TempSrc: u32, TempDest: u32) -> HPROFILE1635 pub fn cmsCreateBCHSWabstractProfile(nLUTPoints: u32, Bright: f64, Contrast: f64, Hue: f64, Saturation: f64, TempSrc: u32, TempDest: u32) -> HPROFILE;
cmsCreateNULLProfileTHR(ContextID: Context) -> HPROFILE1636 pub fn cmsCreateNULLProfileTHR(ContextID: Context) -> HPROFILE;
cmsCreateNULLProfile() -> HPROFILE1637 pub fn cmsCreateNULLProfile() -> HPROFILE;
cmsTransform2DeviceLink(hTransform: HTRANSFORM, Version: f64, dwFlags: u32) -> HPROFILE1638 pub fn cmsTransform2DeviceLink(hTransform: HTRANSFORM, Version: f64, dwFlags: u32) -> HPROFILE;
cmsGetSupportedIntents(nMax: u32, Codes: *mut u32, Descriptions: *mut *mut c_char) -> u321639 pub fn cmsGetSupportedIntents(nMax: u32, Codes: *mut u32, Descriptions: *mut *mut c_char) -> u32;
cmsGetSupportedIntentsTHR(ContextID: Context, nMax: u32, Codes: *mut u32, Descriptions: *mut *mut c_char) -> u321640 pub fn cmsGetSupportedIntentsTHR(ContextID: Context, nMax: u32, Codes: *mut u32, Descriptions: *mut *mut c_char) -> u32;
cmsCreateTransformTHR(ContextID: Context, Input: HPROFILE, InputFormat: PixelFormat, Output: HPROFILE, OutputFormat: PixelFormat, Intent: Intent, dwFlags: u32) -> HTRANSFORM1641 pub fn cmsCreateTransformTHR(ContextID: Context, Input: HPROFILE, InputFormat: PixelFormat, Output: HPROFILE, OutputFormat: PixelFormat, Intent: Intent, dwFlags: u32) -> HTRANSFORM;
cmsCreateTransform(Input: HPROFILE, InputFormat: PixelFormat, Output: HPROFILE, OutputFormat: PixelFormat, Intent: Intent, dwFlags: u32) -> HTRANSFORM1642 pub fn cmsCreateTransform(Input: HPROFILE, InputFormat: PixelFormat, Output: HPROFILE, OutputFormat: PixelFormat, Intent: Intent, dwFlags: u32) -> HTRANSFORM;
cmsCreateProofingTransformTHR(ContextID: Context, Input: HPROFILE, InputFormat: PixelFormat, Output: HPROFILE, OutputFormat: PixelFormat, Proofing: HPROFILE, Intent: Intent, ProofingIntent: Intent, dwFlags: u32) -> HTRANSFORM1643 pub fn cmsCreateProofingTransformTHR(ContextID: Context,
1644 Input: HPROFILE,
1645 InputFormat: PixelFormat,
1646 Output: HPROFILE,
1647 OutputFormat: PixelFormat,
1648 Proofing: HPROFILE,
1649 Intent: Intent,
1650 ProofingIntent: Intent,
1651 dwFlags: u32)
1652 -> HTRANSFORM;
cmsCreateProofingTransform(Input: HPROFILE, InputFormat: PixelFormat, Output: HPROFILE, OutputFormat: PixelFormat, Proofing: HPROFILE, Intent: Intent, ProofingIntent: Intent, dwFlags: u32) -> HTRANSFORM1653 pub fn cmsCreateProofingTransform(Input: HPROFILE,
1654 InputFormat: PixelFormat,
1655 Output: HPROFILE,
1656 OutputFormat: PixelFormat,
1657 Proofing: HPROFILE,
1658 Intent: Intent,
1659 ProofingIntent: Intent,
1660 dwFlags: u32)
1661 -> HTRANSFORM;
cmsCreateMultiprofileTransformTHR(ContextID: Context, hProfiles: *mut HPROFILE, nProfiles: u32, InputFormat: PixelFormat, OutputFormat: PixelFormat, Intent: Intent, dwFlags: u32) -> HTRANSFORM1662 pub fn cmsCreateMultiprofileTransformTHR(ContextID: Context,
1663 hProfiles: *mut HPROFILE,
1664 nProfiles: u32,
1665 InputFormat: PixelFormat,
1666 OutputFormat: PixelFormat,
1667 Intent: Intent,
1668 dwFlags: u32)
1669 -> HTRANSFORM;
cmsCreateMultiprofileTransform(hProfiles: *mut HPROFILE, nProfiles: u32, InputFormat: PixelFormat, OutputFormat: PixelFormat, Intent: Intent, dwFlags: u32) -> HTRANSFORM1670 pub fn cmsCreateMultiprofileTransform(hProfiles: *mut HPROFILE, nProfiles: u32, InputFormat: PixelFormat, OutputFormat: PixelFormat, Intent: Intent, dwFlags: u32) -> HTRANSFORM;
cmsCreateExtendedTransform(ContextID: Context, nProfiles: u32, hProfiles: *mut HPROFILE, BPC: *mut Bool, Intents: *mut u32, AdaptationStates: *mut f64, hGamutProfile: HPROFILE, nGamutPCSposition: u32, InputFormat: PixelFormat, OutputFormat: PixelFormat, dwFlags: u32) -> HTRANSFORM1671 pub fn cmsCreateExtendedTransform(ContextID: Context,
1672 nProfiles: u32,
1673 hProfiles: *mut HPROFILE,
1674 BPC: *mut Bool,
1675 Intents: *mut u32,
1676 AdaptationStates: *mut f64,
1677 hGamutProfile: HPROFILE,
1678 nGamutPCSposition: u32,
1679 InputFormat: PixelFormat,
1680 OutputFormat: PixelFormat,
1681 dwFlags: u32)
1682 -> HTRANSFORM;
cmsDeleteTransform(hTransform: HTRANSFORM)1683 pub fn cmsDeleteTransform(hTransform: HTRANSFORM);
cmsDoTransform(Transform: HTRANSFORM, InputBuffer: *const c_void, OutputBuffer: *mut c_void, Size: u32)1684 pub fn cmsDoTransform(Transform: HTRANSFORM, InputBuffer: *const c_void, OutputBuffer: *mut c_void, Size: u32);
1685 /// Deprecated
cmsDoTransformStride(Transform: HTRANSFORM, InputBuffer: *const c_void, OutputBuffer: *mut c_void, Size: u32, Stride: u32)1686 pub fn cmsDoTransformStride(Transform: HTRANSFORM, InputBuffer: *const c_void, OutputBuffer: *mut c_void, Size: u32, Stride: u32);
cmsDoTransformLineStride(Transform: HTRANSFORM, InputBuffer: *const c_void, OutputBuffer: *mut c_void, PixelsPerLine: u32, LineCount: u32, BytesPerLineIn: u32, BytesPerLineOut: u32, BytesPerPlaneIn: u32, BytesPerPlaneOut: u32)1687 pub fn cmsDoTransformLineStride(Transform: HTRANSFORM,
1688 InputBuffer: *const c_void,
1689 OutputBuffer: *mut c_void,
1690 PixelsPerLine: u32,
1691 LineCount: u32,
1692 BytesPerLineIn: u32,
1693 BytesPerLineOut: u32,
1694 BytesPerPlaneIn: u32,
1695 BytesPerPlaneOut: u32);
cmsSetAlarmCodes(NewAlarm: *const u16)1696 pub fn cmsSetAlarmCodes(NewAlarm: *const u16);
cmsGetAlarmCodes(NewAlarm: *mut u16)1697 pub fn cmsGetAlarmCodes(NewAlarm: *mut u16);
cmsSetAlarmCodesTHR(ContextID: Context, AlarmCodes: *const u16)1698 pub fn cmsSetAlarmCodesTHR(ContextID: Context, AlarmCodes: *const u16);
cmsGetAlarmCodesTHR(ContextID: Context, AlarmCodes: *mut u16)1699 pub fn cmsGetAlarmCodesTHR(ContextID: Context, AlarmCodes: *mut u16);
cmsSetAdaptationState(d: f64) -> f641700 pub fn cmsSetAdaptationState(d: f64) -> f64;
cmsSetAdaptationStateTHR(ContextID: Context, d: f64) -> f641701 pub fn cmsSetAdaptationStateTHR(ContextID: Context, d: f64) -> f64;
cmsGetTransformContextID(hTransform: HTRANSFORM) -> Context1702 pub fn cmsGetTransformContextID(hTransform: HTRANSFORM) -> Context;
cmsGetTransformInputFormat(hTransform: HTRANSFORM) -> PixelFormat1703 pub fn cmsGetTransformInputFormat(hTransform: HTRANSFORM) -> PixelFormat;
cmsGetTransformOutputFormat(hTransform: HTRANSFORM) -> PixelFormat1704 pub fn cmsGetTransformOutputFormat(hTransform: HTRANSFORM) -> PixelFormat;
cmsChangeBuffersFormat(hTransform: HTRANSFORM, InputFormat: PixelFormat, OutputFormat: PixelFormat) -> Bool1705 pub fn cmsChangeBuffersFormat(hTransform: HTRANSFORM, InputFormat: PixelFormat, OutputFormat: PixelFormat) -> Bool;
cmsGetPostScriptColorResource(ContextID: Context, Type: PSResourceType, hProfile: HPROFILE, Intent: Intent, dwFlags: u32, io: *mut IOHANDLER) -> u321706 pub fn cmsGetPostScriptColorResource(ContextID: Context, Type: PSResourceType, hProfile: HPROFILE, Intent: Intent, dwFlags: u32, io: *mut IOHANDLER) -> u32;
cmsGetPostScriptCSA(ContextID: Context, hProfile: HPROFILE, Intent: Intent, dwFlags: u32, Buffer: *mut c_void, dwBufferLen: u32) -> u321707 pub fn cmsGetPostScriptCSA(ContextID: Context, hProfile: HPROFILE, Intent: Intent, dwFlags: u32, Buffer: *mut c_void, dwBufferLen: u32) -> u32;
cmsGetPostScriptCRD(ContextID: Context, hProfile: HPROFILE, Intent: Intent, dwFlags: u32, Buffer: *mut c_void, dwBufferLen: u32) -> u321708 pub fn cmsGetPostScriptCRD(ContextID: Context, hProfile: HPROFILE, Intent: Intent, dwFlags: u32, Buffer: *mut c_void, dwBufferLen: u32) -> u32;
cmsIT8Alloc(ContextID: Context) -> HANDLE1709 pub fn cmsIT8Alloc(ContextID: Context) -> HANDLE;
cmsIT8Free(hIT8: HANDLE)1710 pub fn cmsIT8Free(hIT8: HANDLE);
cmsIT8TableCount(hIT8: HANDLE) -> u321711 pub fn cmsIT8TableCount(hIT8: HANDLE) -> u32;
cmsIT8SetTable(hIT8: HANDLE, nTable: u32) -> i321712 pub fn cmsIT8SetTable(hIT8: HANDLE, nTable: u32) -> i32;
cmsIT8LoadFromFile(ContextID: Context, cFileName: *const c_char) -> HANDLE1713 pub fn cmsIT8LoadFromFile(ContextID: Context, cFileName: *const c_char) -> HANDLE;
cmsIT8LoadFromMem(ContextID: Context, Ptr: *const c_void, len: u32) -> HANDLE1714 pub fn cmsIT8LoadFromMem(ContextID: Context, Ptr: *const c_void, len: u32) -> HANDLE;
cmsIT8SaveToFile(hIT8: HANDLE, cFileName: *const c_char) -> Bool1715 pub fn cmsIT8SaveToFile(hIT8: HANDLE, cFileName: *const c_char) -> Bool;
cmsIT8SaveToMem(hIT8: HANDLE, MemPtr: *mut c_void, BytesNeeded: *mut u32) -> Bool1716 pub fn cmsIT8SaveToMem(hIT8: HANDLE, MemPtr: *mut c_void, BytesNeeded: *mut u32) -> Bool;
cmsIT8GetSheetType(hIT8: HANDLE) -> *const c_char1717 pub fn cmsIT8GetSheetType(hIT8: HANDLE) -> *const c_char;
cmsIT8SetSheetType(hIT8: HANDLE, Type: *const c_char) -> Bool1718 pub fn cmsIT8SetSheetType(hIT8: HANDLE, Type: *const c_char) -> Bool;
cmsIT8SetComment(hIT8: HANDLE, cComment: *const c_char) -> Bool1719 pub fn cmsIT8SetComment(hIT8: HANDLE, cComment: *const c_char) -> Bool;
cmsIT8SetPropertyStr(hIT8: HANDLE, cProp: *const c_char, Str: *const c_char) -> Bool1720 pub fn cmsIT8SetPropertyStr(hIT8: HANDLE, cProp: *const c_char, Str: *const c_char) -> Bool;
cmsIT8SetPropertyDbl(hIT8: HANDLE, cProp: *const c_char, Val: f64) -> Bool1721 pub fn cmsIT8SetPropertyDbl(hIT8: HANDLE, cProp: *const c_char, Val: f64) -> Bool;
cmsIT8SetPropertyHex(hIT8: HANDLE, cProp: *const c_char, Val: u32) -> Bool1722 pub fn cmsIT8SetPropertyHex(hIT8: HANDLE, cProp: *const c_char, Val: u32) -> Bool;
cmsIT8SetPropertyMulti(hIT8: HANDLE, Key: *const c_char, SubKey: *const c_char, Buffer: *const c_char) -> Bool1723 pub fn cmsIT8SetPropertyMulti(hIT8: HANDLE, Key: *const c_char, SubKey: *const c_char, Buffer: *const c_char) -> Bool;
cmsIT8SetPropertyUncooked(hIT8: HANDLE, Key: *const c_char, Buffer: *const c_char) -> Bool1724 pub fn cmsIT8SetPropertyUncooked(hIT8: HANDLE, Key: *const c_char, Buffer: *const c_char) -> Bool;
cmsIT8GetProperty(hIT8: HANDLE, cProp: *const c_char) -> *const c_char1725