CMICCProfile.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:42k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       CMICCProfile.h
  3.  
  4.      Contains:   ICC Profile Format Definitions
  5.  
  6.      Version:    Technology: ColorSync 2.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1994-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMICCPROFILE__
  18. #define __CMICCPROFILE__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #if PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #if PRAGMA_IMPORT
  29. #pragma import on
  30. #endif
  31. #if PRAGMA_STRUCT_ALIGN
  32.     #pragma options align=mac68k
  33. #elif PRAGMA_STRUCT_PACKPUSH
  34.     #pragma pack(push, 2)
  35. #elif PRAGMA_STRUCT_PACK
  36.     #pragma pack(2)
  37. #endif
  38. /* ICC Profile version constants  */
  39. enum {
  40.     cmICCProfileVersion2        = 0x02000000,
  41.     cmICCProfileVersion21       = 0x02100000,
  42.     cmCS2ProfileVersion         = cmICCProfileVersion2,
  43.     cmCS1ProfileVersion         = 0x00000100                    /* ColorSync 1.0 profile version */
  44. };
  45. /* Current Major version number */
  46. enum {
  47.     cmProfileMajorVersionMask   = (long)0xFF000000,
  48.     cmCurrentProfileMajorVersion = 0x02000000
  49. };
  50. /* magic cookie number for anonymous file ID */
  51. enum {
  52.     cmMagicNumber               = FOUR_CHAR_CODE('acsp')
  53. };
  54. /************************************************************************/
  55. /*************** ColorSync 2.0 profile specification ********************/
  56. /************************************************************************/
  57. /**** flags field  ****/
  58. enum {
  59.     cmICCReservedFlagsMask      = 0x0000FFFF,                   /* these bits of the flags field are defined and reserved by ICC */
  60.     cmEmbeddedMask              = 0x00000001,                   /* if bit 0 is 0 then not embedded profile, if 1 then embedded profile */
  61.     cmEmbeddedUseMask           = 0x00000002,                   /* if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only */
  62.     cmCMSReservedFlagsMask      = (long)0xFFFF0000,             /* these bits of the flags field are defined and reserved by CMS vendor */
  63.     cmQualityMask               = 0x00030000,                   /* if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best */
  64.     cmInterpolationMask         = 0x00040000,                   /* if bit 18 is 0 then interpolation, if 1 then lookup only */
  65.     cmGamutCheckingMask         = 0x00080000                    /* if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info */
  66. };
  67. /* copyright-protection flag options */
  68. enum {
  69.     cmEmbeddedProfile           = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  70.     cmEmbeddedUse               = 1                             /* 0 is to use anywhere, 1 is to use as embedded profile only */
  71. };
  72. /* speed and quality flag options */
  73. enum {
  74.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  75.     cmDraftMode                 = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  76.     cmBestMode                  = 2                             /* high 14 bits, and then compare with the enum to determine the option value */
  77. };
  78. /**** deviceAttributes fields ****/
  79. /* deviceAttributes[0] is defined by and reserved for device vendors */
  80. /* deviceAttributes[1] is defined by and reserved for ICC */
  81. /* The following bits of deviceAttributes[1] are currently defined */
  82. enum {
  83.     cmReflectiveTransparentMask = 0x00000001,                   /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  84.     cmGlossyMatteMask           = 0x00000002                    /* if bit 1 is 0 then glossy, if 1 then matte */
  85. };
  86. /* device/media attributes element values  */
  87. enum {
  88.     cmReflective                = 0,                            /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  89.     cmGlossy                    = 1                             /* if bit 1 is 0 then glossy, if 1 then matte */
  90. };
  91. /**** renderingIntent field ****/
  92. enum {
  93.     cmPerceptual                = 0,                            /* Photographic images */
  94.     cmRelativeColorimetric      = 1,                            /* Logo Colors */
  95.     cmSaturation                = 2,                            /* Business graphics */
  96.     cmAbsoluteColorimetric      = 3                             /* Logo Colors */
  97. };
  98. /* data type element values */
  99. enum {
  100.     cmAsciiData                 = 0,
  101.     cmBinaryData                = 1
  102. };
  103. /* screen encodings  */
  104. enum {
  105.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  106.     cmLinesPer                  = 1                             /* 0 is LinesPerCm, 1 is LinesPerInch */
  107. };
  108. /* 2.0 tag type information */
  109. enum {
  110.     cmNumHeaderElements         = 10
  111. };
  112. /* public tags */
  113. enum {
  114.     cmAToB0Tag                  = FOUR_CHAR_CODE('A2B0'),
  115.     cmAToB1Tag                  = FOUR_CHAR_CODE('A2B1'),
  116.     cmAToB2Tag                  = FOUR_CHAR_CODE('A2B2'),
  117.     cmBlueColorantTag           = FOUR_CHAR_CODE('bXYZ'),
  118.     cmBlueTRCTag                = FOUR_CHAR_CODE('bTRC'),
  119.     cmBToA0Tag                  = FOUR_CHAR_CODE('B2A0'),
  120.     cmBToA1Tag                  = FOUR_CHAR_CODE('B2A1'),
  121.     cmBToA2Tag                  = FOUR_CHAR_CODE('B2A2'),
  122.     cmCalibrationDateTimeTag    = FOUR_CHAR_CODE('calt'),
  123.     cmCharTargetTag             = FOUR_CHAR_CODE('targ'),
  124.     cmCopyrightTag              = FOUR_CHAR_CODE('cprt'),
  125.     cmDeviceMfgDescTag          = FOUR_CHAR_CODE('dmnd'),
  126.     cmDeviceModelDescTag        = FOUR_CHAR_CODE('dmdd'),
  127.     cmGamutTag                  = FOUR_CHAR_CODE('gamt'),
  128.     cmGrayTRCTag                = FOUR_CHAR_CODE('kTRC'),
  129.     cmGreenColorantTag          = FOUR_CHAR_CODE('gXYZ'),
  130.     cmGreenTRCTag               = FOUR_CHAR_CODE('gTRC'),
  131.     cmLuminanceTag              = FOUR_CHAR_CODE('lumi'),
  132.     cmMeasurementTag            = FOUR_CHAR_CODE('meas'),
  133.     cmMediaBlackPointTag        = FOUR_CHAR_CODE('bkpt'),
  134.     cmMediaWhitePointTag        = FOUR_CHAR_CODE('wtpt'),
  135.     cmNamedColorTag             = FOUR_CHAR_CODE('ncol'),
  136.     cmNamedColor2Tag            = FOUR_CHAR_CODE('ncl2'),
  137.     cmPreview0Tag               = FOUR_CHAR_CODE('pre0'),
  138.     cmPreview1Tag               = FOUR_CHAR_CODE('pre1'),
  139.     cmPreview2Tag               = FOUR_CHAR_CODE('pre2'),
  140.     cmProfileDescriptionTag     = FOUR_CHAR_CODE('desc'),
  141.     cmProfileSequenceDescTag    = FOUR_CHAR_CODE('pseq'),
  142.     cmPS2CRD0Tag                = FOUR_CHAR_CODE('psd0'),
  143.     cmPS2CRD1Tag                = FOUR_CHAR_CODE('psd1'),
  144.     cmPS2CRD2Tag                = FOUR_CHAR_CODE('psd2'),
  145.     cmPS2CRD3Tag                = FOUR_CHAR_CODE('psd3'),
  146.     cmPS2CSATag                 = FOUR_CHAR_CODE('ps2s'),
  147.     cmPS2RenderingIntentTag     = FOUR_CHAR_CODE('ps2i'),
  148.     cmRedColorantTag            = FOUR_CHAR_CODE('rXYZ'),
  149.     cmRedTRCTag                 = FOUR_CHAR_CODE('rTRC'),
  150.     cmScreeningDescTag          = FOUR_CHAR_CODE('scrd'),
  151.     cmScreeningTag              = FOUR_CHAR_CODE('scrn'),
  152.     cmTechnologyTag             = FOUR_CHAR_CODE('tech'),
  153.     cmUcrBgTag                  = FOUR_CHAR_CODE('bfd '),
  154.     cmViewingConditionsDescTag  = FOUR_CHAR_CODE('vued'),
  155.     cmViewingConditionsTag      = FOUR_CHAR_CODE('view')
  156. };
  157. /* custom tags */
  158. enum {
  159.     cmPS2CRDVMSizeTag           = FOUR_CHAR_CODE('psvm'),
  160.     cmVideoCardGammaTag         = FOUR_CHAR_CODE('vcgt'),
  161.     cmMakeAndModelTag           = FOUR_CHAR_CODE('mmod')
  162. };
  163. /* technology tag descriptions */
  164. enum {
  165.     cmTechnologyFilmScanner     = FOUR_CHAR_CODE('fscn'),
  166.     cmTechnologyReflectiveScanner = FOUR_CHAR_CODE('rscn'),
  167.     cmTechnologyInkJetPrinter   = FOUR_CHAR_CODE('ijet'),
  168.     cmTechnologyThermalWaxPrinter = FOUR_CHAR_CODE('twax'),
  169.     cmTechnologyElectrophotographicPrinter = FOUR_CHAR_CODE('epho'),
  170.     cmTechnologyElectrostaticPrinter = FOUR_CHAR_CODE('esta'),
  171.     cmTechnologyDyeSublimationPrinter = FOUR_CHAR_CODE('dsub'),
  172.     cmTechnologyPhotographicPaperPrinter = FOUR_CHAR_CODE('rpho'),
  173.     cmTechnologyFilmWriter      = FOUR_CHAR_CODE('fprn'),
  174.     cmTechnologyVideoMonitor    = FOUR_CHAR_CODE('vidm'),
  175.     cmTechnologyVideoCamera     = FOUR_CHAR_CODE('vidc'),
  176.     cmTechnologyProjectionTelevision = FOUR_CHAR_CODE('pjtv'),
  177.     cmTechnologyCRTDisplay      = FOUR_CHAR_CODE('CRT '),
  178.     cmTechnologyPMDisplay       = FOUR_CHAR_CODE('PMD '),
  179.     cmTechnologyAMDisplay       = FOUR_CHAR_CODE('AMD '),
  180.     cmTechnologyPhotoCD         = FOUR_CHAR_CODE('KPCD'),
  181.     cmTechnologyPhotoImageSetter = FOUR_CHAR_CODE('imgs'),
  182.     cmTechnologyGravure         = FOUR_CHAR_CODE('grav'),
  183.     cmTechnologyOffsetLithography = FOUR_CHAR_CODE('offs'),
  184.     cmTechnologySilkscreen      = FOUR_CHAR_CODE('silk'),
  185.     cmTechnologyFlexography     = FOUR_CHAR_CODE('flex')
  186. };
  187. /* public type signatures */
  188. enum {
  189.     cmSigCurveType              = FOUR_CHAR_CODE('curv'),
  190.     cmSigDataType               = FOUR_CHAR_CODE('data'),
  191.     cmSigDateTimeType           = FOUR_CHAR_CODE('dtim'),
  192.     cmSigLut16Type              = FOUR_CHAR_CODE('mft2'),
  193.     cmSigLut8Type               = FOUR_CHAR_CODE('mft1'),
  194.     cmSigMeasurementType        = FOUR_CHAR_CODE('meas'),
  195.     cmSigNamedColorType         = FOUR_CHAR_CODE('ncol'),
  196.     cmSigNamedColor2Type        = FOUR_CHAR_CODE('ncl2'),
  197.     cmSigProfileDescriptionType = FOUR_CHAR_CODE('desc'),
  198.     cmSigScreeningType          = FOUR_CHAR_CODE('scrn'),
  199.     cmSigS15Fixed16Type         = FOUR_CHAR_CODE('sf32'),
  200.     cmSigSignatureType          = FOUR_CHAR_CODE('sig '),
  201.     cmSigTextType               = FOUR_CHAR_CODE('text'),
  202.     cmSigU16Fixed16Type         = FOUR_CHAR_CODE('uf32'),
  203.     cmSigU1Fixed15Type          = FOUR_CHAR_CODE('uf16'),
  204.     cmSigUInt32Type             = FOUR_CHAR_CODE('ui32'),
  205.     cmSigUInt64Type             = FOUR_CHAR_CODE('ui64'),
  206.     cmSigUInt8Type              = FOUR_CHAR_CODE('ui08'),
  207.     cmSigUnicodeTextType        = FOUR_CHAR_CODE('utxt'),
  208.     cmSigViewingConditionsType  = FOUR_CHAR_CODE('view'),
  209.     cmSigXYZType                = FOUR_CHAR_CODE('XYZ ')
  210. };
  211. /* custom type signatures */
  212. enum {
  213.     cmSigVideoCardGammaType     = FOUR_CHAR_CODE('vcgt'),
  214.     cmSigMakeAndModelType       = FOUR_CHAR_CODE('mmod')
  215. };
  216. /* Measurement type encodings */
  217. /* Measurement Flare */
  218. enum {
  219.     cmFlare0                    = 0x00000000,
  220.     cmFlare100                  = 0x00000001
  221. };
  222. /* Measurement Geometry */
  223. enum {
  224.     cmGeometryUnknown           = 0x00000000,
  225.     cmGeometry045or450          = 0x00000001,
  226.     cmGeometry0dord0            = 0x00000002
  227. };
  228. /* Standard Observer    */
  229. enum {
  230.     cmStdobsUnknown             = 0x00000000,
  231.     cmStdobs1931TwoDegrees      = 0x00000001,
  232.     cmStdobs1964TenDegrees      = 0x00000002
  233. };
  234. /* Standard Illuminant */
  235. enum {
  236.     cmIlluminantUnknown         = 0x00000000,
  237.     cmIlluminantD50             = 0x00000001,
  238.     cmIlluminantD65             = 0x00000002,
  239.     cmIlluminantD93             = 0x00000003,
  240.     cmIlluminantF2              = 0x00000004,
  241.     cmIlluminantD55             = 0x00000005,
  242.     cmIlluminantA               = 0x00000006,
  243.     cmIlluminantEquiPower       = 0x00000007,
  244.     cmIlluminantF8              = 0x00000008
  245. };
  246. /* Spot Function Value */
  247. enum {
  248.     cmSpotFunctionUnknown       = 0,
  249.     cmSpotFunctionDefault       = 1,
  250.     cmSpotFunctionRound         = 2,
  251.     cmSpotFunctionDiamond       = 3,
  252.     cmSpotFunctionEllipse       = 4,
  253.     cmSpotFunctionLine          = 5,
  254.     cmSpotFunctionSquare        = 6,
  255.     cmSpotFunctionCross         = 7
  256. };
  257. /* Color Space Signatures */
  258. enum {
  259.     cmXYZData                   = FOUR_CHAR_CODE('XYZ '),
  260.     cmLabData                   = FOUR_CHAR_CODE('Lab '),
  261.     cmLuvData                   = FOUR_CHAR_CODE('Luv '),
  262.     cmYxyData                   = FOUR_CHAR_CODE('Yxy '),
  263.     cmRGBData                   = FOUR_CHAR_CODE('RGB '),
  264.     cmGrayData                  = FOUR_CHAR_CODE('GRAY'),
  265.     cmHSVData                   = FOUR_CHAR_CODE('HSV '),
  266.     cmHLSData                   = FOUR_CHAR_CODE('HLS '),
  267.     cmCMYKData                  = FOUR_CHAR_CODE('CMYK'),
  268.     cmCMYData                   = FOUR_CHAR_CODE('CMY '),
  269.     cmMCH5Data                  = FOUR_CHAR_CODE('MCH5'),
  270.     cmMCH6Data                  = FOUR_CHAR_CODE('MCH6'),
  271.     cmMCH7Data                  = FOUR_CHAR_CODE('MCH7'),
  272.     cmMCH8Data                  = FOUR_CHAR_CODE('MCH8'),
  273.     cm3CLRData                  = FOUR_CHAR_CODE('3CLR'),
  274.     cm4CLRData                  = FOUR_CHAR_CODE('4CLR'),
  275.     cm5CLRData                  = FOUR_CHAR_CODE('5CLR'),
  276.     cm6CLRData                  = FOUR_CHAR_CODE('6CLR'),
  277.     cm7CLRData                  = FOUR_CHAR_CODE('7CLR'),
  278.     cm8CLRData                  = FOUR_CHAR_CODE('8CLR'),
  279.     cmNamedData                 = FOUR_CHAR_CODE('NAME')
  280. };
  281. /* profileClass enumerations */
  282. enum {
  283.     cmInputClass                = FOUR_CHAR_CODE('scnr'),
  284.     cmDisplayClass              = FOUR_CHAR_CODE('mntr'),
  285.     cmOutputClass               = FOUR_CHAR_CODE('prtr'),
  286.     cmLinkClass                 = FOUR_CHAR_CODE('link'),
  287.     cmAbstractClass             = FOUR_CHAR_CODE('abst'),
  288.     cmColorSpaceClass           = FOUR_CHAR_CODE('spac'),
  289.     cmNamedColorClass           = FOUR_CHAR_CODE('nmcl')
  290. };
  291. /* platform enumerations */
  292. enum {
  293.     cmMacintosh                 = FOUR_CHAR_CODE('APPL'),
  294.     cmMicrosoft                 = FOUR_CHAR_CODE('MSFT'),
  295.     cmSolaris                   = FOUR_CHAR_CODE('SUNW'),
  296.     cmSiliconGraphics           = FOUR_CHAR_CODE('SGI '),
  297.     cmTaligent                  = FOUR_CHAR_CODE('TGNT')
  298. };
  299. /* ColorSync 1.0 elements */
  300. enum {
  301.     cmCS1ChromTag               = FOUR_CHAR_CODE('chrm'),
  302.     cmCS1TRCTag                 = FOUR_CHAR_CODE('trc '),
  303.     cmCS1NameTag                = FOUR_CHAR_CODE('name'),
  304.     cmCS1CustTag                = FOUR_CHAR_CODE('cust')
  305. };
  306. /* General element data types */
  307. struct CMDateTime {
  308.     unsigned short                  year;
  309.     unsigned short                  month;
  310.     unsigned short                  dayOfTheMonth;
  311.     unsigned short                  hours;
  312.     unsigned short                  minutes;
  313.     unsigned short                  seconds;
  314. };
  315. typedef struct CMDateTime               CMDateTime;
  316. struct CMFixedXYZColor {
  317.     Fixed                           X;
  318.     Fixed                           Y;
  319.     Fixed                           Z;
  320. };
  321. typedef struct CMFixedXYZColor          CMFixedXYZColor;
  322. typedef unsigned short                  CMXYZComponent;
  323. struct CMXYZColor {
  324.     CMXYZComponent                  X;
  325.     CMXYZComponent                  Y;
  326.     CMXYZComponent                  Z;
  327. };
  328. typedef struct CMXYZColor               CMXYZColor;
  329. struct CM2Header {
  330.     unsigned long                   size;                       /* This is the total size of the Profile */
  331.     OSType                          CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  332.     unsigned long                   profileVersion;             /* Version of CMProfile format */
  333.     OSType                          profileClass;               /* input, display, output, devicelink, abstract, or color conversion profile type */
  334.     OSType                          dataColorSpace;             /* color space of data */
  335.     OSType                          profileConnectionSpace;     /* profile connection color space */
  336.     CMDateTime                      dateTime;                   /* date and time of profile creation */
  337.     OSType                          CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  338.     OSType                          platform;                   /* primary profile platform, Registered with CS2 consortium */
  339.     unsigned long                   flags;                      /* profile flags */
  340.     OSType                          deviceManufacturer;         /* Registered with ICC consortium */
  341.     unsigned long                   deviceModel;                /* Registered with ICC consortium */
  342.     unsigned long                   deviceAttributes[2];        /* Attributes[0] is for device vendors, [1] is for ICC */
  343.     unsigned long                   renderingIntent;            /* preferred rendering intent of tagged object */
  344.     CMFixedXYZColor                 white;                      /* profile illuminant */
  345.     OSType                          creator;                    /* profile creator */
  346.     char                            reserved[44];               /* reserved for future use */
  347. };
  348. typedef struct CM2Header                CM2Header;
  349. struct CMTagRecord {
  350.     OSType                          tag;                        /* Registered with CS2 consortium */
  351.     unsigned long                   elementOffset;              /* Relative to start of CMProfile */
  352.     unsigned long                   elementSize;
  353. };
  354. typedef struct CMTagRecord              CMTagRecord;
  355. struct CMTagElemTable {
  356.     unsigned long                   count;
  357.     CMTagRecord                     tagList[1];                 /* Variable size */
  358. };
  359. typedef struct CMTagElemTable           CMTagElemTable;
  360. /* External 0x02002001 CMProfile */
  361. struct CM2Profile {
  362.     CM2Header                       header;
  363.     CMTagElemTable                  tagTable;
  364.     char                            elemData[1];                /* Tagged element storage. Variable size */
  365. };
  366. typedef struct CM2Profile               CM2Profile;
  367. typedef CM2Profile *                    CM2ProfilePtr;
  368. typedef CM2ProfilePtr *                 CM2ProfileHandle;
  369. /* Tag Type Definitions */
  370. struct CMCurveType {
  371.     OSType                          typeDescriptor;             /* 'curv' */
  372.     unsigned long                   reserved;                   /* fill with 0x00 */
  373.     unsigned long                   countValue;                 /* number of entries in table that follows */
  374.     unsigned short                  data[1];                    /* Tagged element storage. Variable size */
  375. };
  376. typedef struct CMCurveType              CMCurveType;
  377. struct CMDataType {
  378.     OSType                          typeDescriptor;             /* 'data' */
  379.     unsigned long                   reserved;                   /* fill with 0x00 */
  380.     unsigned long                   dataFlag;                   /* 0 = ASCII, 1 = binary */
  381.     char                            data[1];                    /* Tagged element storage. Variable size */
  382. };
  383. typedef struct CMDataType               CMDataType;
  384. struct CMDateTimeType {
  385.     OSType                          typeDescriptor;             /* 'dtim' */
  386.     unsigned long                   reserved;
  387.     CMDateTime                      dateTime;
  388. };
  389. typedef struct CMDateTimeType           CMDateTimeType;
  390. struct CMLut16Type {
  391.     OSType                          typeDescriptor;             /* 'mft2' */
  392.     unsigned long                   reserved;                   /* fill with 0x00 */
  393.     unsigned char                   inputChannels;              /* Number of input channels */
  394.     unsigned char                   outputChannels;             /* Number of output channels */
  395.     unsigned char                   gridPoints;                 /* Number of clutTable grid points */
  396.     unsigned char                   reserved2;                  /* fill with 0x00 */
  397.     Fixed                           matrix[3][3];               /* */
  398.     unsigned short                  inputTableEntries;          /* */
  399.     unsigned short                  outputTableEntries;         /* */
  400.     unsigned short                  inputTable[1];              /* Variable size */
  401.     unsigned short                  CLUT[1];                    /* Variable size */
  402.     unsigned short                  outputTable[1];             /* Variable size */
  403. };
  404. typedef struct CMLut16Type              CMLut16Type;
  405. struct CMLut8Type {
  406.     OSType                          typeDescriptor;             /* 'mft1' */
  407.     unsigned long                   reserved;                   /* fill with 0x00 */
  408.     unsigned char                   inputChannels;              /* */
  409.     unsigned char                   outputChannels;             /* */
  410.     unsigned char                   gridPoints;                 /* */
  411.     unsigned char                   reserved2;                  /* fill with 0x00 */
  412.     Fixed                           matrix[3][3];               /* */
  413.     unsigned char                   inputTable[256];            /* fixed size of 256 */
  414.     unsigned char                   CLUT[2];                    /* Variable size */
  415.     unsigned char                   outputTable[256];           /* fixed size of 256 */
  416. };
  417. typedef struct CMLut8Type               CMLut8Type;
  418. struct CMMeasurementType {
  419.     OSType                          typeDescriptor;             /* 'meas' */
  420.     unsigned long                   reserved;                   /* fill with 0x00 */
  421.     unsigned long                   standardObserver;           /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  422.     CMFixedXYZColor                 backingXYZ;                 /* absolute XYZ values of backing */
  423.     unsigned long                   geometry;                   /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  424.     unsigned long                   flare;                      /* 0 : 0%, 1 : 100% flare */
  425.     unsigned long                   illuminant;                 /* standard illuminant */
  426. };
  427. typedef struct CMMeasurementType        CMMeasurementType;
  428. struct CMNamedColorType {
  429.     OSType                          typeDescriptor;             /* 'ncol' */
  430.     unsigned long                   reserved;                   /* fill with 0x00 */
  431.     unsigned long                   vendorFlag;                 /* */
  432.     unsigned long                   count;                      /* count of named colors in array that follows */
  433.     unsigned char                   prefixName[1];              /* Variable size, max = 32, to access fields after this one, have to count bytes */
  434.     unsigned char                   suffixName[1];              /* Variable size, max = 32 */
  435.     char                            data[1];                    /* varaible size data as explained below */
  436. };
  437. typedef struct CMNamedColorType         CMNamedColorType;
  438. /*    
  439.     A variable size array of structs appears as the last block of data
  440.     in the above struct, CMNamedColorType.  The data structure
  441.     is as follows: (example in C)
  442.     
  443.     struct {                                             
  444.         unsigned char   rootName[1];                 * Variable size, max = 32 
  445.         unsigned char   colorCoords[1];              * Variable size  
  446.     } colorName[1];                                  * Variable size  
  447. */
  448. struct CMNamedColor2Type {
  449.     OSType                          typeDescriptor;             /* 'ncl2' */
  450.     unsigned long                   reserved;                   /* fill with 0x00 */
  451.     unsigned long                   vendorFlag;                 /* lower 16 bits reserved for ICC use */
  452.     unsigned long                   count;                      /* count of named colors in array that follows */
  453.     unsigned long                   deviceChannelCount;         /* number of device channels, 0 indicates no device value available */
  454.     unsigned char                   prefixName[32];             /* 32 byte field.  7 bit ASCII null terminated */
  455.     unsigned char                   suffixName[32];             /* 32 byte field.  7 bit ASCII null terminated */
  456.     char                            data[1];                    /* varaible size data as definced below */
  457. };
  458. typedef struct CMNamedColor2Type        CMNamedColor2Type;
  459. struct CMNamedColor2EntryType {
  460.     unsigned char                   rootName[32];               /* 32 byte field.  7 bit ASCII null terminated */
  461.     unsigned short                  PCSColorCoords[3];          /* Lab or XYZ color */
  462.     unsigned short                  DeviceColorCoords[1];       /* Variable size */
  463. };
  464. typedef struct CMNamedColor2EntryType   CMNamedColor2EntryType;
  465. struct CMTextDescriptionType {
  466.     OSType                          typeDescriptor;             /* 'desc' */
  467.     unsigned long                   reserved;                   /* fill with 0x00 */
  468.     unsigned long                   ASCIICount;                 /* the count of "bytes" */
  469.     unsigned char                   ASCIIName[2];               /* Variable size, to access fields after this one, have to count bytes */
  470.     unsigned long                   UniCodeCode;
  471.     unsigned long                   UniCodeCount;               /* the count of characters, each character has two bytes */
  472.     unsigned char                   UniCodeName[2];             /* Variable size */
  473.     short                           ScriptCodeCode;
  474.     unsigned char                   ScriptCodeCount;            /* the count of "bytes" */
  475.     unsigned char                   ScriptCodeName[2];          /* Variable size */
  476. };
  477. typedef struct CMTextDescriptionType    CMTextDescriptionType;
  478. struct CMTextType {
  479.     OSType                          typeDescriptor;             /* 'text' */
  480.     unsigned long                   reserved;                   /* fill with 0x00 */
  481.     unsigned char                   text[1];                    /* count of text is obtained from tag size element */
  482. };
  483. typedef struct CMTextType               CMTextType;
  484. struct CMUnicodeTextType {
  485.     OSType                          typeDescriptor;             /* 'utxt' */
  486.     unsigned long                   reserved;                   /* fill with 0x00 */
  487.     unsigned short                  text[1];                    /* count of text is obtained from tag size element */
  488. };
  489. typedef struct CMUnicodeTextType        CMUnicodeTextType;
  490. struct CMScreeningType {
  491.     OSType                          typeDescriptor;             /* 'scrn' */
  492.     unsigned long                   reserved;                   /* fill with 0x00 */
  493.     unsigned long                   screeningFlag;              /* bit 0 : use printer default screens, bit 1 : inch/cm */
  494.     unsigned long                   channelCount;
  495.     char                            data[1];                    /* varaible size data as explained below */
  496. };
  497. typedef struct CMScreeningType          CMScreeningType;
  498. /*
  499.     A variable size array of structs appears as the last block of data
  500.     in the above struct, CMScreeningType.  The data structure
  501.     is as follows: (example in C)
  502.     
  503.     struct {
  504.         Fixed           frequency;
  505.         Fixed           angle;
  506.         unsigned long   sportFunction;
  507.      }  channelScreening[1];                        * Variable size 
  508. */
  509. struct CMSignatureType {
  510.     OSType                          typeDescriptor;             /* 'sig ' */
  511.     unsigned long                   reserved;                   /* fill with 0x00 */
  512.     OSType                          signature;
  513. };
  514. typedef struct CMSignatureType          CMSignatureType;
  515. struct CMS15Fixed16ArrayType {
  516.     OSType                          typeDescriptor;             /* 'sf32' */
  517.     unsigned long                   reserved;                   /* fill with 0x00 */
  518.     Fixed                           value[1];                   /* Variable size */
  519. };
  520. typedef struct CMS15Fixed16ArrayType    CMS15Fixed16ArrayType;
  521. struct CMU16Fixed16ArrayType {
  522.     OSType                          typeDescriptor;             /* 'uf32' */
  523.     unsigned long                   reserved;                   /* fill with 0x00 */
  524.     unsigned long                   value[1];                   /* Variable size */
  525. };
  526. typedef struct CMU16Fixed16ArrayType    CMU16Fixed16ArrayType;
  527. struct CMUInt16ArrayType {
  528.     OSType                          typeDescriptor;             /* 'ui16' */
  529.     unsigned long                   reserved;                   /* fill with 0x00 */
  530.     unsigned short                  value[1];                   /* Variable size */
  531. };
  532. typedef struct CMUInt16ArrayType        CMUInt16ArrayType;
  533. struct CMUInt32ArrayType {
  534.     OSType                          typeDescriptor;             /* 'ui32' */
  535.     unsigned long                   reserved;                   /* fill with 0x00 */
  536.     unsigned long                   value[1];                   /* Variable size */
  537. };
  538. typedef struct CMUInt32ArrayType        CMUInt32ArrayType;
  539. struct CMUInt64ArrayType {
  540.     OSType                          typeDescriptor;             /* 'ui64' */
  541.     unsigned long                   reserved;                   /* fill with 0x00 */
  542.     unsigned long                   value[1];                   /* Variable size (x2) */
  543. };
  544. typedef struct CMUInt64ArrayType        CMUInt64ArrayType;
  545. struct CMUInt8ArrayType {
  546.     OSType                          typeDescriptor;             /* 'ui08' */
  547.     unsigned long                   reserved;                   /* fill with 0x00 */
  548.     unsigned char                   value[1];                   /* Variable size */
  549. };
  550. typedef struct CMUInt8ArrayType         CMUInt8ArrayType;
  551. struct CMViewingConditionsType {
  552.     OSType                          typeDescriptor;             /* 'view' */
  553.     unsigned long                   reserved;                   /* fill with 0x00 */
  554.     CMFixedXYZColor                 illuminant;                 /* absolute XYZs of illuminant  in cd/m^2 */
  555.     CMFixedXYZColor                 surround;                   /* absolute XYZs of surround in cd/m^2 */
  556.     unsigned long                   stdIlluminant;              /* see definitions of std illuminants */
  557. };
  558. typedef struct CMViewingConditionsType  CMViewingConditionsType;
  559. struct CMXYZType {
  560.     OSType                          typeDescriptor;             /* 'XYZ ' */
  561.     unsigned long                   reserved;                   /* fill with 0x00 */
  562.     CMFixedXYZColor                 XYZ[1];                     /* variable size XYZ tristimulus values */
  563. };
  564. typedef struct CMXYZType                CMXYZType;
  565. /* Profile sequence description type */
  566. struct CMProfileSequenceDescType {
  567.     OSType                          typeDescriptor;             /* 'pseq ' */
  568.     unsigned long                   reserved;                   /* fill with 0x00 */
  569.     unsigned long                   count;                      /* Number of descriptions */
  570.     char                            data[1];                    /* varaible size data as explained below */
  571. };
  572. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  573. /*
  574.     A variable size array of structs appears as the last block of data
  575.     in the above struct, CMProfileSequenceDescType.  The data structure
  576.     is as follows: (example in C)
  577.     
  578.     struct {                                             
  579.         OSType          deviceMfg;                   * Device Manufacturer 
  580.         OSType          deviceModel;                 * Decvice Model 
  581.         unsigned long   attributes[2];               * Device attributes 
  582.         OSType          technology;                  * Technology signature 
  583.         unsigned long   mfgDescASCIICount;           * the count of "bytes" 
  584.         unsigned char   mfgDescASCIIName[2];         * Variable size 
  585.         unsigned long   mfgDescUniCodeCode;          
  586.         unsigned long   mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  587.         unsigned char   mfgDescUniCodeName[2];       * Variable size 
  588.         unsigned long   mfgDescScriptCodeCode;       
  589.         unsigned long   mfgDescScriptCodeCount;      * the count of "bytes" 
  590.         unsigned char   mfgDescScriptCodeName[2];    * Variable size 
  591.         unsigned long   modelDescASCIICount;         * the count of "bytes" 
  592.         unsigned char   modelDescASCIIName[2];       * Variable size 
  593.         unsigned long   modelDescUniCodeCode;        
  594.         unsigned long   modelDescUniCodeCount;       * the count of characters, each character has two bytes 
  595.         unsigned char   modelDescUniCodeName[2];     * Variable size 
  596.         short           modelDescScriptCodeCode;     
  597.         unsigned char   modelDescScriptCodeCount;    * the count of "bytes" 
  598.         SInt8           filler;                      * For proper alignment across languages 
  599.         unsigned char   modelDescScriptCodeName[2];  * Variable size 
  600.     }   profileDescription[1];                       
  601. */
  602. /* Under color removal, black generation type */
  603. struct CMUcrBgType {
  604.     OSType                          typeDescriptor;             /* 'bfd  ' */
  605.     unsigned long                   reserved;                   /* fill with 0x00 */
  606.     unsigned long                   ucrCount;                   /* Number of UCR entries */
  607.     unsigned short                  ucrValues[1];               /* variable size */
  608.     unsigned long                   bgCount;                    /* Number of BG entries */
  609.     unsigned short                  bgValues[1];                /* variable size */
  610.     unsigned char                   ucrbgASCII[1];              /* null terminated ASCII string */
  611. };
  612. typedef struct CMUcrBgType              CMUcrBgType;
  613. struct CMIntentCRDVMSize {
  614.     long                            renderingIntent;            /* rendering intent */
  615.     unsigned long                   VMSize;                     /* VM size taken up by the CRD */
  616. };
  617. typedef struct CMIntentCRDVMSize        CMIntentCRDVMSize;
  618. struct CMPS2CRDVMSizeType {
  619.     OSType                          typeDescriptor;             /* 'psvm' */
  620.     unsigned long                   reserved;                   /* fill with 0x00 */
  621.     unsigned long                   count;                      /* number of intent entries */
  622.     CMIntentCRDVMSize               intentCRD[1];               /* variable size */
  623. };
  624. typedef struct CMPS2CRDVMSizeType       CMPS2CRDVMSizeType;
  625. /* Video Card Gamma type */
  626. enum {
  627.     cmVideoCardGammaTableType   = 0,
  628.     cmVideoCardGammaFormulaType = 1
  629. };
  630. struct CMVideoCardGammaTable {
  631.     unsigned short                  channels;                   /* # of gamma channels (1 or 3) */
  632.     unsigned short                  entryCount;                 /* 1-based number of entries per channel */
  633.     unsigned short                  entrySize;                  /* size on bytes of each entry */
  634.     char                            data[1];                    /* variable size data follows */
  635. };
  636. typedef struct CMVideoCardGammaTable    CMVideoCardGammaTable;
  637. struct CMVideoCardGammaFormula {
  638.     Fixed                           redGamma;                   /* must be > 0.0 */
  639.     Fixed                           redMin;                     /* must be > 0.0 and < 1.0 */
  640.     Fixed                           redMax;                     /* must be > 0.0 and < 1.0 */
  641.     Fixed                           greenGamma;                 /* must be > 0.0 */
  642.     Fixed                           greenMin;                   /* must be > 0.0 and < 1.0 */
  643.     Fixed                           greenMax;                   /* must be > 0.0 and < 1.0 */
  644.     Fixed                           blueGamma;                  /* must be > 0.0 */
  645.     Fixed                           blueMin;                    /* must be > 0.0 and < 1.0 */
  646.     Fixed                           blueMax;                    /* must be > 0.0 and < 1.0 */
  647. };
  648. typedef struct CMVideoCardGammaFormula  CMVideoCardGammaFormula;
  649. struct CMVideoCardGamma {
  650.     unsigned long                   tagType;
  651.     union {
  652.         CMVideoCardGammaTable           table;
  653.         CMVideoCardGammaFormula         formula;
  654.     }                                 u;
  655. };
  656. typedef struct CMVideoCardGamma         CMVideoCardGamma;
  657. struct CMVideoCardGammaType {
  658.     OSType                          typeDescriptor;             /* 'vcgt' */
  659.     unsigned long                   reserved;                   /* fill with 0x00 */
  660.     CMVideoCardGamma                gamma;
  661. };
  662. typedef struct CMVideoCardGammaType     CMVideoCardGammaType;
  663. struct CMMakeAndModel {
  664.     OSType                          manufacturer;
  665.     unsigned long                   model;
  666.     unsigned long                   serialNumber;
  667.     unsigned long                   manufactureDate;
  668.     unsigned long                   reserved1;                  /* fill with 0x00 */
  669.     unsigned long                   reserved2;                  /* fill with 0x00 */
  670.     unsigned long                   reserved3;                  /* fill with 0x00 */
  671.     unsigned long                   reserved4;                  /* fill with 0x00 */
  672. };
  673. typedef struct CMMakeAndModel           CMMakeAndModel;
  674. struct CMMakeAndModelType {
  675.     OSType                          typeDescriptor;             /* 'mmod' */
  676.     unsigned long                   reserved;                   /* fill with 0x00 */
  677.     CMMakeAndModel                  makeAndModel;
  678. };
  679. typedef struct CMMakeAndModelType       CMMakeAndModelType;
  680. /************************************************************************/
  681. /*************** ColorSync 1.0 profile specification ********************/
  682. /************************************************************************/
  683. enum {
  684.     cmGrayResponse              = 0,
  685.     cmRedResponse               = 1,
  686.     cmGreenResponse             = 2,
  687.     cmBlueResponse              = 3,
  688.     cmCyanResponse              = 4,
  689.     cmMagentaResponse           = 5,
  690.     cmYellowResponse            = 6,
  691.     cmUcrResponse               = 7,
  692.     cmBgResponse                = 8,
  693.     cmOnePlusLastResponse       = 9
  694. };
  695. /* Device types */
  696. enum {
  697.     cmMonitorDevice             = FOUR_CHAR_CODE('mntr'),
  698.     cmScannerDevice             = FOUR_CHAR_CODE('scnr'),
  699.     cmPrinterDevice             = FOUR_CHAR_CODE('prtr')
  700. };
  701. struct CMIString {
  702.     ScriptCode                      theScript;
  703.     Str63                           theString;
  704. };
  705. typedef struct CMIString                CMIString;
  706. /* Profile options */
  707. enum {
  708.     cmPerceptualMatch           = 0x0000,                       /* Default. For photographic images */
  709.     cmColorimetricMatch         = 0x0001,                       /* Exact matching when possible */
  710.     cmSaturationMatch           = 0x0002                        /* For solid colors */
  711. };
  712. /* Profile flags */
  713. enum {
  714.     cmNativeMatchingPreferred   = 0x00000001,                   /* Default to native not preferred */
  715.     cmTurnOffCache              = 0x00000002                    /* Default to turn on CMM cache */
  716. };
  717. typedef long                            CMMatchOption;
  718. typedef long                            CMMatchFlag;
  719. struct CMHeader {
  720.     unsigned long                   size;
  721.     OSType                          CMMType;
  722.     unsigned long                   applProfileVersion;
  723.     OSType                          dataType;
  724.     OSType                          deviceType;
  725.     OSType                          deviceManufacturer;
  726.     unsigned long                   deviceModel;
  727.     unsigned long                   deviceAttributes[2];
  728.     unsigned long                   profileNameOffset;
  729.     unsigned long                   customDataOffset;
  730.     CMMatchFlag                     flags;
  731.     CMMatchOption                   options;
  732.     CMXYZColor                      white;
  733.     CMXYZColor                      black;
  734. };
  735. typedef struct CMHeader                 CMHeader;
  736. struct CMProfileChromaticities {
  737.     CMXYZColor                      red;
  738.     CMXYZColor                      green;
  739.     CMXYZColor                      blue;
  740.     CMXYZColor                      cyan;
  741.     CMXYZColor                      magenta;
  742.     CMXYZColor                      yellow;
  743. };
  744. typedef struct CMProfileChromaticities  CMProfileChromaticities;
  745. struct CMProfileResponse {
  746.     unsigned short                  counts[9];
  747.     unsigned short                  data[1];                    /* Variable size */
  748. };
  749. typedef struct CMProfileResponse        CMProfileResponse;
  750. struct CMProfile {
  751.     CMHeader                        header;
  752.     CMProfileChromaticities         profile;
  753.     CMProfileResponse               response;
  754.     CMIString                       profileName;
  755.     char                            customData[1];              /* Variable size */
  756. };
  757. typedef struct CMProfile                CMProfile;
  758. typedef CMProfile *                     CMProfilePtr;
  759. typedef CMProfilePtr *                  CMProfileHandle;
  760. #if OLDROUTINENAMES
  761. enum {
  762.     kCMApplProfileVersion       = cmCS1ProfileVersion
  763. };
  764. enum {
  765.     grayResponse                = cmGrayResponse,
  766.     redResponse                 = cmRedResponse,
  767.     greenResponse               = cmGreenResponse,
  768.     blueResponse                = cmBlueResponse,
  769.     cyanResponse                = cmCyanResponse,
  770.     magentaResponse             = cmMagentaResponse,
  771.     yellowResponse              = cmYellowResponse,
  772.     ucrResponse                 = cmUcrResponse,
  773.     bgResponse                  = cmBgResponse,
  774.     onePlusLastResponse         = cmOnePlusLastResponse
  775. };
  776. enum {
  777.     rgbData                     = cmRGBData,
  778.     cmykData                    = cmCMYKData,
  779.     grayData                    = cmGrayData,
  780.     xyzData                     = cmXYZData
  781. };
  782. enum {
  783.     XYZData                     = cmXYZData
  784. };
  785. enum {
  786.     monitorDevice               = cmMonitorDevice,
  787.     scannerDevice               = cmScannerDevice,
  788.     printerDevice               = cmPrinterDevice
  789. };
  790. enum {
  791.     CMNativeMatchingPreferred   = cmNativeMatchingPreferred,    /* Default to native not preferred */
  792.     CMTurnOffCache              = cmTurnOffCache                /* Default to turn on CMM cache */
  793. };
  794. enum {
  795.     CMPerceptualMatch           = cmPerceptualMatch,            /* Default. For photographic images */
  796.     CMColorimetricMatch         = cmColorimetricMatch,          /* Exact matching when possible */
  797.     CMSaturationMatch           = cmSaturationMatch             /* For solid colors */
  798. };
  799. typedef unsigned short                  XYZComponent;
  800. typedef CMXYZColor                      XYZColor;
  801. typedef unsigned short                  CMResponseData;
  802. typedef CMIString                       IString;
  803. typedef long                            CMResponseColor;
  804. typedef CMResponseColor                 responseColor;
  805. #endif  /* OLDROUTINENAMES */
  806. #if PRAGMA_STRUCT_ALIGN
  807.     #pragma options align=reset
  808. #elif PRAGMA_STRUCT_PACKPUSH
  809.     #pragma pack(pop)
  810. #elif PRAGMA_STRUCT_PACK
  811.     #pragma pack()
  812. #endif
  813. #ifdef PRAGMA_IMPORT_OFF
  814. #pragma import off
  815. #elif PRAGMA_IMPORT
  816. #pragma import reset
  817. #endif
  818. #ifdef __cplusplus
  819. }
  820. #endif
  821. #endif /* __CMICCPROFILE__ */