Proper check for rawzor libraries.
[rawtherapee-fixes.git] / winclude / icc34.h
blobdeca76d021d5b4b0143a2d84985391aceb7a00cc
1 /* Header file guard bands */
2 #ifndef ICC_H
3 #define ICC_H
5 #define PACKAGE_NAME 1
8 /*****************************************************************
9 Copyright (c) 1994-1996 SunSoft, Inc.
11 Rights Reserved
13 Permission is hereby granted, free of charge, to any person
14 obtaining a copy of this software and associated documentation
15 files (the "Software"), to deal in the Software without restrict-
16 ion, including without limitation the rights to use, copy, modify,
17 merge, publish distribute, sublicense, and/or sell copies of the
18 Software, and to permit persons to whom the Software is furnished
19 to do so, subject to the following conditions:
21 The above copyright notice and this permission notice shall be
22 included in all copies or substantial portions of the Software.
24 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
26 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-
27 INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT
28 COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
29 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
31 OTHER DEALINGS IN THE SOFTWARE.
33 Except as contained in this notice, the name of SunSoft, Inc.
34 shall not be used in advertising or otherwise to promote the
35 sale, use or other dealings in this Software without written
36 authorization from SunSoft Inc.
37 ******************************************************************/
40 * This version of the header file corresponds to the profile
41 * specification version 3.4.
43 * All header file entries are pre-fixed with "ic" to help
44 * avoid name space collisions. Signatures are pre-fixed with
45 * icSig.
47 * The structures defined in this header file were created to
48 * represent a description of an ICC profile on disk. Rather
49 * than use pointers a technique is used where a single byte array
50 * was placed at the end of each structure. This allows us in "C"
51 * to extend the structure by allocating more data than is needed
52 * to account for variable length structures.
54 * This also ensures that data following is allocated
55 * contiguously and makes it easier to write and read data from
56 * the file.
58 * For example to allocate space for a 256 count length UCR
59 * and BG array, and fill the allocated data. Note strlen + 1
60 * to remember NULL terminator.
62 icUcrBgCurve *ucrCurve, *bgCurve;
63 int ucr_nbytes, bg_nbytes, string_bytes;
64 icUcrBg *ucrBgWrite;
65 char ucr_string[100], *ucr_char;
67 strcpy(ucr_string, "Example ucrBG curves");
68 ucr_nbytes = sizeof(icUInt32Number) +
69 (UCR_CURVE_SIZE * sizeof(icUInt16Number));
70 bg_nbytes = sizeof(icUInt32Number) +
71 (BG_CURVE_SIZE * sizeof(icUInt16Number));
72 string_bytes = strlen(ucr_string) + 1;
74 ucrBgWrite = (icUcrBg *)malloc(
75 (ucr_nbytes + bg_nbytes + string_bytes));
77 ucrCurve = (icUcrBgCurve *)ucrBgWrite->data;
78 ucrCurve->count = UCR_CURVE_SIZE;
79 for (i=0; i<ucrCurve->count; i++)
80 ucrCurve->curve[i] = (icUInt16Number)i;
82 bgCurve = (icUcrBgCurve *)((char *)ucrCurve + ucr_nbytes);
83 bgCurve->count = BG_CURVE_SIZE;
84 for (i=0; i<bgCurve->count; i++)
85 bgCurve->curve[i] = 255 - (icUInt16Number)i;
87 ucr_char = (char *)((char *)bgCurve + bg_nbytes);
88 memcpy(ucr_char, ucr_string, string_bytes);
93 * Many of the structures contain variable length arrays. This
94 * is represented by the use of the convention.
96 * type data[icAny];
99 /*------------------------------------------------------------------------*/
101 * Defines used in the specification
103 #define icMagicNumber 0x61637370L /* 'acsp' */
104 #define icVersionNumber 0x02100000L /* 2.1.0, BCD */
106 /* Screening Encodings */
107 #define icPrtrDefaultScreensFalse 0x00000000L /* Bit pos 0 */
108 #define icPrtrDefaultScreensTrue 0x00000001L /* Bit pos 0 */
109 #define icLinesPerInch 0x00000002L /* Bit pos 1 */
110 #define icLinesPerCm 0x00000000L /* Bit pos 1 */
113 * Device attributes, currently defined values correspond
114 * to the low 4 bytes of the 8 byte attribute quantity, see
115 * the header for their location.
117 #define icReflective 0x00000000L /* Bit pos 0 */
118 #define icTransparency 0x00000001L /* Bit pos 0 */
119 #define icGlossy 0x00000000L /* Bit pos 1 */
120 #define icMatte 0x00000002L /* Bit pos 1 */
123 * Profile header flags, the low 16 bits are reserved for consortium
124 * use.
126 #define icEmbeddedProfileFalse 0x00000000L /* Bit pos 0 */
127 #define icEmbeddedProfileTrue 0x00000001L /* Bit pos 0 */
128 #define icUseAnywhere 0x00000000L /* Bit pos 1 */
129 #define icUseWithEmbeddedDataOnly 0x00000002L /* Bit pos 1 */
131 /* Ascii or Binary data */
132 #define icAsciiData 0x00000000L
133 #define icBinaryData 0x00000001L
136 * Define used to indicate that this is a variable length array
138 #define icAny 1
141 /*------------------------------------------------------------------------*/
143 * Use this area to translate platform definitions of long
144 * etc into icXXX form. The rest of the header uses the icXXX
145 * typedefs. Signatures are 4 byte quantities.
150 #ifdef PACKAGE_NAME
152 June 9, 2003, Adapted for use with configure by Bob Friesenhahn
153 Added the stupid check for autoconf by Marti Maria.
154 PACKAGE_NAME is defined if autoconf is being used
157 typedef unsigned char icUInt8Number;
158 typedef unsigned short icUInt16Number;
159 typedef unsigned int icUInt32Number;
160 typedef unsigned int icUInt64Number[2];
162 typedef char icInt8Number;
163 typedef short icInt16Number;
164 typedef int icInt32Number;
165 typedef int icInt64Number[2];
167 #else
170 *Apr-17-2002: Modified by Marti Maria in order to provide wider portability.
173 #if defined (__digital__) && defined (__unix__)
175 /* Tru64 */
177 #include <inttypes.h>
179 typedef uint8_t icUInt8Number;
180 typedef uint16_t icUInt16Number;
181 typedef uint32_t icUInt32Number;
182 typedef uint32_t icUInt64Number[2];
184 typedef int8_t icInt8Number;
185 typedef int16_t icInt16Number;
186 typedef int32_t icInt32Number;
187 typedef int32_t icInt64Number[2];
189 #else
190 #ifdef __sgi
191 #include "sgidefs.h"
195 * Number definitions
198 /* Unsigned integer numbers */
199 typedef unsigned char icUInt8Number;
200 typedef unsigned short icUInt16Number;
201 typedef __uint32_t icUInt32Number;
202 typedef __uint32_t icUInt64Number[2];
204 /* Signed numbers */
205 typedef char icInt8Number;
206 typedef short icInt16Number;
207 typedef __int32_t icInt32Number;
208 typedef __int32_t icInt64Number[2];
211 #else
212 #if defined(__GNUC__) || defined(__unix__) || defined(__unix)
214 #include <sys/types.h>
216 #if defined(__sun) || defined(__hpux) || defined (__MINGW) || defined(__MINGW32__)
218 typedef uint8_t icUInt8Number;
219 typedef uint16_t icUInt16Number;
220 typedef uint32_t icUInt32Number;
221 typedef uint32_t icUInt64Number[2];
223 #else
225 /* Unsigned integer numbers */
226 typedef u_int8_t icUInt8Number;
227 typedef u_int16_t icUInt16Number;
228 typedef u_int32_t icUInt32Number;
229 typedef u_int32_t icUInt64Number[2];
231 #endif
234 /* Signed numbers */
235 typedef int8_t icInt8Number;
236 typedef int16_t icInt16Number;
237 typedef int32_t icInt32Number;
238 typedef int32_t icInt64Number[2];
241 #else /* default definitions */
244 * Number definitions
247 /* Unsigned integer numbers */
248 typedef unsigned char icUInt8Number;
249 typedef unsigned short icUInt16Number;
250 typedef unsigned long icUInt32Number;
251 typedef unsigned long icUInt64Number[2];
253 /* Signed numbers */
254 typedef char icInt8Number;
255 typedef short icInt16Number;
256 typedef long icInt32Number;
257 typedef long icInt64Number[2];
260 #endif /* default defs */
261 #endif
262 #endif
263 #endif
265 /* Base types */
267 typedef icInt32Number icSignature;
268 typedef icInt32Number icS15Fixed16Number;
269 typedef icUInt32Number icU16Fixed16Number;
272 /*------------------------------------------------------------------------*/
273 /* public tags and sizes */
274 typedef enum {
275 icSigAToB0Tag = 0x41324230L, /* 'A2B0' */
276 icSigAToB1Tag = 0x41324231L, /* 'A2B1' */
277 icSigAToB2Tag = 0x41324232L, /* 'A2B2' */
278 icSigBlueColorantTag = 0x6258595AL, /* 'bXYZ' */
279 icSigBlueTRCTag = 0x62545243L, /* 'bTRC' */
280 icSigBToA0Tag = 0x42324130L, /* 'B2A0' */
281 icSigBToA1Tag = 0x42324131L, /* 'B2A1' */
282 icSigBToA2Tag = 0x42324132L, /* 'B2A2' */
283 icSigCalibrationDateTimeTag = 0x63616C74L, /* 'calt' */
284 icSigCharTargetTag = 0x74617267L, /* 'targ' */
285 icSigCopyrightTag = 0x63707274L, /* 'cprt' */
286 icSigCrdInfoTag = 0x63726469L, /* 'crdi' */
287 icSigDeviceMfgDescTag = 0x646D6E64L, /* 'dmnd' */
288 icSigDeviceModelDescTag = 0x646D6464L, /* 'dmdd' */
289 icSigGamutTag = 0x67616D74L, /* 'gamt ' */
290 icSigGrayTRCTag = 0x6b545243L, /* 'kTRC' */
291 icSigGreenColorantTag = 0x6758595AL, /* 'gXYZ' */
292 icSigGreenTRCTag = 0x67545243L, /* 'gTRC' */
293 icSigLuminanceTag = 0x6C756d69L, /* 'lumi' */
294 icSigMeasurementTag = 0x6D656173L, /* 'meas' */
295 icSigMediaBlackPointTag = 0x626B7074L, /* 'bkpt' */
296 icSigMediaWhitePointTag = 0x77747074L, /* 'wtpt' */
297 icSigNamedColorTag = 0x6E636f6CL, /* 'ncol'
298 * OBSOLETE, use ncl2 */
299 icSigNamedColor2Tag = 0x6E636C32L, /* 'ncl2' */
300 icSigPreview0Tag = 0x70726530L, /* 'pre0' */
301 icSigPreview1Tag = 0x70726531L, /* 'pre1' */
302 icSigPreview2Tag = 0x70726532L, /* 'pre2' */
303 icSigProfileDescriptionTag = 0x64657363L, /* 'desc' */
304 icSigProfileSequenceDescTag = 0x70736571L, /* 'pseq' */
305 icSigPs2CRD0Tag = 0x70736430L, /* 'psd0' */
306 icSigPs2CRD1Tag = 0x70736431L, /* 'psd1' */
307 icSigPs2CRD2Tag = 0x70736432L, /* 'psd2' */
308 icSigPs2CRD3Tag = 0x70736433L, /* 'psd3' */
309 icSigPs2CSATag = 0x70733273L, /* 'ps2s' */
310 icSigPs2RenderingIntentTag = 0x70733269L, /* 'ps2i' */
311 icSigRedColorantTag = 0x7258595AL, /* 'rXYZ' */
312 icSigRedTRCTag = 0x72545243L, /* 'rTRC' */
313 icSigScreeningDescTag = 0x73637264L, /* 'scrd' */
314 icSigScreeningTag = 0x7363726EL, /* 'scrn' */
315 icSigTechnologyTag = 0x74656368L, /* 'tech' */
316 icSigUcrBgTag = 0x62666420L, /* 'bfd ' */
317 icSigViewingCondDescTag = 0x76756564L, /* 'vued' */
318 icSigViewingConditionsTag = 0x76696577L, /* 'view' */
319 icMaxEnumTag = 0xFFFFFFFFL
320 } icTagSignature;
322 /* technology signature descriptions */
323 typedef enum {
324 icSigDigitalCamera = 0x6463616DL, /* 'dcam' */
325 icSigFilmScanner = 0x6673636EL, /* 'fscn' */
326 icSigReflectiveScanner = 0x7273636EL, /* 'rscn' */
327 icSigInkJetPrinter = 0x696A6574L, /* 'ijet' */
328 icSigThermalWaxPrinter = 0x74776178L, /* 'twax' */
329 icSigElectrophotographicPrinter = 0x6570686FL, /* 'epho' */
330 icSigElectrostaticPrinter = 0x65737461L, /* 'esta' */
331 icSigDyeSublimationPrinter = 0x64737562L, /* 'dsub' */
332 icSigPhotographicPaperPrinter = 0x7270686FL, /* 'rpho' */
333 icSigFilmWriter = 0x6670726EL, /* 'fprn' */
334 icSigVideoMonitor = 0x7669646DL, /* 'vidm' */
335 icSigVideoCamera = 0x76696463L, /* 'vidc' */
336 icSigProjectionTelevision = 0x706A7476L, /* 'pjtv' */
337 icSigCRTDisplay = 0x43525420L, /* 'CRT ' */
338 icSigPMDisplay = 0x504D4420L, /* 'PMD ' */
339 icSigAMDisplay = 0x414D4420L, /* 'AMD ' */
340 icSigPhotoCD = 0x4B504344L, /* 'KPCD' */
341 icSigPhotoImageSetter = 0x696D6773L, /* 'imgs' */
342 icSigGravure = 0x67726176L, /* 'grav' */
343 icSigOffsetLithography = 0x6F666673L, /* 'offs' */
344 icSigSilkscreen = 0x73696C6BL, /* 'silk' */
345 icSigFlexography = 0x666C6578L, /* 'flex' */
346 icMaxEnumTechnology = 0xFFFFFFFFL
347 } icTechnologySignature;
349 /* type signatures */
350 typedef enum {
351 icSigCurveType = 0x63757276L, /* 'curv' */
352 icSigDataType = 0x64617461L, /* 'data' */
353 icSigDateTimeType = 0x6474696DL, /* 'dtim' */
354 icSigLut16Type = 0x6d667432L, /* 'mft2' */
355 icSigLut8Type = 0x6d667431L, /* 'mft1' */
356 icSigMeasurementType = 0x6D656173L, /* 'meas' */
357 icSigNamedColorType = 0x6E636f6CL, /* 'ncol'
358 * OBSOLETE, use ncl2 */
359 icSigProfileSequenceDescType = 0x70736571L, /* 'pseq' */
360 icSigS15Fixed16ArrayType = 0x73663332L, /* 'sf32' */
361 icSigScreeningType = 0x7363726EL, /* 'scrn' */
362 icSigSignatureType = 0x73696720L, /* 'sig ' */
363 icSigTextType = 0x74657874L, /* 'text' */
364 icSigTextDescriptionType = 0x64657363L, /* 'desc' */
365 icSigU16Fixed16ArrayType = 0x75663332L, /* 'uf32' */
366 icSigUcrBgType = 0x62666420L, /* 'bfd ' */
367 icSigUInt16ArrayType = 0x75693136L, /* 'ui16' */
368 icSigUInt32ArrayType = 0x75693332L, /* 'ui32' */
369 icSigUInt64ArrayType = 0x75693634L, /* 'ui64' */
370 icSigUInt8ArrayType = 0x75693038L, /* 'ui08' */
371 icSigViewingConditionsType = 0x76696577L, /* 'view' */
372 icSigXYZType = 0x58595A20L, /* 'XYZ ' */
373 icSigXYZArrayType = 0x58595A20L, /* 'XYZ ' */
374 icSigNamedColor2Type = 0x6E636C32L, /* 'ncl2' */
375 icSigCrdInfoType = 0x63726469L, /* 'crdi' */
376 icMaxEnumType = 0xFFFFFFFFL
377 } icTagTypeSignature;
380 * Color Space Signatures
381 * Note that only icSigXYZData and icSigLabData are valid
382 * Profile Connection Spaces (PCSs)
384 typedef enum {
385 icSigXYZData = 0x58595A20L, /* 'XYZ ' */
386 icSigLabData = 0x4C616220L, /* 'Lab ' */
387 icSigLuvData = 0x4C757620L, /* 'Luv ' */
388 icSigYCbCrData = 0x59436272L, /* 'YCbr' */
389 icSigYxyData = 0x59787920L, /* 'Yxy ' */
390 icSigRgbData = 0x52474220L, /* 'RGB ' */
391 icSigGrayData = 0x47524159L, /* 'GRAY' */
392 icSigHsvData = 0x48535620L, /* 'HSV ' */
393 icSigHlsData = 0x484C5320L, /* 'HLS ' */
394 icSigCmykData = 0x434D594BL, /* 'CMYK' */
395 icSigCmyData = 0x434D5920L, /* 'CMY ' */
396 icSig2colorData = 0x32434C52L, /* '2CLR' */
397 icSig3colorData = 0x33434C52L, /* '3CLR' */
398 icSig4colorData = 0x34434C52L, /* '4CLR' */
399 icSig5colorData = 0x35434C52L, /* '5CLR' */
400 icSig6colorData = 0x36434C52L, /* '6CLR' */
401 icSig7colorData = 0x37434C52L, /* '7CLR' */
402 icSig8colorData = 0x38434C52L, /* '8CLR' */
403 icSig9colorData = 0x39434C52L, /* '9CLR' */
404 icSig10colorData = 0x41434C52L, /* 'ACLR' */
405 icSig11colorData = 0x42434C52L, /* 'BCLR' */
406 icSig12colorData = 0x43434C52L, /* 'CCLR' */
407 icSig13colorData = 0x44434C52L, /* 'DCLR' */
408 icSig14colorData = 0x45434C52L, /* 'ECLR' */
409 icSig15colorData = 0x46434C52L, /* 'FCLR' */
410 icMaxEnumData = 0xFFFFFFFFL
411 } icColorSpaceSignature;
413 /* profileClass enumerations */
414 typedef enum {
415 icSigInputClass = 0x73636E72L, /* 'scnr' */
416 icSigDisplayClass = 0x6D6E7472L, /* 'mntr' */
417 icSigOutputClass = 0x70727472L, /* 'prtr' */
418 icSigLinkClass = 0x6C696E6BL, /* 'link' */
419 icSigAbstractClass = 0x61627374L, /* 'abst' */
420 icSigColorSpaceClass = 0x73706163L, /* 'spac' */
421 icSigNamedColorClass = 0x6e6d636cL, /* 'nmcl' */
422 icMaxEnumClass = 0xFFFFFFFFL
423 } icProfileClassSignature;
425 /* Platform Signatures */
426 typedef enum {
427 icSigMacintosh = 0x4150504CL, /* 'APPL' */
428 icSigMicrosoft = 0x4D534654L, /* 'MSFT' */
429 icSigSolaris = 0x53554E57L, /* 'SUNW' */
430 icSigSGI = 0x53474920L, /* 'SGI ' */
431 icSigTaligent = 0x54474E54L, /* 'TGNT' */
432 icMaxEnumPlatform = 0xFFFFFFFFL
433 } icPlatformSignature;
435 /*------------------------------------------------------------------------*/
437 * Other enums
440 /* Measurement Flare, used in the measurmentType tag */
441 typedef enum {
442 icFlare0 = 0x00000000L, /* 0% flare */
443 icFlare100 = 0x00000001L, /* 100% flare */
444 icMaxFlare = 0xFFFFFFFFL
445 } icMeasurementFlare;
447 /* Measurement Geometry, used in the measurmentType tag */
448 typedef enum {
449 icGeometryUnknown = 0x00000000L, /* Unknown */
450 icGeometry045or450 = 0x00000001L, /* 0/45, 45/0 */
451 icGeometry0dord0 = 0x00000002L, /* 0/d or d/0 */
452 icMaxGeometry = 0xFFFFFFFFL
453 } icMeasurementGeometry;
455 /* Rendering Intents, used in the profile header */
456 typedef enum {
457 icPerceptual = 0,
458 icRelativeColorimetric = 1,
459 icSaturation = 2,
460 icAbsoluteColorimetric = 3,
461 icMaxEnumIntent = 0xFFFFFFFFL
462 } icRenderingIntent;
464 /* Different Spot Shapes currently defined, used for screeningType */
465 typedef enum {
466 icSpotShapeUnknown = 0,
467 icSpotShapePrinterDefault = 1,
468 icSpotShapeRound = 2,
469 icSpotShapeDiamond = 3,
470 icSpotShapeEllipse = 4,
471 icSpotShapeLine = 5,
472 icSpotShapeSquare = 6,
473 icSpotShapeCross = 7,
474 icMaxEnumSpot = 0xFFFFFFFFL
475 } icSpotShape;
477 /* Standard Observer, used in the measurmentType tag */
478 typedef enum {
479 icStdObsUnknown = 0x00000000L, /* Unknown */
480 icStdObs1931TwoDegrees = 0x00000001L, /* 2 deg */
481 icStdObs1964TenDegrees = 0x00000002L, /* 10 deg */
482 icMaxStdObs = 0xFFFFFFFFL
483 } icStandardObserver;
485 /* Pre-defined illuminants, used in measurement and viewing conditions type */
486 typedef enum {
487 icIlluminantUnknown = 0x00000000L,
488 icIlluminantD50 = 0x00000001L,
489 icIlluminantD65 = 0x00000002L,
490 icIlluminantD93 = 0x00000003L,
491 icIlluminantF2 = 0x00000004L,
492 icIlluminantD55 = 0x00000005L,
493 icIlluminantA = 0x00000006L,
494 icIlluminantEquiPowerE = 0x00000007L,
495 icIlluminantF8 = 0x00000008L,
496 icMaxEnumIluminant = 0xFFFFFFFFL
497 } icIlluminant;
500 /*------------------------------------------------------------------------*/
502 * Arrays of numbers
505 /* Int8 Array */
506 typedef struct {
507 icInt8Number data[icAny]; /* Variable array of values */
508 } icInt8Array;
510 /* UInt8 Array */
511 typedef struct {
512 icUInt8Number data[icAny]; /* Variable array of values */
513 } icUInt8Array;
515 /* uInt16 Array */
516 typedef struct {
517 icUInt16Number data[icAny]; /* Variable array of values */
518 } icUInt16Array;
520 /* Int16 Array */
521 typedef struct {
522 icInt16Number data[icAny]; /* Variable array of values */
523 } icInt16Array;
525 /* uInt32 Array */
526 typedef struct {
527 icUInt32Number data[icAny]; /* Variable array of values */
528 } icUInt32Array;
530 /* Int32 Array */
531 typedef struct {
532 icInt32Number data[icAny]; /* Variable array of values */
533 } icInt32Array;
535 /* UInt64 Array */
536 typedef struct {
537 icUInt64Number data[icAny]; /* Variable array of values */
538 } icUInt64Array;
540 /* Int64 Array */
541 typedef struct {
542 icInt64Number data[icAny]; /* Variable array of values */
543 } icInt64Array;
545 /* u16Fixed16 Array */
546 typedef struct {
547 icU16Fixed16Number data[icAny]; /* Variable array of values */
548 } icU16Fixed16Array;
550 /* s15Fixed16 Array */
551 typedef struct {
552 icS15Fixed16Number data[icAny]; /* Variable array of values */
553 } icS15Fixed16Array;
555 /* The base date time number */
556 typedef struct {
557 icUInt16Number year;
558 icUInt16Number month;
559 icUInt16Number day;
560 icUInt16Number hours;
561 icUInt16Number minutes;
562 icUInt16Number seconds;
563 } icDateTimeNumber;
565 /* XYZ Number */
566 typedef struct {
567 icS15Fixed16Number X;
568 icS15Fixed16Number Y;
569 icS15Fixed16Number Z;
570 } icXYZNumber;
572 /* XYZ Array */
573 typedef struct {
574 icXYZNumber data[icAny]; /* Variable array of XYZ numbers */
575 } icXYZArray;
577 /* Curve */
578 typedef struct {
579 icUInt32Number count; /* Number of entries */
580 icUInt16Number data[icAny]; /* The actual table data, real
581 * number is determined by count
582 * Interpretation depends on how
583 * data is used with a given tag
585 } icCurve;
587 /* Data */
588 typedef struct {
589 icUInt32Number dataFlag; /* 0 = ascii, 1 = binary */
590 icInt8Number data[icAny]; /* Data, size from tag */
591 } icData;
593 /* lut16 */
594 typedef struct {
595 icUInt8Number inputChan; /* Number of input channels */
596 icUInt8Number outputChan; /* Number of output channels */
597 icUInt8Number clutPoints; /* Number of grid points */
598 icInt8Number pad; /* Padding for byte alignment */
599 icS15Fixed16Number e00; /* e00 in the 3 * 3 */
600 icS15Fixed16Number e01; /* e01 in the 3 * 3 */
601 icS15Fixed16Number e02; /* e02 in the 3 * 3 */
602 icS15Fixed16Number e10; /* e10 in the 3 * 3 */
603 icS15Fixed16Number e11; /* e11 in the 3 * 3 */
604 icS15Fixed16Number e12; /* e12 in the 3 * 3 */
605 icS15Fixed16Number e20; /* e20 in the 3 * 3 */
606 icS15Fixed16Number e21; /* e21 in the 3 * 3 */
607 icS15Fixed16Number e22; /* e22 in the 3 * 3 */
608 icUInt16Number inputEnt; /* Num of in-table entries */
609 icUInt16Number outputEnt; /* Num of out-table entries */
610 icUInt16Number data[icAny]; /* Data follows see spec */
612 * Data that follows is of this form
614 * icUInt16Number inputTable[inputChan][icAny]; * The in-table
615 * icUInt16Number clutTable[icAny]; * The clut
616 * icUInt16Number outputTable[outputChan][icAny]; * The out-table
618 } icLut16;
620 /* lut8, input & output tables are always 256 bytes in length */
621 typedef struct {
622 icUInt8Number inputChan; /* Num of input channels */
623 icUInt8Number outputChan; /* Num of output channels */
624 icUInt8Number clutPoints; /* Num of grid points */
625 icInt8Number pad;
626 icS15Fixed16Number e00; /* e00 in the 3 * 3 */
627 icS15Fixed16Number e01; /* e01 in the 3 * 3 */
628 icS15Fixed16Number e02; /* e02 in the 3 * 3 */
629 icS15Fixed16Number e10; /* e10 in the 3 * 3 */
630 icS15Fixed16Number e11; /* e11 in the 3 * 3 */
631 icS15Fixed16Number e12; /* e12 in the 3 * 3 */
632 icS15Fixed16Number e20; /* e20 in the 3 * 3 */
633 icS15Fixed16Number e21; /* e21 in the 3 * 3 */
634 icS15Fixed16Number e22; /* e22 in the 3 * 3 */
635 icUInt8Number data[icAny]; /* Data follows see spec */
637 * Data that follows is of this form
639 * icUInt8Number inputTable[inputChan][256]; * The in-table
640 * icUInt8Number clutTable[icAny]; * The clut
641 * icUInt8Number outputTable[outputChan][256]; * The out-table
643 } icLut8;
645 /* Measurement Data */
646 typedef struct {
647 icStandardObserver stdObserver; /* Standard observer */
648 icXYZNumber backing; /* XYZ for backing */
649 icMeasurementGeometry geometry; /* Meas. geometry */
650 icMeasurementFlare flare; /* Measurement flare */
651 icIlluminant illuminant; /* Illuminant */
652 } icMeasurement;
654 /* Named color */
657 * icNamedColor2 takes the place of icNamedColor
659 typedef struct {
660 icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */
661 icUInt32Number count; /* Count of named colors */
662 icUInt32Number nDeviceCoords; /* Num of device coordinates */
663 icInt8Number prefix[32]; /* Prefix for each color name */
664 icInt8Number suffix[32]; /* Suffix for each color name */
665 icInt8Number data[icAny]; /* Named color data follows */
667 * Data that follows is of this form
669 * icInt8Number root1[32]; * Root name for 1st color
670 * icUInt16Number pcsCoords1[icAny]; * PCS coords of 1st color
671 * icUInt16Number deviceCoords1[icAny]; * Dev coords of 1st color
672 * icInt8Number root2[32]; * Root name for 2nd color
673 * icUInt16Number pcsCoords2[icAny]; * PCS coords of 2nd color
674 * icUInt16Number deviceCoords2[icAny]; * Dev coords of 2nd color
677 * Repeat for name and PCS and device color coordinates up to (count-1)
679 * NOTES:
680 * PCS and device space can be determined from the header.
682 * PCS coordinates are icUInt16 numbers and are described in Annex A of
683 * the ICC spec. Only 16 bit L*a*b* and XYZ are allowed. The number of
684 * coordinates is consistent with the headers PCS.
686 * Device coordinates are icUInt16 numbers where 0x0000 represents
687 * the minimum value and 0xFFFF represents the maximum value.
688 * If the nDeviceCoords value is 0 this field is not given.
690 } icNamedColor2;
692 /* Profile sequence structure */
693 typedef struct {
694 icSignature deviceMfg; /* Dev Manufacturer */
695 icSignature deviceModel; /* Dev Model */
696 icUInt64Number attributes; /* Dev attributes */
697 icTechnologySignature technology; /* Technology sig */
698 icInt8Number data[icAny]; /* Desc text follows */
700 * Data that follows is of this form, this is an icInt8Number
701 * to avoid problems with a compiler generating bad code as
702 * these arrays are variable in length.
704 * icTextDescription deviceMfgDesc; * Manufacturer text
705 * icTextDescription modelDesc; * Model text
707 } icDescStruct;
709 /* Profile sequence description */
710 typedef struct {
711 icUInt32Number count; /* Number of descriptions */
712 icUInt8Number data[icAny]; /* Array of desc structs */
713 } icProfileSequenceDesc;
715 /* textDescription */
716 typedef struct {
717 icUInt32Number count; /* Description length */
718 icInt8Number data[icAny]; /* Descriptions follow */
720 * Data that follows is of this form
722 * icInt8Number desc[count] * NULL terminated ascii string
723 * icUInt32Number ucLangCode; * UniCode language code
724 * icUInt32Number ucCount; * UniCode description length
725 * icInt16Number ucDesc[ucCount];* The UniCode description
726 * icUInt16Number scCode; * ScriptCode code
727 * icUInt8Number scCount; * ScriptCode count
728 * icInt8Number scDesc[67]; * ScriptCode Description
730 } icTextDescription;
732 /* Screening Data */
733 typedef struct {
734 icS15Fixed16Number frequency; /* Frequency */
735 icS15Fixed16Number angle; /* Screen angle */
736 icSpotShape spotShape; /* Spot Shape encodings below */
737 } icScreeningData;
739 typedef struct {
740 icUInt32Number screeningFlag; /* Screening flag */
741 icUInt32Number channels; /* Number of channels */
742 icScreeningData data[icAny]; /* Array of screening data */
743 } icScreening;
745 /* Text Data */
746 typedef struct {
747 icInt8Number data[icAny]; /* Variable array of chars */
748 } icText;
750 /* Structure describing either a UCR or BG curve */
751 typedef struct {
752 icUInt32Number count; /* Curve length */
753 icUInt16Number curve[icAny]; /* The array of curve values */
754 } icUcrBgCurve;
756 /* Under color removal, black generation */
757 typedef struct {
758 icInt8Number data[icAny]; /* The Ucr BG data */
760 * Data that follows is of this form, this is a icInt8Number
761 * to avoid problems with a compiler generating bad code as
762 * these arrays are variable in length.
764 * icUcrBgCurve ucr; * Ucr curve
765 * icUcrBgCurve bg; * Bg curve
766 * icInt8Number string; * UcrBg description
768 } icUcrBg;
770 /* viewingConditionsType */
771 typedef struct {
772 icXYZNumber illuminant; /* In candelas per sq. meter */
773 icXYZNumber surround; /* In candelas per sq. meter */
774 icIlluminant stdIluminant; /* See icIlluminant defines */
775 } icViewingCondition;
777 /* CrdInfo type */
778 typedef struct {
779 icUInt32Number count; /* Char count includes NULL */
780 icInt8Number desc[icAny]; /* Null terminated string */
781 } icCrdInfo;
783 /*------------------------------------------------------------------------*/
785 * Tag Type definitions
789 * Many of the structures contain variable length arrays. This
790 * is represented by the use of the convention.
792 * type data[icAny];
795 /* The base part of each tag */
796 typedef struct {
797 icTagTypeSignature sig; /* Signature */
798 icInt8Number reserved[4]; /* Reserved, set to 0 */
799 } icTagBase;
801 /* curveType */
802 typedef struct {
803 icTagBase base; /* Signature, "curv" */
804 icCurve curve; /* The curve data */
805 } icCurveType;
807 /* dataType */
808 typedef struct {
809 icTagBase base; /* Signature, "data" */
810 icData data; /* The data structure */
811 } icDataType;
813 /* dateTimeType */
814 typedef struct {
815 icTagBase base; /* Signature, "dtim" */
816 icDateTimeNumber date; /* The date */
817 } icDateTimeType;
819 /* lut16Type */
820 typedef struct {
821 icTagBase base; /* Signature, "mft2" */
822 icLut16 lut; /* Lut16 data */
823 } icLut16Type;
825 /* lut8Type, input & output tables are always 256 bytes in length */
826 typedef struct {
827 icTagBase base; /* Signature, "mft1" */
828 icLut8 lut; /* Lut8 data */
829 } icLut8Type;
831 /* Measurement Type */
832 typedef struct {
833 icTagBase base; /* Signature, "meas" */
834 icMeasurement measurement; /* Measurement data */
835 } icMeasurementType;
837 /* Named color type */
838 /* icNamedColor2Type, replaces icNamedColorType */
839 typedef struct {
840 icTagBase base; /* Signature, "ncl2" */
841 icNamedColor2 ncolor; /* Named color data */
842 } icNamedColor2Type;
844 /* Profile sequence description type */
845 typedef struct {
846 icTagBase base; /* Signature, "pseq" */
847 icProfileSequenceDesc desc; /* The seq description */
848 } icProfileSequenceDescType;
850 /* textDescriptionType */
851 typedef struct {
852 icTagBase base; /* Signature, "desc" */
853 icTextDescription desc; /* The description */
854 } icTextDescriptionType;
856 /* s15Fixed16Type */
857 typedef struct {
858 icTagBase base; /* Signature, "sf32" */
859 icS15Fixed16Array data; /* Array of values */
860 } icS15Fixed16ArrayType;
862 typedef struct {
863 icTagBase base; /* Signature, "scrn" */
864 icScreening screen; /* Screening structure */
865 } icScreeningType;
867 /* sigType */
868 typedef struct {
869 icTagBase base; /* Signature, "sig" */
870 icSignature signature; /* The signature data */
871 } icSignatureType;
873 /* textType */
874 typedef struct {
875 icTagBase base; /* Signature, "text" */
876 icText data; /* Variable array of chars */
877 } icTextType;
879 /* u16Fixed16Type */
880 typedef struct {
881 icTagBase base; /* Signature, "uf32" */
882 icU16Fixed16Array data; /* Variable array of values */
883 } icU16Fixed16ArrayType;
885 /* Under color removal, black generation type */
886 typedef struct {
887 icTagBase base; /* Signature, "bfd " */
888 icUcrBg data; /* ucrBg structure */
889 } icUcrBgType;
891 /* uInt16Type */
892 typedef struct {
893 icTagBase base; /* Signature, "ui16" */
894 icUInt16Array data; /* Variable array of values */
895 } icUInt16ArrayType;
897 /* uInt32Type */
898 typedef struct {
899 icTagBase base; /* Signature, "ui32" */
900 icUInt32Array data; /* Variable array of values */
901 } icUInt32ArrayType;
903 /* uInt64Type */
904 typedef struct {
905 icTagBase base; /* Signature, "ui64" */
906 icUInt64Array data; /* Variable array of values */
907 } icUInt64ArrayType;
909 /* uInt8Type */
910 typedef struct {
911 icTagBase base; /* Signature, "ui08" */
912 icUInt8Array data; /* Variable array of values */
913 } icUInt8ArrayType;
915 /* viewingConditionsType */
916 typedef struct {
917 icTagBase base; /* Signature, "view" */
918 icViewingCondition view; /* Viewing conditions */
919 } icViewingConditionType;
921 /* XYZ Type */
922 typedef struct {
923 icTagBase base; /* Signature, "XYZ" */
924 icXYZArray data; /* Variable array of XYZ nums */
925 } icXYZType;
927 /* CRDInfoType where [0] is the CRD product name count and string and
928 * [1] -[5] are the rendering intents 0-4 counts and strings
930 typedef struct {
931 icTagBase base; /* Signature, "crdi" */
932 icCrdInfo info; /* 5 sets of counts & strings */
933 }icCrdInfoType;
934 /* icCrdInfo productName; PS product count/string */
935 /* icCrdInfo CRDName0; CRD name for intent 0 */
936 /* icCrdInfo CRDName1; CRD name for intent 1 */
937 /* icCrdInfo CRDName2; CRD name for intent 2 */
938 /* icCrdInfo CRDName3; CRD name for intent 3 */
940 /*------------------------------------------------------------------------*/
943 * Lists of tags, tags, profile header and profile structure
946 /* A tag */
947 typedef struct {
948 icTagSignature sig; /* The tag signature */
949 icUInt32Number offset; /* Start of tag relative to
950 * start of header, Spec
951 * Clause 5 */
952 icUInt32Number size; /* Size in bytes */
953 } icTag;
955 /* A Structure that may be used independently for a list of tags */
956 typedef struct {
957 icUInt32Number count; /* Num tags in the profile */
958 icTag tags[icAny]; /* Variable array of tags */
959 } icTagList;
961 /* The Profile header */
962 typedef struct {
963 icUInt32Number size; /* Prof size in bytes */
964 icSignature cmmId; /* CMM for profile */
965 icUInt32Number version; /* Format version */
966 icProfileClassSignature deviceClass; /* Type of profile */
967 icColorSpaceSignature colorSpace; /* Clr space of data */
968 icColorSpaceSignature pcs; /* PCS, XYZ or Lab */
969 icDateTimeNumber date; /* Creation Date */
970 icSignature magic; /* icMagicNumber */
971 icPlatformSignature platform; /* Primary Platform */
972 icUInt32Number flags; /* Various bits */
973 icSignature manufacturer; /* Dev manufacturer */
974 icUInt32Number model; /* Dev model number */
975 icUInt64Number attributes; /* Device attributes */
976 icUInt32Number renderingIntent;/* Rendering intent */
977 icXYZNumber illuminant; /* Profile illuminant */
978 icSignature creator; /* Profile creator */
979 icInt8Number reserved[44]; /* Reserved */
980 } icHeader;
983 * A profile,
984 * we can't use icTagList here because its not at the end of the structure
986 typedef struct {
987 icHeader header; /* The header */
988 icUInt32Number count; /* Num tags in the profile */
989 icInt8Number data[icAny]; /* The tagTable and tagData */
991 * Data that follows is of the form
993 * icTag tagTable[icAny]; * The tag table
994 * icInt8Number tagData[icAny]; * The tag data
996 } icProfile;
998 /*------------------------------------------------------------------------*/
999 /* Obsolete entries */
1001 /* icNamedColor was replaced with icNamedColor2 */
1002 typedef struct {
1003 icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */
1004 icUInt32Number count; /* Count of named colors */
1005 icInt8Number data[icAny]; /* Named color data follows */
1007 * Data that follows is of this form
1009 * icInt8Number prefix[icAny]; * Prefix
1010 * icInt8Number suffix[icAny]; * Suffix
1011 * icInt8Number root1[icAny]; * Root name
1012 * icInt8Number coords1[icAny]; * Color coordinates
1013 * icInt8Number root2[icAny]; * Root name
1014 * icInt8Number coords2[icAny]; * Color coordinates
1017 * Repeat for root name and color coordinates up to (count-1)
1019 } icNamedColor;
1021 /* icNamedColorType was replaced by icNamedColor2Type */
1022 typedef struct {
1023 icTagBase base; /* Signature, "ncol" */
1024 icNamedColor ncolor; /* Named color data */
1025 } icNamedColorType;
1027 #endif /* ICC_H */