test: icc.h Source File

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# icc.h

Go to the documentation of this file.

    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    icSigK007Tag                        0x4B303037   /* 'K007' */
    00186 #define    icMaxEnumTag                        0xFFFFFFFF   /* enum = 4
    00187 bytes max */
    00188
    00189 typedef unsigned char   icTechnologySignature[4];
    00190 /* technology signature descriptions */
    00191 #define    icSigFilmScanner                    0x6673636E   /* 'fscn' */
    00192 #define    icSigReflectiveScanner              0x7273636E   /* 'rscn' */
    00193 #define    icSigInkJetPrinter                  0x696A6574   /* 'ijet' */
    00194 #define    icSigThermalWaxPrinter              0x74776178   /* 'twax' */
    00195 #define    icSigElectrophotographicPrinter     0x6570686F   /* 'epho' */
    00196 #define    icSigElectrostaticPrinter           0x65737461   /* 'esta' */
    00197 #define    icSigDyeSublimationPrinter          0x64737562   /* 'dsub' */
    00198 #define    icSigPhotographicPaperPrinter       0x7270686F   /* 'rpho' */
    00199 #define    icSigFilmWriter                     0x6670726E   /* 'fprn' */
    00200 #define    icSigVideoMonitor                   0x7669646D   /* 'vidm' */
    00201 #define    icSigVideoCamera                    0x76696463   /* 'vidc' */
    00202 #define    icSigProjectionTelevision           0x706A7476   /* 'pjtv' */
    00203 #define    icSigCRTDisplay                     0x43525420   /* 'CRT ' */
    00204 #define    icSigPMDisplay                      0x504D4420   /* 'PMD ' */
    00205 #define    icSigAMDisplay                      0x414D4420   /* 'AMD ' */
    00206 #define    icSigPhotoCD                        0x4B504344   /* 'KPCD' */
    00207 #define    icSigPhotoImageSetter               0x696D6773   /* 'imgs' */
    00208 #define    icSigGravure                        0x67726176   /* 'grav' */
    00209 #define    icSigOffsetLithography              0x6F666673   /* 'offs' */
    00210 #define    icSigSilkscreen                     0x73696C6B   /* 'silk' */
    00211 #define    icSigFlexography                    0x666C6578   /* 'flex' */
    00212 #define    icMaxEnumTechnology                 0xFFFFFFFF   /* enum = 4
    00213 bytes max */
    00214
    00215 typedef unsigned char   icTagTypeSignature[4];
    00216 /* type signatures */
    00217 #define    icSigCurveType                      0x63757276   /* 'curv' */
    00218 #define    icSigDataType                       0x64617461   /* 'data' */
    00219 #define    icSigDateTimeType                   0x6474696D   /* 'dtim' */
    00220 #define    icSigLut16Type                      0x6d667432   /* 'mft2' */
    00221 #define    icSigLut8Type                       0x6d667431   /* 'mft1' */
    00222 #define    icSigMeasurementType                0x6D656173   /* 'meas' */
    00223 #define    icSigNamedColorType                 0x6E636f6C   /* 'ncol' */
    00224 #define    icSigProfileSequenceDescType        0x70736571   /* 'pseq' */
    00225 #define    icSigS15Fixed16ArrayType            0x73663332   /* 'sf32' */
    00226 #define    icSigScreeningType                  0x7363726E   /* 'scrn' */
    00227 #define    icSigSignatureType                  0x73696720   /* 'sig ' */
    00228 #define    icSigTextType                       0x74657874   /* 'text' */
    00229 #define    icSigTextDescriptionType            0x64657363   /* 'desc' */
    00230 #define    icSigU16Fixed16ArrayType            0x75663332   /* 'uf32' */
    00231 #define    icSigUcrBgType                      0x62666420   /* 'bfd ' */
    00232 #define    icSigUInt16ArrayType                0x75693136   /* 'ui16' */
    00233 #define    icSigUInt32ArrayType                0x75693332   /* 'ui32' */
    00234 #define    icSigUInt64ArrayType                0x75693634   /* 'ui64' */
    00235 #define    icSigUInt8ArrayType                 0x75693038   /* 'ui08' */
    00236 #define    icSigViewingConditionsType          0x76696577   /* 'view' */
    00237 #define    icSigXYZType                        0x58595A20   /* 'XYZ ' */
    00238 #define    icMaxEnumType                       0xFFFFFFFF   /* enum = 4
    00239 bytes max */
    00240
    00241 /*
    00242  * Color Space Signatures
    00243  * Note that only icSigXYZData and icSigLabData are valid
    00244  * Profile Connection Spaces (PCSs)
    00245  */
    00246 typedef unsigned char   icColorSpaceSignature[4];
    00247 #define    icSigXYZData                        0x58595A20   /* 'XYZ ' */
    00248 #define    icSigLabData                        0x4C616220   /* 'Lab ' */
    00249 #define    icSigLuvData                        0x4C757620   /* 'Luv ' */
    00250 #define    icSigYCbCrData                      0x59436272   /* 'YCbr' */
    00251 #define    icSigYxyData                        0x59787920   /* 'Yxy ' */
    00252 #define    icSigRgbData                        0x52474220   /* 'RGB ' */
    00253 #define    icSigGrayData                       0x47524159   /* 'GRAY' */
    00254 #define    icSigHsvData                        0x48535620   /* 'HSV ' */
    00255 #define    icSigHlsData                        0x484C5320   /* 'HLS ' */
    00256 #define    icSigCmykData                       0x434D594B   /* 'CMYK' */
    00257 #define    icSigCmyData                        0x434D5920   /* 'CMY ' */
    00258 #define    icSigDefData                        0x44454620   /* 'DEF ' New Definition */
    00259 #define    icMaxEnumData                       0xFFFFFFFF   /* enum = 4
    00260 bytes max */
    00261
    00262 /* profileClass enumerations */
    00263 typedef unsigned char   icProfileClassSignature[4];
    00264 #define    icSigInputClass                     0x73636E72   /* 'scnr' */
    00265 #define    icSigDisplayClass                   0x6D6E7472   /* 'mntr' */
    00266 #define    icSigOutputClass                    0x70727472   /* 'prtr' */
    00267 #define    icSigLinkClass                      0x6C696E6B   /* 'link' */
    00268 #define    icSigAbstractClass                  0x61627374   /* 'abst' */
    00269 #define    icSigColorSpaceClass                0x73706163   /* 'spac' */
    00270 #define    icMaxEnumClass                      0xFFFFFFFF   /* enum = 4
    00271 bytes max */
    00272
    00273 /* Platform Signatures */
    00274 typedef unsigned char   icPlatformSignature[4];
    00275 #define    icSigMacintosh                      0x4150504C   /* 'APPL' */
    00276 #define    icSigMicrosoft                      0x4D534654   /* 'MSFT' */
    00277 #define    icSigSolaris                        0x53554E57   /* 'SUNW' */
    00278 #define    icSigSGI                            0x53474920   /* 'SGI ' */
    00279 #define    icSigTaligent                       0x54474E54   /* 'TGNT' */
    00280 #define    icMaxEnumPlatform                   0xFFFFFFFF   /* enum = 4
    00281 bytes max */
    00282
    00283 /*------------------------------------------------------------------------*/
    00284 /*
    00285  * Other enums
    00286  */
    00287
    00288 /* Measurement Flare, used in the measurmentType tag */
    00289 typedef unsigned char   icMeasurementFlare[4];
    00290 #define     icFlare0                    0x00000000      /* 0% flare */
    00291 #define     icFlare100                  0x00000001      /* 100% flare */
    00292 #define     icMaxFlare                  0xFFFFFFFF      /* enum = 4 bytes max */
    00293
    00294 /* Measurement Geometry, used in the measurmentType tag */
    00295 typedef unsigned char   icMeasurementGeometry[4];
    00296 #define     icGeometryUnknown           0x00000000      /* Unknown geometry */
    00297 #define     icGeometry045or450          0x00000001      /* 0/45 or 45/0 */
    00298 #define     icGeometry0dord0            0x00000002      /* 0/d or d/0 */
    00299 #define     icMaxGeometry               0xFFFFFFFF      /* enum = 4 bytes max */
    00300
    00301 /* Rendering Intents, used in the profile header */
    00302 typedef unsigned char   icRenderingIntent[4];
    00303 #define     icPerceptual                0
    00304 #define     icRelativeColorimetric      1
    00305 #define     icSaturation                2
    00306 #define     icAbsoluteColorimetric      3
    00307 #define     icUseRenderingIntent        0xFFFFFFFF      /* New Definition  */
    00308 #define     icMaxEnumIntent             0xFFFFFFFF      /* enum = 4 bytes max */
    00309
    00310 /* Different Spot Shapes currently defined, used for screeningType */
    00311 typedef unsigned char   icSpotShape[4];
    00312 #define     icSpotShapeUnknown          0
    00313 #define     icSpotShapePrinterDefault   1
    00314 #define     icSpotShapeRound            2
    00315 #define     icSpotShapeDiamond          3
    00316 #define     icSpotShapeEllipse          4
    00317 #define     icSpotShapeLine             5
    00318 #define     icSpotShapeSquare           6
    00319 #define     icSpotShapeCross            7
    00320 #define     icMaxEnumSpot               0xFFFFFFFF      /* enum = 4 bytes max */
    00321
    00322 /* Standard Observer, used in the measurmentType tag */
    00323 typedef unsigned char   icStandardObserver[4];
    00324 #define     icStdObsUnknown             0x00000000      /* Unknown observer */
    00325 #define     icStdObs1931TwoDegrees      0x00000001      /* 1931 two degrees */
    00326 #define     icStdObs1964TenDegrees      0x00000002      /* 1961 ten degrees */
    00327 #define     icMaxStdObs                 0xFFFFFFFF      /* enum = 4 bytes max */
    00328
    00329 /* Pre-defined illuminants, used in measurement and viewing conditions type */
    00330 typedef unsigned char   icIlluminant[4];
    00331 #define     icIlluminantUnknown                 = 0x00000000
    00332 #define     icIlluminantD50                     = 0x00000001
    00333 #define     icIlluminantD65                     = 0x00000002
    00334 #define     icIlluminantD93                     = 0x00000003
    00335 #define     icIlluminantF2                      = 0x00000004
    00336 #define     icIlluminantD55                     = 0x00000005
    00337 #define     icIlluminantA                       = 0x00000006
    00338 #define     icIlluminantEquiPowerE              = 0x00000007    /* Equi-Power (E) */
    00339 #define     icIlluminantF8                      = 0x00000008
    00340 #define     icMaxEnumIluminant                  = 0xFFFFFFFF    /* enum = 4
    00341
    00342 /*------------------------------------------------------------------------*/
    00343 /*
    00344  * Number definitions
    00345  */
    00346
    00347 /* Unsigned integer numbers */
    00348 typedef unsigned char   icUInt8Number;
    00349 typedef unsigned char   icUInt16Number[2];
    00350 typedef unsigned char   icUInt32Number[4];
    00351 typedef unsigned char   icUInt64Number[8];
    00352
    00353 /* Signed numbers */
    00354 typedef signed char     icInt8Number;
    00355 typedef signed char     icInt16Number[2];
    00356 typedef signed char     icInt32Number[4];
    00357 typedef signed char     icInt64Number[8];
    00358
    00359 /* Fixed numbers */
    00360 typedef signed char     icS15Fixed16Number[4];
    00361 typedef unsigned char   icU16Fixed16Number[4];
    00362
    00363 /*------------------------------------------------------------------------*/
    00364 /*
    00365  * Arrays of numbers
    00366  */
    00367
    00368 /* Int8 Array */
    00369 typedef struct {
    00370     icInt8Number        data[icAny];    /* Variable array of values */
    00371 } icInt8Array;
    00372
    00373 /* UInt8 Array */
    00374 typedef struct {
    00375     icUInt8Number       data[icAny];    /* Variable array of values */
    00376 } icUInt8Array;
    00377
    00378 /* uInt16 Array */
    00379 typedef struct {
    00380     icUInt16Number      data[icAny];    /* Variable array of values */
    00381 } icUInt16Array;
    00382
    00383 /* Int16 Array */
    00384 typedef struct {
    00385     icInt16Number       data[icAny];    /* Variable array of values */
    00386 } icInt16Array;
    00387
    00388 /* uInt32 Array */
    00389 typedef struct {
    00390     icUInt32Number      data[icAny];    /* Variable array of values */
    00391 } icUInt32Array;
    00392
    00393 /* Int32 Array */
    00394 typedef struct {
    00395     icInt32Number       data[icAny];    /* Variable array of values */
    00396 } icInt32Array;
    00397
    00398 /* UInt64 Array */
    00399 typedef struct {
    00400     icUInt64Number      data[icAny];    /* Variable array of values */
    00401 } icUInt64Array;
    00402
    00403 /* Int64 Array */
    00404 typedef struct {
    00405     icInt64Number       data[icAny];    /* Variable array of values */
    00406 } icInt64Array;
    00407
    00408 /* u16Fixed16 Array */
    00409 typedef struct {
    00410     icU16Fixed16Number  data[icAny];    /* Variable array of values */
    00411 } icU16Fixed16Array;
    00412
    00413 /* s15Fixed16 Array */
    00414 typedef struct {
    00415     icS15Fixed16Number  data[icAny];    /* Variable array of values */
    00416 } icS15Fixed16Array;
    00417
    00418 /* The base date time number */
    00419 typedef struct {
    00420     icUInt16Number      year;
    00421     icUInt16Number      month;
    00422     icUInt16Number      day;
    00423     icUInt16Number      hours;
    00424     icUInt16Number      minutes;
    00425     icUInt16Number      seconds;
    00426 } icDateTimeNumber;
    00427
    00428 /* XYZ Number  */
    00429 typedef struct {
    00430     icS15Fixed16Number  X;
    00431     icS15Fixed16Number  Y;
    00432     icS15Fixed16Number  Z;
    00433 } icXYZNumber;
    00434
    00435 /* XYZ Array */
    00436 typedef struct {
    00437     icXYZNumber         data[icAny];    /* Variable array of XYZ numbers */
    00438 } icXYZArray;
    00439
    00440 /* Curve */
    00441 typedef struct {
    00442     icUInt32Number      count;          /* Number of entries */
    00443     icUInt16Number      data[icAny];    /* The actual table data, real
    00444                                          * number is determined by count
    00445                                          */
    00446 } icCurve;
    00447
    00448 /* Data */
    00449 typedef struct {
    00450     icUInt32Number      dataFlag;       /* 0 = ascii, 1 = binary */
    00451     icInt8Number        data[icAny];    /* Data, size determined from tag */
    00452 } icData;
    00453
    00454 /* lut16 */
    00455 typedef struct {
    00456     icUInt8Number       inputChan;      /* Number of input channels */
    00457     icUInt8Number       outputChan;     /* Number of output channels */
    00458     icUInt8Number       clutPoints;     /* Number of clutTable grid points */
    00459     icInt8Number        pad;            /* Padding for byte alignment */
    00460     icS15Fixed16Number  e00;            /* e00 in the 3 * 3 */
    00461     icS15Fixed16Number  e01;            /* e01 in the 3 * 3 */
    00462     icS15Fixed16Number  e02;            /* e02 in the 3 * 3 */
    00463     icS15Fixed16Number  e10;            /* e10 in the 3 * 3 */
    00464     icS15Fixed16Number  e11;            /* e11 in the 3 * 3 */
    00465     icS15Fixed16Number  e12;            /* e12 in the 3 * 3 */
    00466     icS15Fixed16Number  e20;            /* e20 in the 3 * 3 */
    00467     icS15Fixed16Number  e21;            /* e21 in the 3 * 3 */
    00468     icS15Fixed16Number  e22;            /* e22 in the 3 * 3 */
    00469     icUInt16Number      inputEnt;       /* Number of input table entries */
    00470     icUInt16Number      outputEnt;      /* Number of output table entries */
    00471     icUInt16Number      data[icAny];    /* Data follows see spec for size */
    00472 /*
    00473  *  Data that follows is of this form
    00474  *
    00475  *  icUInt16Number      inputTable[inputChan][icAny];   * The input table
    00476  *  icUInt16Number      clutTable[icAny];               * The clut table
    00477  *  icUInt16Number      outputTable[outputChan][icAny]; * The output table
    00478  */
    00479 } icLut16;
    00480
    00481 /* lut8, input & output tables are always 256 bytes in length */
    00482 typedef struct {
    00483     icUInt8Number       inputChan;      /* Number of input channels */
    00484     icUInt8Number       outputChan;     /* Number of output channels */
    00485     icUInt8Number       clutPoints;     /* Number of clutTable grid points */
    00486     icInt8Number        pad;
    00487     icS15Fixed16Number  e00;            /* e00 in the 3 * 3 */
    00488     icS15Fixed16Number  e01;            /* e01 in the 3 * 3 */
    00489     icS15Fixed16Number  e02;            /* e02 in the 3 * 3 */
    00490     icS15Fixed16Number  e10;            /* e10 in the 3 * 3 */
    00491     icS15Fixed16Number  e11;            /* e11 in the 3 * 3 */
    00492     icS15Fixed16Number  e12;            /* e12 in the 3 * 3 */
    00493     icS15Fixed16Number  e20;            /* e20 in the 3 * 3 */
    00494     icS15Fixed16Number  e21;            /* e21 in the 3 * 3 */
    00495     icS15Fixed16Number  e22;            /* e22 in the 3 * 3 */
    00496     icUInt8Number       data[icAny];    /* Data follows see spec for size */
    00497 /*
    00498  *  Data that follows is of this form
    00499  *
    00500  *  icUInt8Number       inputTable[inputChan][256];     * The input table
    00501  *  icUInt8Number       clutTable[icAny];               * The clut table
    00502  *  icUInt8Number       outputTable[outputChan][256];   * The output table
    00503  */
    00504 } icLut8;
    00505
    00506 /* Measurement Data */
    00507 typedef struct {
    00508     icStandardObserver          stdObserver;    /* Standard observer */
    00509     icXYZNumber                 backing;        /* XYZ for backing material */
    00510     icMeasurementGeometry       geometry;       /* Measurement geometry */
    00511     icMeasurementFlare          flare;          /* Measurement flare */
    00512     icIlluminant                illuminant;     /* Illuminant */
    00513 } icMeasurement;
    00514
    00515 /* Named color */
    00516 typedef struct {
    00517     icUInt32Number      vendorFlag;     /* Bottom 16 bits for IC use */
    00518     icUInt32Number      count;          /* Count of named colors */
    00519     icInt8Number        data[icAny];    /* Named color data follows */
    00520 /*
    00521  *  Data that follows is of this form
    00522  *
    00523  * icInt8Number         prefix[icAny];  * Prefix for the color name, max = 32
    00524  * icInt8Number         suffix[icAny];  * Suffix for the color name, max = 32
    00525  * icInt8Number         root1[icAny];   * Root name for first color, max = 32
    00526  * icInt8Number         coords1[icAny]; * Color co-ordinates of first color
    00527  * icInt8Number         root2[icAny];   * Root name for first color, max = 32
    00528  * icInt8Number         coords2[icAny]; * Color co-ordinates of first color
    00529  *                      :
    00530  *                      :
    00531  * Repeat for root name and color co-ordinates up to (count-1)
    00532  */
    00533 } icNamedColor;
    00534
    00535 /* Profile sequence structure */
    00536 typedef struct {
    00537     icSignature                 deviceMfg;      /* Device Manufacturer */
    00538     icSignature                 deviceModel;    /* Decvice Model */
    00539     icUInt64Number              attributes;     /* Device attributes */
    00540     icTechnologySignature       technology;     /* Technology signature */
    00541     icInt8Number                data[icAny];    /* Descriptions text
    00542 follows */
    00543 /*
    00544  *  Data that follows is of this form
    00545  *
    00546  * icTextDescription            deviceMfgDesc[icAny];   * Manufacturer text
    00547  * icTextDescription            modelDesc[icAny];       * Model text
    00548  */
    00549 } icDescStruct;
    00550
    00551 /* Profile sequence description */
    00552 typedef struct {
    00553     icUInt32Number      count;          /* Number of descriptions */
    00554     icDescStruct        data[icAny];    /* Array of description struct */
    00555 } icProfileSequenceDesc;
    00556
    00557 /* textDescription */
    00558 typedef struct {
    00559     icUInt32Number      count;          /* Description length */
    00560     icInt8Number        data[icAny];    /* Descriptions follow */
    00561 /*
    00562  *  Data that follows is of this form
    00563  *
    00564  * icInt8Number         desc[icAny]     * NULL terminated ascii string
    00565  * icUInt32Number       ucLangCode;     * UniCode language code
    00566  * icUInt32Number       ucCount;        * UniCode description length
    00567  * icInt8Number         ucDesc[icAny;   * The UniCode description
    00568  * icUInt16Number       scCode;         * ScriptCode code
    00569  * icUInt8Number        scCount;        * ScriptCode count
    00570  * icInt8Number         scDesc[64];     * ScriptCode Description
    00571  */
    00572 } icTextDescription;
    00573
    00574 /* Screening Data */
    00575 typedef struct {
    00576     icS15Fixed16Number  frequency;      /* Frequency */
    00577     icS15Fixed16Number  angle;          /* Screen angle */
    00578     icSpotShape         spotShape;      /* Spot Shape encodings below */
    00579 } icScreeningData;
    00580
    00581 typedef struct {
    00582     icUInt32Number      screeningFlag;  /* Screening flag */
    00583     icUInt32Number      channels;       /* Number of channels */
    00584     icScreeningData     data[icAny];    /* Array of screening data */
    00585 } icScreening;
    00586
    00587 /* Text Data */
    00588 typedef struct {
    00589     icInt8Number        data[icAny];    /* Variable array of characters */
    00590 } icText;
    00591
    00592 /* Structure describing either a UCR or BG curve */
    00593 typedef struct {
    00594     icUInt32Number      count;          /* Curve length */
    00595     icUInt16Number      curve[icAny];   /* The array of curve values */
    00596 } icUcrBgCurve;
    00597
    00598 /* Under color removal, black generation */
    00599 typedef struct {
    00600     icUInt8Number       data[icAny];            /* The Ucr BG data */
    00601 /*
    00602  *  Data that follows is of this form
    00603  *
    00604  * icUcrBgCurve         ucr;            * Ucr curve
    00605  * icUcrBgCurve         bg;             * Bg curve
    00606  */
    00607 } icUcrBg;
    00608
    00609 /* viewingConditionsType */
    00610 typedef struct {
    00611     icXYZNumber         illuminant;     /* In candelas per metre sq'd */
    00612     icXYZNumber         surround;       /* In candelas per metre sq'd */
    00613     icIlluminant        stdIluminant;   /* See icIlluminant defines */
    00614 } icViewingCondition;
    00615
    00616
    00617 /*------------------------------------------------------------------------*/
    00618 /*
    00619  * Tag Type definitions
    00620  */
    00621
    00622 /*
    00623  * Many of the structures contain variable length arrays. This
    00624  * is represented by the use of the convention.
    00625  *
    00626  *      type    data[icAny];
    00627  */
    00628
    00629 /* The base part of each tag */
    00630 typedef struct {
    00631     icTagTypeSignature  sig;            /* Signature */
    00632     icInt8Number        reserved[4];    /* Reserved, set to 0 */
    00633 } icTagBase;
    00634
    00635 /* curveType */
    00636 typedef struct {
    00637     icTagBase           base;           /* Signature, "curv" */
    00638     icCurve             curve;          /* The curve data */
    00639 } icCurveType;
    00640
    00641 /* dataType */
    00642 typedef struct {
    00643     icTagBase           base;           /* Signature, "data" */
    00644     icData              data;           /* The data structure */
    00645 } icDataType;
    00646
    00647 /* dateTimeType */
    00648 typedef struct {
    00649     icTagBase           base;           /* Signature, "dtim" */
    00650     icDateTimeNumber    date;           /* The date */
    00651 } icDateTimeType;
    00652
    00653 /* lut16Type */
    00654 typedef struct {
    00655     icTagBase           base;           /* Signature, "mft2" */
    00656     icLut16             lut;            /* Lut16 data */
    00657 } icLut16Type;
    00658
    00659 /* lut8Type, input & output tables are always 256 bytes in length */
    00660 typedef struct {
    00661     icTagBase           base;           /* Signature, "mft1" */
    00662     icLut8              lut;            /* Lut8 data */
    00663 } icLut8Type;
    00664
    00665 /* Measurement Type */
    00666 typedef struct {
    00667     icTagBase           base;           /* Signature, "meas" */
    00668     icMeasurement       measurement;    /* Measurement data */
    00669 } icMeasurementType;
    00670
    00671 /* Named color type */
    00672 typedef struct {
    00673     icTagBase           base;           /* Signature, "ncol" */
    00674     icNamedColor        ncolor;         /* Named color data */
    00675 } icNamedColorType;
    00676
    00677 /* Profile sequence description type */
    00678 typedef struct {
    00679     icTagBase                   base;   /* Signature, "pseq" */
    00680     icProfileSequenceDesc       desc;   /* The seq description */
    00681 } icProfileSequenceDescType;
    00682
    00683 /* textDescriptionType */
    00684 typedef struct {
    00685     icTagBase                   base;   /* Signature, "desc" */
    00686     icTextDescription           desc;           /* The description */
    00687 } icTextDescriptionType;
    00688
    00689 /* s15Fixed16Type */
    00690 typedef struct {
    00691     icTagBase           base;           /* Signature, "sf32" */
    00692     icS15Fixed16Array   data;           /* Array of values */
    00693 } icS15Fixed16ArrayType;
    00694
    00695 typedef struct {
    00696     icTagBase           base;           /* Signature, "scrn" */
    00697     icScreening         screen;         /* Screening structure */
    00698 } icScreeningType;
    00699
    00700 /* sigType */
    00701 typedef struct {
    00702     icTagBase           base;           /* Signature, "sig" */
    00703     icSignature         signature;      /* The signature data */
    00704 } icSignatureType;
    00705
    00706 /* textType */
    00707 typedef struct {
    00708     icTagBase           base;           /* Signature, "text" */
    00709     icText              data;           /* Variable array of characters */
    00710 } icTextType;
    00711
    00712 /* u16Fixed16Type */
    00713 typedef struct {
    00714     icTagBase           base;           /* Signature, "uf32" */
    00715     icU16Fixed16Array   data;           /* Variable array of values */
    00716 } icU16Fixed16ArrayType;
    00717
    00718 /* Under color removal, black generation type */
    00719 typedef struct {
    00720     icTagBase           base;           /* Signature, "bfd " */
    00721     icUcrBg             data;           /* ucrBg structure */
    00722 } icUcrBgType;
    00723
    00724 /* uInt16Type */
    00725 typedef struct {
    00726     icTagBase           base;           /* Signature, "ui16" */
    00727     icUInt16Array       data;           /* Variable array of values */
    00728 } icUInt16ArrayType;
    00729
    00730 /* uInt32Type */
    00731 typedef struct {
    00732     icTagBase           base;           /* Signature, "ui32" */
    00733     icUInt32Array       data;           /* Variable array of values */
    00734 } icUInt32ArrayType;
    00735
    00736 /* uInt64Type */
    00737 typedef struct {
    00738     icTagBase           base;           /* Signature, "ui64" */
    00739     icUInt64Array       data;           /* Variable array of values */
    00740 } icUInt64ArrayType;
    00741
    00742 /* uInt8Type */
    00743 typedef struct {
    00744     icTagBase           base;           /* Signature, "ui08" */
    00745     icUInt8Array        data;           /* Variable array of values */
    00746 } icUInt8ArrayType;
    00747
    00748 /* viewingConditionsType */
    00749 typedef struct {
    00750     icTagBase           base;           /* Signature, "view" */
    00751     icViewingCondition  view;           /* Viewing conditions */
    00752 } icViewingConditionType;
    00753
    00754 /* XYZ Type */
    00755 typedef struct {
    00756     icTagBase           base;           /* Signature, "XYZ" */
    00757     icXYZArray          data;           /* Variable array of XYZ numbers */
    00758 } icXYZType;
    00759
    00760 /*------------------------------------------------------------------------*/
    00761
    00762 /*
    00763  * Lists of tags, tags, profile header and profile strcuture
    00764  */
    00765
    00766 /* A tag */
    00767 typedef struct {
    00768     icTagSignature      sig;            /* The tag signature */
    00769     icUInt32Number      offset;         /* Start of tag relative to
    00770                                          * start of header, Spec Section 8 */
    00771     icUInt32Number      size;           /* Size in bytes */
    00772 } icTag;
    00773
    00774 /* A Structure that may be used independently for a list of tags */
    00775 typedef struct {
    00776     icUInt32Number      count;          /* Number of tags in the profile */
    00777     icTag               tags[icAny];    /* Variable array of tags */
    00778 } icTagList;
    00779
    00780 /* The Profile header */
    00781 typedef struct {
    00782     icUInt32Number              size;           /* Profile size in bytes */
    00783     icSignature                 cmmId;          /* CMM for this profile */
    00784     icUInt32Number              version;        /* Format version number */
    00785     icProfileClassSignature     deviceClass;    /* Type of profile */
    00786     icColorSpaceSignature       colorSpace;     /* Color space of data */
    00787     icColorSpaceSignature       pcs;            /* PCS, XYZ or Lab only */
    00788     icDateTimeNumber            date;           /* Date profile was created */
    00789     icSignature                 magic;          /* icMagicNumber */
    00790     icPlatformSignature         platform;       /* Primary Platform */
    00791     icUInt32Number              flags;          /* Various bit settings */
    00792     icSignature                 manufacturer;   /* Device manufacturer */
    00793     icUInt32Number              model;          /* Device model number */
    00794     icUInt64Number              attributes;     /* Device attributes */
    00795     icUInt32Number              renderingIntent;/* Rendering intent */
    00796     icXYZNumber                 illuminant;     /* Profile illuminant */
    00797     icInt8Number                reserved[48];   /* Reserved for future use */
    00798 } icHeader;
    00799
    00800 /*
    00801  * A profile,
    00802  * we can't use icTagList here because its not at the end of the structure
    00803  */
    00804 typedef struct {
    00805     icHeader            header;         /* The header */
    00806     icUInt32Number      count;          /* Number of tags in the profile */
    00807     icInt8Number        data[icAny];    /* The tagTable and tagData */
    00808 /*
    00809  * Data that follows is of the form
    00810  *
    00811  * icTag        tagTable[icAny];        * The tag table
    00812  * icInt8Number tagData[icAny];         * The tag data
    00813  */
    00814 } icProfile;
    00815
    00816 /*------------------------------------------------------------------------*/
    00817 #endif
    00818