00001 /* Header file guard bands */ 00002 #ifndef ICC_H 00003 #define ICC_H 00004 00005 /***************************************************************** 00006 Copyright (c) 1994 SunSoft, Inc. 00007 00008 All Rights Reserved 00009 00010 Permission is hereby granted, free of charge, to any person 00011 obtaining a copy of this software and associated documentation 00012 files (the "Software"), to deal in the Software without restrict- 00013 ion, including without limitation the rights to use, copy, modify, 00014 merge, publish distribute, sublicense, and/or sell copies of the 00015 Software, and to permit persons to whom the Software is furnished 00016 to do so, subject to the following conditions: 00017 00018 The above copyright notice and this permission notice shall be 00019 included in all copies or substantial portions of the Software. 00020 00021 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00022 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 00023 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- 00024 INFRINGEMENT. IN NO EVENT SHALL SUNSOFT, INC. OR ITS PARENT 00025 COMPANY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 00026 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00027 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00028 OTHER DEALINGS IN THE SOFTWARE. 00029 00030 Except as contained in this notice, the name of SunSoft, Inc. 00031 shall not be used in advertising or otherwise to promote the 00032 sale, use or other dealings in this Software without written 00033 authorization from SunSoft Inc. 00034 ******************************************************************/ 00035 00036 /* 00037 * This version of the header file corresponds to the profile 00038 * specification version 3.0. 00039 * 00040 * All header file entries are pre-fixed with "ic" to help 00041 * avoid name space collisions. Signatures are pre-fixed with 00042 * icSig. 00043 * 00044 * The structures defined in this header file were created to 00045 * represent a description of an ICC profile on disk. Rather 00046 * than use pointers a technique is used where a single byte array 00047 * was placed at the end of each structure. This allows us in "C" 00048 * to extend the structure by allocating more data than is needed 00049 * to account for variable length structures. 00050 * 00051 * This also ensures that data following is allocated 00052 * contiguously and makes it easier to write and read data from 00053 * the file. 00054 * 00055 * For example to allocate space for a 256 count length UCR 00056 * and BG array, and fill the allocated data. 00057 * 00058 icUcrBgCurve *ucrCurve, *bgCurve; 00059 int ucr_nbytes, bg_nbytes; 00060 icUcrBg *ucrBgWrite; 00061 00062 ucr_nbytes = sizeof(icUInt32Number) + 00063 (UCR_CURVE_SIZE * sizeof(icUInt16Number)); 00064 bg_nbytes = sizeof(icUInt32Number) + 00065 (BG_CURVE_SIZE * sizeof(icUInt16Number)); 00066 00067 ucrBgWrite = (icUcrBg *)malloc((ucr_nbytes + bg_nbytes)); 00068 00069 ucrCurve = (icUcrBgCurve *)ucrBgWrite->data; 00070 ucrCurve->count = UCR_CURVE_SIZE; 00071 for (i=0; i<ucrCurve->count; i++) 00072 ucrCurve->curve[i] = (icUInt16Number)i; 00073 00074 bgCurve = (icUcrBgCurve *)((char *)ucrCurve + ucr_nbytes); 00075 bgCurve->count = BG_CURVE_SIZE; 00076 for (i=0; i<bgCurve->count; i++) 00077 bgCurve->curve[i] = 255 - (icUInt16Number)i; 00078 * 00079 */ 00080 00081 /* 00082 * Many of the structures contain variable length arrays. This 00083 * is represented by the use of the convention. 00084 * 00085 * type data[icAny]; 00086 */ 00087 00088 /*------------------------------------------------------------------------*/ 00089 /* 00090 * Defines used in the specification 00091 */ 00092 #define icMagicNumber 0x61637370 /* 'acsp' */ 00093 #define icVersionNumber 0x02000000 /* 2.0, BCD */ 00094 00095 /* Screening Encodings */ 00096 #define icPrtrDefaultScreensFalse 0x00000000 /* Bit position 0 */ 00097 #define icPrtrDefaultScreensTrue 0x00000001 /* Bit position 0 */ 00098 #define icLinesPerInch 0x00000002 /* Bit position 1 */ 00099 #define icLinesPerCm 0x00000000 /* Bit position 1 */ 00100 00101 /* 00102 * Device attributes, currently defined values correspond 00103 * to the low 4 bytes of the 8 byte attribute quantity, see 00104 * the header for their location. 00105 */ 00106 #define icReflective 0x00000000 /* Bit position 0 */ 00107 #define icTransparency 0x00000001 /* Bit position 0 */ 00108 #define icGlossy 0x00000000 /* Bit position 1 */ 00109 #define icMatte 0x00000002 /* Bit position 1 */ 00110 00111 /* 00112 * Profile header flags, the low 16 bits are reserved for consortium 00113 * use. 00114 */ 00115 #define icEmbeddedProfileFalse 0x00000000 /* Bit position 0 */ 00116 #define icEmbeddedProfileTrue 0x00000001 /* Bit position 0 */ 00117 #define icUseAnywhere 0x00000000 /* Bit position 1 */ 00118 #define icUseWithEmdeddedDataOnly 0x00000002 /* Bit position 1 */ 00119 00120 /* Ascii or Binary data */ 00121 #define icAsciiData 0x00000000 /* Used in dataType */ 00122 #define icBinaryData 0x00000001 00123 00124 /* 00125 * Define used to indicate that this is a variable length array 00126 */ 00127 #define icAny 1 00128 00129 /*------------------------------------------------------------------------*/ 00130 /* 00131 * Signatures, these are basically 4 byte identifiers 00132 * used to differentiate between tags and other items 00133 * in the profile format. 00134 */ 00135 typedef unsigned char icSignature[4]; 00136 00137 typedef unsigned char icTagSignature[4]; 00138 /* public tags and sizes */ 00139 #define icSigAToB0Tag 0x41324230 /* 'A2B0' */ 00140 #define icSigAToB1Tag 0x41324231 /* 'A2B1' */ 00141 #define icSigAToB2Tag 0x41324232 /* 'A2B2' */ 00142 #define icSigAToB3Tag 0x41324233 /* 'A2B2' */ 00143 #define icSigBlueColorantTag 0x6258595A /* 'bXYZ' */ 00144 #define icSigBlueTRCTag 0x62545243 /* 'bTRC' */ 00145 #define icSigBToA0Tag 0x42324130 /* 'B2A0' */ 00146 #define icSigBToA1Tag 0x42324131 /* 'B2A1' */ 00147 #define icSigBToA2Tag 0x42324132 /* 'B2A2' */ 00148 #define icSigBToA3Tag 0x42324133 /* 'B2A3' */ 00149 #define icSigCalibrationDateTimeTag 0x63616C74 /* 'calt' */ 00150 #define icSigCharTargetTag 0x74617267 /* 'targ' */ 00151 #define icSigCopyrightTag 0x63707274 /* 'cprt' */ 00152 #define icSigDeviceMfgDescTag 0x646D6E64 /* 'dmnd' */ 00153 #define icSigDeviceModelDescTag 0x646D6464 /* 'dmdd' */ 00154 #define icSigGamutTag 0x676d7420 /* 'gmt ' */ 00155 #define icSigGrayTRCTag 0x6b545243 /* 'kTRC' */ 00156 #define icSigGreenColorantTag 0x6758595A /* 'gXYZ' */ 00157 #define icSigGreenTRCTag 0x67545243 /* 'gTRC' */ 00158 #define icSigLuminanceTag 0x6C756d69 /* 'lumi' */ 00159 #define icSigMeasurementTag 0x6D656173 /* 'meas' */ 00160 #define icSigMediaBlackPointTag 0x626B7074 /* 'bkpt' */ 00161 #define icSigMediaWhitePointTag 0x77747074 /* 'wtpt' */ 00162 #define icSigNamedColorTag 0x6E636f6C /* 'ncol' */ 00163 #define icSigPreview0Tag 0x70726530 /* 'pre0' */ 00164 #define icSigPreview1Tag 0x70726531 /* 'pre1' */ 00165 #define icSigPreview2Tag 0x70726532 /* 'pre2' */ 00166 #define icSigProfileDescriptionTag 0x64657363 /* 'desc' */ 00167 #define icSigProfileSequenceDescTag 0x70736571 /* 'pseq' */ 00168 #define icSigPs2CRD0Tag 0x70736430 /* 'psd0' */ 00169 #define icSigPs2CRD1Tag 0x70736431 /* 'psd1' */ 00170 #define icSigPs2CRD2Tag 0x70736432 /* 'psd2' */ 00171 #define icSigPs2CRD3Tag 0x70736433 /* 'psd3' */ 00172 #define icSigPs2CSATag 0x70733273 /* 'ps2s' */ 00173 #define icSigPs2Intent0Tag 0x70736930 /* 'psi0' */ 00174 #define icSigPs2Intent1Tag 0x70736931 /* 'psi1' */ 00175 #define icSigPs2Intent2Tag 0x70736932 /* 'psi2' */ 00176 #define icSigPs2Intent3Tag 0x70736933 /* 'psi3' */ 00177 #define icSigRedColorantTag 0x7258595A /* 'rXYZ' */ 00178 #define icSigRedTRCTag 0x72545243 /* 'rTRC' */ 00179 #define icSigScreeningDescTag 0x73637264 /* 'scrd' */ 00180 #define icSigScreeningTag 0x7363726E /* 'scrn' */ 00181 #define icSigTechnologyTag 0x74656368 /* 'tech' */ 00182 #define icSigUcrBgTag 0x62666420 /* 'bfd ' */ 00183 #define icSigViewingCondDescTag 0x76756564 /* 'vued' */ 00184 #define icSigViewingConditionsTag 0x76696577 /* 'view' */ 00185 #define icMaxEnumTag 0xFFFFFFFF /* enum = 4 00186 bytes max */ 00187 00188 typedef unsigned char icTechnologySignature[4]; 00189 /* technology signature descriptions */ 00190 #define icSigFilmScanner 0x6673636E /* 'fscn' */ 00191 #define icSigReflectiveScanner 0x7273636E /* 'rscn' */ 00192 #define icSigInkJetPrinter 0x696A6574 /* 'ijet' */ 00193 #define icSigThermalWaxPrinter 0x74776178 /* 'twax' */ 00194 #define icSigElectrophotographicPrinter 0x6570686F /* 'epho' */ 00195 #define icSigElectrostaticPrinter 0x65737461 /* 'esta' */ 00196 #define icSigDyeSublimationPrinter 0x64737562 /* 'dsub' */ 00197 #define icSigPhotographicPaperPrinter 0x7270686F /* 'rpho' */ 00198 #define icSigFilmWriter 0x6670726E /* 'fprn' */ 00199 #define icSigVideoMonitor 0x7669646D /* 'vidm' */ 00200 #define icSigVideoCamera 0x76696463 /* 'vidc' */ 00201 #define icSigProjectionTelevision 0x706A7476 /* 'pjtv' */ 00202 #define icSigCRTDisplay 0x43525420 /* 'CRT ' */ 00203 #define icSigPMDisplay 0x504D4420 /* 'PMD ' */ 00204 #define icSigAMDisplay 0x414D4420 /* 'AMD ' */ 00205 #define icSigPhotoCD 0x4B504344 /* 'KPCD' */ 00206 #define icSigPhotoImageSetter 0x696D6773 /* 'imgs' */ 00207 #define icSigGravure 0x67726176 /* 'grav' */ 00208 #define icSigOffsetLithography 0x6F666673 /* 'offs' */ 00209 #define icSigSilkscreen 0x73696C6B /* 'silk' */ 00210 #define icSigFlexography 0x666C6578 /* 'flex' */ 00211 #define icMaxEnumTechnology 0xFFFFFFFF /* enum = 4 00212 bytes max */ 00213 00214 typedef unsigned char icTagTypeSignature[4]; 00215 /* type signatures */ 00216 #define icSigCurveType 0x63757276 /* 'curv' */ 00217 #define icSigDataType 0x64617461 /* 'data' */ 00218 #define icSigDateTimeType 0x6474696D /* 'dtim' */ 00219 #define icSigLut16Type 0x6d667432 /* 'mft2' */ 00220 #define icSigLut8Type 0x6d667431 /* 'mft1' */ 00221 #define icSigMeasurementType 0x6D656173 /* 'meas' */ 00222 #define icSigNamedColorType 0x6E636f6C /* 'ncol' */ 00223 #define icSigProfileSequenceDescType 0x70736571 /* 'pseq' */ 00224 #define icSigS15Fixed16ArrayType 0x73663332 /* 'sf32' */ 00225 #define icSigScreeningType 0x7363726E /* 'scrn' */ 00226 #define icSigSignatureType 0x73696720 /* 'sig ' */ 00227 #define icSigTextType 0x74657874 /* 'text' */ 00228 #define icSigTextDescriptionType 0x64657363 /* 'desc' */ 00229 #define icSigU16Fixed16ArrayType 0x75663332 /* 'uf32' */ 00230 #define icSigUcrBgType 0x62666420 /* 'bfd ' */ 00231 #define icSigUInt16ArrayType 0x75693136 /* 'ui16' */ 00232 #define icSigUInt32ArrayType 0x75693332 /* 'ui32' */ 00233 #define icSigUInt64ArrayType 0x75693634 /* 'ui64' */ 00234 #define icSigUInt8ArrayType 0x75693038 /* 'ui08' */ 00235 #define icSigViewingConditionsType 0x76696577 /* 'view' */ 00236 #define icSigXYZType 0x58595A20 /* 'XYZ ' */ 00237 #define icMaxEnumType 0xFFFFFFFF /* enum = 4 00238 bytes max */ 00239 00240 /* 00241 * Color Space Signatures 00242 * Note that only icSigXYZData and icSigLabData are valid 00243 * Profile Connection Spaces (PCSs) 00244 */ 00245 typedef unsigned char icColorSpaceSignature[4]; 00246 #define icSigXYZData 0x58595A20 /* 'XYZ ' */ 00247 #define icSigLabData 0x4C616220 /* 'Lab ' */ 00248 #define icSigLuvData 0x4C757620 /* 'Luv ' */ 00249 #define icSigYCbCrData 0x59436272 /* 'YCbr' */ 00250 #define icSigYxyData 0x59787920 /* 'Yxy ' */ 00251 #define icSigRgbData 0x52474220 /* 'RGB ' */ 00252 #define icSigGrayData 0x47524159 /* 'GRAY' */ 00253 #define icSigHsvData 0x48535620 /* 'HSV ' */ 00254 #define icSigHlsData 0x484C5320 /* 'HLS ' */ 00255 #define icSigCmykData 0x434D594B /* 'CMYK' */ 00256 #define icSigCmyData 0x434D5920 /* 'CMY ' */ 00257 #define icSigDefData 0x44454620 /* 'DEF ' New Definition */ 00258 #define icMaxEnumData 0xFFFFFFFF /* enum = 4 00259 bytes max */ 00260 00261 /* profileClass enumerations */ 00262 typedef unsigned char icProfileClassSignature[4]; 00263 #define icSigInputClass 0x73636E72 /* 'scnr' */ 00264 #define icSigDisplayClass 0x6D6E7472 /* 'mntr' */ 00265 #define icSigOutputClass 0x70727472 /* 'prtr' */ 00266 #define icSigLinkClass 0x6C696E6B /* 'link' */ 00267 #define icSigAbstractClass 0x61627374 /* 'abst' */ 00268 #define icSigColorSpaceClass 0x73706163 /* 'spac' */ 00269 #define icMaxEnumClass 0xFFFFFFFF /* enum = 4 00270 bytes max */ 00271 00272 /* Platform Signatures */ 00273 typedef unsigned char icPlatformSignature[4]; 00274 #define icSigMacintosh 0x4150504C /* 'APPL' */ 00275 #define icSigMicrosoft 0x4D534654 /* 'MSFT' */ 00276 #define icSigSolaris 0x53554E57 /* 'SUNW' */ 00277 #define icSigSGI 0x53474920 /* 'SGI ' */ 00278 #define icSigTaligent 0x54474E54 /* 'TGNT' */ 00279 #define icMaxEnumPlatform 0xFFFFFFFF /* enum = 4 00280 bytes max */ 00281 00282 /*------------------------------------------------------------------------*/ 00283 /* 00284 * Other enums 00285 */ 00286 00287 /* Measurement Flare, used in the measurmentType tag */ 00288 typedef unsigned char icMeasurementFlare[4]; 00289 #define icFlare0 0x00000000 /* 0% flare */ 00290 #define icFlare100 0x00000001 /* 100% flare */ 00291 #define icMaxFlare 0xFFFFFFFF /* enum = 4 bytes max */ 00292 00293 /* Measurement Geometry, used in the measurmentType tag */ 00294 typedef unsigned char icMeasurementGeometry[4]; 00295 #define icGeometryUnknown 0x00000000 /* Unknown geometry */ 00296 #define icGeometry045or450 0x00000001 /* 0/45 or 45/0 */ 00297 #define icGeometry0dord0 0x00000002 /* 0/d or d/0 */ 00298 #define icMaxGeometry 0xFFFFFFFF /* enum = 4 bytes max */ 00299 00300 /* Rendering Intents, used in the profile header */ 00301 typedef unsigned char icRenderingIntent[4]; 00302 #define icPerceptual 0 00303 #define icRelativeColorimetric 1 00304 #define icSaturation 2 00305 #define icAbsoluteColorimetric 3 00306 #define icUseRenderingIntent 0xFFFFFFFF /* New Definition */ 00307 #define icMaxEnumIntent 0xFFFFFFFF /* enum = 4 bytes max */ 00308 00309 /* Different Spot Shapes currently defined, used for screeningType */ 00310 typedef unsigned char icSpotShape[4]; 00311 #define icSpotShapeUnknown 0 00312 #define icSpotShapePrinterDefault 1 00313 #define icSpotShapeRound 2 00314 #define icSpotShapeDiamond 3 00315 #define icSpotShapeEllipse 4 00316 #define icSpotShapeLine 5 00317 #define icSpotShapeSquare 6 00318 #define icSpotShapeCross 7 00319 #define icMaxEnumSpot 0xFFFFFFFF /* enum = 4 bytes max */ 00320 00321 /* Standard Observer, used in the measurmentType tag */ 00322 typedef unsigned char icStandardObserver[4]; 00323 #define icStdObsUnknown 0x00000000 /* Unknown observer */ 00324 #define icStdObs1931TwoDegrees 0x00000001 /* 1931 two degrees */ 00325 #define icStdObs1964TenDegrees 0x00000002 /* 1961 ten degrees */ 00326 #define icMaxStdObs 0xFFFFFFFF /* enum = 4 bytes max */ 00327 00328 /* Pre-defined illuminants, used in measurement and viewing conditions type */ 00329 typedef unsigned char icIlluminant[4]; 00330 #define icIlluminantUnknown = 0x00000000 00331 #define icIlluminantD50 = 0x00000001 00332 #define icIlluminantD65 = 0x00000002 00333 #define icIlluminantD93 = 0x00000003 00334 #define icIlluminantF2 = 0x00000004 00335 #define icIlluminantD55 = 0x00000005 00336 #define icIlluminantA = 0x00000006 00337 #define icIlluminantEquiPowerE = 0x00000007 /* Equi-Power (E) */ 00338 #define icIlluminantF8 = 0x00000008 00339 #define icMaxEnumIluminant = 0xFFFFFFFF /* enum = 4 00340 00341 /*------------------------------------------------------------------------*/ 00342 /* 00343 * Number definitions 00344 */ 00345 00346 /* Unsigned integer numbers */ 00347 typedef unsigned char icUInt8Number; 00348 typedef unsigned char icUInt16Number[2]; 00349 typedef unsigned char icUInt32Number[4]; 00350 typedef unsigned char icUInt64Number[8]; 00351 00352 /* Signed numbers */ 00353 typedef signed char icInt8Number; 00354 typedef signed char icInt16Number[2]; 00355 typedef signed char icInt32Number[4]; 00356 typedef signed char icInt64Number[8]; 00357 00358 /* Fixed numbers */ 00359 typedef signed char icS15Fixed16Number[4]; 00360 typedef unsigned char icU16Fixed16Number[4]; 00361 00362 /*------------------------------------------------------------------------*/ 00363 /* 00364 * Arrays of numbers 00365 */ 00366 00367 /* Int8 Array */ 00368 typedef struct { 00369 icInt8Number data[icAny]; /* Variable array of values */ 00370 } icInt8Array; 00371 00372 /* UInt8 Array */ 00373 typedef struct { 00374 icUInt8Number data[icAny]; /* Variable array of values */ 00375 } icUInt8Array; 00376 00377 /* uInt16 Array */ 00378 typedef struct { 00379 icUInt16Number data[icAny]; /* Variable array of values */ 00380 } icUInt16Array; 00381 00382 /* Int16 Array */ 00383 typedef struct { 00384 icInt16Number data[icAny]; /* Variable array of values */ 00385 } icInt16Array; 00386 00387 /* uInt32 Array */ 00388 typedef struct { 00389 icUInt32Number data[icAny]; /* Variable array of values */ 00390 } icUInt32Array; 00391 00392 /* Int32 Array */ 00393 typedef struct { 00394 icInt32Number data[icAny]; /* Variable array of values */ 00395 } icInt32Array; 00396 00397 /* UInt64 Array */ 00398 typedef struct { 00399 icUInt64Number data[icAny]; /* Variable array of values */ 00400 } icUInt64Array; 00401 00402 /* Int64 Array */ 00403 typedef struct { 00404 icInt64Number data[icAny]; /* Variable array of values */ 00405 } icInt64Array; 00406 00407 /* u16Fixed16 Array */ 00408 typedef struct { 00409 icU16Fixed16Number data[icAny]; /* Variable array of values */ 00410 } icU16Fixed16Array; 00411 00412 /* s15Fixed16 Array */ 00413 typedef struct { 00414 icS15Fixed16Number data[icAny]; /* Variable array of values */ 00415 } icS15Fixed16Array; 00416 00417 /* The base date time number */ 00418 typedef struct { 00419 icUInt16Number year; 00420 icUInt16Number month; 00421 icUInt16Number day; 00422 icUInt16Number hours; 00423 icUInt16Number minutes; 00424 icUInt16Number seconds; 00425 } icDateTimeNumber; 00426 00427 /* XYZ Number */ 00428 typedef struct { 00429 icS15Fixed16Number X; 00430 icS15Fixed16Number Y; 00431 icS15Fixed16Number Z; 00432 } icXYZNumber; 00433 00434 /* XYZ Array */ 00435 typedef struct { 00436 icXYZNumber data[icAny]; /* Variable array of XYZ numbers */ 00437 } icXYZArray; 00438 00439 /* Curve */ 00440 typedef struct { 00441 icUInt32Number count; /* Number of entries */ 00442 icUInt16Number data[icAny]; /* The actual table data, real 00443 * number is determined by count 00444 */ 00445 } icCurve; 00446 00447 /* Data */ 00448 typedef struct { 00449 icUInt32Number dataFlag; /* 0 = ascii, 1 = binary */ 00450 icInt8Number data[icAny]; /* Data, size determined from tag */ 00451 } icData; 00452 00453 /* lut16 */ 00454 typedef struct { 00455 icUInt8Number inputChan; /* Number of input channels */ 00456 icUInt8Number outputChan; /* Number of output channels */ 00457 icUInt8Number clutPoints; /* Number of clutTable grid points */ 00458 icInt8Number pad; /* Padding for byte alignment */ 00459 icS15Fixed16Number e00; /* e00 in the 3 * 3 */ 00460 icS15Fixed16Number e01; /* e01 in the 3 * 3 */ 00461 icS15Fixed16Number e02; /* e02 in the 3 * 3 */ 00462 icS15Fixed16Number e10; /* e10 in the 3 * 3 */ 00463 icS15Fixed16Number e11; /* e11 in the 3 * 3 */ 00464 icS15Fixed16Number e12; /* e12 in the 3 * 3 */ 00465 icS15Fixed16Number e20; /* e20 in the 3 * 3 */ 00466 icS15Fixed16Number e21; /* e21 in the 3 * 3 */ 00467 icS15Fixed16Number e22; /* e22 in the 3 * 3 */ 00468 icUInt16Number inputEnt; /* Number of input table entries */ 00469 icUInt16Number outputEnt; /* Number of output table entries */ 00470 icUInt16Number data[icAny]; /* Data follows see spec for size */ 00471 /* 00472 * Data that follows is of this form 00473 * 00474 * icUInt16Number inputTable[inputChan][icAny]; * The input table 00475 * icUInt16Number clutTable[icAny]; * The clut table 00476 * icUInt16Number outputTable[outputChan][icAny]; * The output table 00477 */ 00478 } icLut16; 00479 00480 /* lut8, input & output tables are always 256 bytes in length */ 00481 typedef struct { 00482 icUInt8Number inputChan; /* Number of input channels */ 00483 icUInt8Number outputChan; /* Number of output channels */ 00484 icUInt8Number clutPoints; /* Number of clutTable grid points */ 00485 icInt8Number pad; 00486 icS15Fixed16Number e00; /* e00 in the 3 * 3 */ 00487 icS15Fixed16Number e01; /* e01 in the 3 * 3 */ 00488 icS15Fixed16Number e02; /* e02 in the 3 * 3 */ 00489 icS15Fixed16Number e10; /* e10 in the 3 * 3 */ 00490 icS15Fixed16Number e11; /* e11 in the 3 * 3 */ 00491 icS15Fixed16Number e12; /* e12 in the 3 * 3 */ 00492 icS15Fixed16Number e20; /* e20 in the 3 * 3 */ 00493 icS15Fixed16Number e21; /* e21 in the 3 * 3 */ 00494 icS15Fixed16Number e22; /* e22 in the 3 * 3 */ 00495 icUInt8Number data[icAny]; /* Data follows see spec for size */ 00496 /* 00497 * Data that follows is of this form 00498 * 00499 * icUInt8Number inputTable[inputChan][256]; * The input table 00500 * icUInt8Number clutTable[icAny]; * The clut table 00501 * icUInt8Number outputTable[outputChan][256]; * The output table 00502 */ 00503 } icLut8; 00504 00505 /* Measurement Data */ 00506 typedef struct { 00507 icStandardObserver stdObserver; /* Standard observer */ 00508 icXYZNumber backing; /* XYZ for backing material */ 00509 icMeasurementGeometry geometry; /* Measurement geometry */ 00510 icMeasurementFlare flare; /* Measurement flare */ 00511 icIlluminant illuminant; /* Illuminant */ 00512 } icMeasurement; 00513 00514 /* Named color */ 00515 typedef struct { 00516 icUInt32Number vendorFlag; /* Bottom 16 bits for IC use */ 00517 icUInt32Number count; /* Count of named colors */ 00518 icInt8Number data[icAny]; /* Named color data follows */ 00519 /* 00520 * Data that follows is of this form 00521 * 00522 * icInt8Number prefix[icAny]; * Prefix for the color name, max = 32 00523 * icInt8Number suffix[icAny]; * Suffix for the color name, max = 32 00524 * icInt8Number root1[icAny]; * Root name for first color, max = 32 00525 * icInt8Number coords1[icAny]; * Color co-ordinates of first color 00526 * icInt8Number root2[icAny]; * Root name for first color, max = 32 00527 * icInt8Number coords2[icAny]; * Color co-ordinates of first color 00528 * : 00529 * : 00530 * Repeat for root name and color co-ordinates up to (count-1) 00531 */ 00532 } icNamedColor; 00533 00534 /* Profile sequence structure */ 00535 typedef struct { 00536 icSignature deviceMfg; /* Device Manufacturer */ 00537 icSignature deviceModel; /* Decvice Model */ 00538 icUInt64Number attributes; /* Device attributes */ 00539 icTechnologySignature technology; /* Technology signature */ 00540 icInt8Number data[icAny]; /* Descriptions text 00541 follows */ 00542 /* 00543 * Data that follows is of this form 00544 * 00545 * icTextDescription deviceMfgDesc[icAny]; * Manufacturer text 00546 * icTextDescription modelDesc[icAny]; * Model text 00547 */ 00548 } icDescStruct; 00549 00550 /* Profile sequence description */ 00551 typedef struct { 00552 icUInt32Number count; /* Number of descriptions */ 00553 icDescStruct data[icAny]; /* Array of description struct */ 00554 } icProfileSequenceDesc; 00555 00556 /* textDescription */ 00557 typedef struct { 00558 icUInt32Number count; /* Description length */ 00559 icInt8Number data[icAny]; /* Descriptions follow */ 00560 /* 00561 * Data that follows is of this form 00562 * 00563 * icInt8Number desc[icAny] * NULL terminated ascii string 00564 * icUInt32Number ucLangCode; * UniCode language code 00565 * icUInt32Number ucCount; * UniCode description length 00566 * icInt8Number ucDesc[icAny; * The UniCode description 00567 * icUInt16Number scCode; * ScriptCode code 00568 * icUInt8Number scCount; * ScriptCode count 00569 * icInt8Number scDesc[64]; * ScriptCode Description 00570 */ 00571 } icTextDescription; 00572 00573 /* Screening Data */ 00574 typedef struct { 00575 icS15Fixed16Number frequency; /* Frequency */ 00576 icS15Fixed16Number angle; /* Screen angle */ 00577 icSpotShape spotShape; /* Spot Shape encodings below */ 00578 } icScreeningData; 00579 00580 typedef struct { 00581 icUInt32Number screeningFlag; /* Screening flag */ 00582 icUInt32Number channels; /* Number of channels */ 00583 icScreeningData data[icAny]; /* Array of screening data */ 00584 } icScreening; 00585 00586 /* Text Data */ 00587 typedef struct { 00588 icInt8Number data[icAny]; /* Variable array of characters */ 00589 } icText; 00590 00591 /* Structure describing either a UCR or BG curve */ 00592 typedef struct { 00593 icUInt32Number count; /* Curve length */ 00594 icUInt16Number curve[icAny]; /* The array of curve values */ 00595 } icUcrBgCurve; 00596 00597 /* Under color removal, black generation */ 00598 typedef struct { 00599 icUInt8Number data[icAny]; /* The Ucr BG data */ 00600 /* 00601 * Data that follows is of this form 00602 * 00603 * icUcrBgCurve ucr; * Ucr curve 00604 * icUcrBgCurve bg; * Bg curve 00605 */ 00606 } icUcrBg; 00607 00608 /* viewingConditionsType */ 00609 typedef struct { 00610 icXYZNumber illuminant; /* In candelas per metre sq'd */ 00611 icXYZNumber surround; /* In candelas per metre sq'd */ 00612 icIlluminant stdIluminant; /* See icIlluminant defines */ 00613 } icViewingCondition; 00614 00615 00616 /*------------------------------------------------------------------------*/ 00617 /* 00618 * Tag Type definitions 00619 */ 00620 00621 /* 00622 * Many of the structures contain variable length arrays. This 00623 * is represented by the use of the convention. 00624 * 00625 * type data[icAny]; 00626 */ 00627 00628 /* The base part of each tag */ 00629 typedef struct { 00630 icTagTypeSignature sig; /* Signature */ 00631 icInt8Number reserved[4]; /* Reserved, set to 0 */ 00632 } icTagBase; 00633 00634 /* curveType */ 00635 typedef struct { 00636 icTagBase base; /* Signature, "curv" */ 00637 icCurve curve; /* The curve data */ 00638 } icCurveType; 00639 00640 /* dataType */ 00641 typedef struct { 00642 icTagBase base; /* Signature, "data" */ 00643 icData data; /* The data structure */ 00644 } icDataType; 00645 00646 /* dateTimeType */ 00647 typedef struct { 00648 icTagBase base; /* Signature, "dtim" */ 00649 icDateTimeNumber date; /* The date */ 00650 } icDateTimeType; 00651 00652 /* lut16Type */ 00653 typedef struct { 00654 icTagBase base; /* Signature, "mft2" */ 00655 icLut16 lut; /* Lut16 data */ 00656 } icLut16Type; 00657 00658 /* lut8Type, input & output tables are always 256 bytes in length */ 00659 typedef struct { 00660 icTagBase base; /* Signature, "mft1" */ 00661 icLut8 lut; /* Lut8 data */ 00662 } icLut8Type; 00663 00664 /* Measurement Type */ 00665 typedef struct { 00666 icTagBase base; /* Signature, "meas" */ 00667 icMeasurement measurement; /* Measurement data */ 00668 } icMeasurementType; 00669 00670 /* Named color type */ 00671 typedef struct { 00672 icTagBase base; /* Signature, "ncol" */ 00673 icNamedColor ncolor; /* Named color data */ 00674 } icNamedColorType; 00675 00676 /* Profile sequence description type */ 00677 typedef struct { 00678 icTagBase base; /* Signature, "pseq" */ 00679 icProfileSequenceDesc desc; /* The seq description */ 00680 } icProfileSequenceDescType; 00681 00682 /* textDescriptionType */ 00683 typedef struct { 00684 icTagBase base; /* Signature, "desc" */ 00685 icTextDescription desc; /* The description */ 00686 } icTextDescriptionType; 00687 00688 /* s15Fixed16Type */ 00689 typedef struct { 00690 icTagBase base; /* Signature, "sf32" */ 00691 icS15Fixed16Array data; /* Array of values */ 00692 } icS15Fixed16ArrayType; 00693 00694 typedef struct { 00695 icTagBase base; /* Signature, "scrn" */ 00696 icScreening screen; /* Screening structure */ 00697 } icScreeningType; 00698 00699 /* sigType */ 00700 typedef struct { 00701 icTagBase base; /* Signature, "sig" */ 00702 icSignature signature; /* The signature data */ 00703 } icSignatureType; 00704 00705 /* textType */ 00706 typedef struct { 00707 icTagBase base; /* Signature, "text" */ 00708 icText data; /* Variable array of characters */ 00709 } icTextType; 00710 00711 /* u16Fixed16Type */ 00712 typedef struct { 00713 icTagBase base; /* Signature, "uf32" */ 00714 icU16Fixed16Array data; /* Variable array of values */ 00715 } icU16Fixed16ArrayType; 00716 00717 /* Under color removal, black generation type */ 00718 typedef struct { 00719 icTagBase base; /* Signature, "bfd " */ 00720 icUcrBg data; /* ucrBg structure */ 00721 } icUcrBgType; 00722 00723 /* uInt16Type */ 00724 typedef struct { 00725 icTagBase base; /* Signature, "ui16" */ 00726 icUInt16Array data; /* Variable array of values */ 00727 } icUInt16ArrayType; 00728 00729 /* uInt32Type */ 00730 typedef struct { 00731 icTagBase base; /* Signature, "ui32" */ 00732 icUInt32Array data; /* Variable array of values */ 00733 } icUInt32ArrayType; 00734 00735 /* uInt64Type */ 00736 typedef struct { 00737 icTagBase base; /* Signature, "ui64" */ 00738 icUInt64Array data; /* Variable array of values */ 00739 } icUInt64ArrayType; 00740 00741 /* uInt8Type */ 00742 typedef struct { 00743 icTagBase base; /* Signature, "ui08" */ 00744 icUInt8Array data; /* Variable array of values */ 00745 } icUInt8ArrayType; 00746 00747 /* viewingConditionsType */ 00748 typedef struct { 00749 icTagBase base; /* Signature, "view" */ 00750 icViewingCondition view; /* Viewing conditions */ 00751 } icViewingConditionType; 00752 00753 /* XYZ Type */ 00754 typedef struct { 00755 icTagBase base; /* Signature, "XYZ" */ 00756 icXYZArray data; /* Variable array of XYZ numbers */ 00757 } icXYZType; 00758 00759 /*------------------------------------------------------------------------*/ 00760 00761 /* 00762 * Lists of tags, tags, profile header and profile strcuture 00763 */ 00764 00765 /* A tag */ 00766 typedef struct { 00767 icTagSignature sig; /* The tag signature */ 00768 icUInt32Number offset; /* Start of tag relative to 00769 * start of header, Spec Section 8 */ 00770 icUInt32Number size; /* Size in bytes */ 00771 } icTag; 00772 00773 /* A Structure that may be used independently for a list of tags */ 00774 typedef struct { 00775 icUInt32Number count; /* Number of tags in the profile */ 00776 icTag tags[icAny]; /* Variable array of tags */ 00777 } icTagList; 00778 00779 /* The Profile header */ 00780 typedef struct { 00781 icUInt32Number size; /* Profile size in bytes */ 00782 icSignature cmmId; /* CMM for this profile */ 00783 icUInt32Number version; /* Format version number */ 00784 icProfileClassSignature deviceClass; /* Type of profile */ 00785 icColorSpaceSignature colorSpace; /* Color space of data */ 00786 icColorSpaceSignature pcs; /* PCS, XYZ or Lab only */ 00787 icDateTimeNumber date; /* Date profile was created */ 00788 icSignature magic; /* icMagicNumber */ 00789 icPlatformSignature platform; /* Primary Platform */ 00790 icUInt32Number flags; /* Various bit settings */ 00791 icSignature manufacturer; /* Device manufacturer */ 00792 icUInt32Number model; /* Device model number */ 00793 icUInt64Number attributes; /* Device attributes */ 00794 icUInt32Number renderingIntent;/* Rendering intent */ 00795 icXYZNumber illuminant; /* Profile illuminant */ 00796 icInt8Number reserved[48]; /* Reserved for future use */ 00797 } icHeader; 00798 00799 /* 00800 * A profile, 00801 * we can't use icTagList here because its not at the end of the structure 00802 */ 00803 typedef struct { 00804 icHeader header; /* The header */ 00805 icUInt32Number count; /* Number of tags in the profile */ 00806 icInt8Number data[icAny]; /* The tagTable and tagData */ 00807 /* 00808 * Data that follows is of the form 00809 * 00810 * icTag tagTable[icAny]; * The tag table 00811 * icInt8Number tagData[icAny]; * The tag data 00812 */ 00813 } icProfile; 00814 00815 /*------------------------------------------------------------------------*/ 00816 #endif 00817