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