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