PATHDocumentation > Mac OS 8 and 9 > Mutlimedia and Graphics > ColorSync Manager >

Managing Color With ColorSync


Profile Header

The ColorSync Manager defines a profile header type for version 2.x profiles, a separate header for version 1.0 profiles, and a header union that can provide access to either a version 2.x or a version 1.0 profile. For more information on profile version numbers, see ColorSync and ICC Profile Format Version Numbers .


CMHeader

Not Recommended

ColorSync 1.0 defined a version 1.0 profile whose structure and format are different from that of the ICC version 2.x profile. The CMHeader data type represents the version 1.0 profile header. For more information on profile version numbers, see ColorSync and ICC Profile Format Version Numbers . To obtain a copy of the International Color Consortium Profile Format Specification, or to get other information about the ICC, visit the ICC Web site at http://www.color.org .

Your application cannot use ColorSync Manager functions to update a version 1.0 profile or to search for version 1.0 profiles. However, your application can use other ColorSync Manager functions that operate on version 1.0 profiles. For example, your application can open a version 1.0 profile using the function CMOpenProfile , obtain the version 1.0 profile header using the function CMGetProfileHeader , and access version 1.0 profile elements using the function CMGetProfileElement .

To make it possible to operate on both version 1.0 profiles and version 2.x profiles, the ColorSync Manager defines the union CMAppleProfileHeader , which supports either profile header version. The CMHeader data type defines the version 1.0 profile header, while the CM2Header data type defines the version 2.x profile header.

struct CMHeader {
    unsigned long       size;                   /* byte size of profile */
    OSType              CMMType;                /* signature of preferred CMM */
    unsigned long       applProfileVersion;     /* Apple profile version */
    OSType              dataType;               /* type of color data, such as rgb */
    OSType              deviceType;             /* device type, such as monitor */
    OSType              deviceManufacturer;     /* device manufacturer */
    unsigned long       deviceModel;            /* as specified by manufacturer */
    unsigned long       deviceAttributes[2];    /* private info on ink, paper, etc. */
    unsigned long       profileNameOffset;      /* offset to name from top of data */
    unsigned long       customDataOffset;       /* offset to custom data from top */
    CMMatchFlag         flags;                  /* misc. info used by drivers */
    CMMatchOption       options;                /* matching type, such as perceptual */
    CMXYZColor          white;                  /* white point in XYZ space */
    CMXYZColor          black;                  /* black point in XYZ space */
};


Field descriptions

size
The total size in bytes of the profile, including any custom data.
CMMType
The signature of the preferred CMM for color-matching and color-checking sessions for this profile. To avoid conflicts with other CMMs, this signature must be registered with the ICC. For the signature of the default CMM, see Signature of ColorSync's Default Color Management Module .
applProfileVersion
The Apple profile version. Set this field to $0100 (defined as the constant kCMApplProfileVersion ).
dataType
The kind of color data. The types are

rgbData  = 'RGB ', source or destination profiles
cmykData = 'CMYK', destination profiles
grayData = 'GRAY', source or destination profiles
xyzData  = 'XYZ '  source or destination profiles

deviceType
The kind of device. The types are

monitorDevice = 'mntr'
scannerDevice = 'scnr'
printerDevice = 'prtr'

deviceManufacturer
A name supplied by the device manufacturer.
deviceModel
The device model specified by the manufacturer.
deviceAttributes
Private information such as paper surface and ink temperature.
profileNameOffset
The offset to the profile name from the top of data.
customDataOffset
The offset to any custom data from the top of data.
flags
A field used by drivers; it can hold one of the following flags:

CMNativeMatchingPreferred
CMTurnOffCache

The CMNativeMatchingPreferred flag is available for developers of intelligent peripherals that can off-load color matching into the peripheral. Most drivers will not use this flag. (Its default setting is 0, meaning that the profile creator does not care whether matching occurs on the host or the device.)

Use the CMTurnOffCache flag for CMMs that won't benefit from a cache, such as those that can look up data from a table with less overhead, or that don't want to take the memory hit a cache entails, or that do their own caching and don't want the CMM to do it. (The default is 0, meaning turn on cache.)
options
The options field specifies the preferred matching for this profile; the default is CMPerceptualMatch ; other values are CMColorimetricMatch or CMSaturationMatch . The options are set by the image creator.
white
The profile illuminant white reference point, expressed in the XYZ color space.
black
The black reference point for this profile, expressed in the XYZ color space.

For more information on ColorSync 1.0 headers, see How ColorSync 1.0 Profiles and Version 2.x Profiles Differ .

VERSION NOTES

Use of the CMHeader type is not recommended for ColorSync versions starting with 2.0. Use CM2Header instead.


CM2Header

The ColorSync Manager defines the CM2header profile structure to support the header format specified by the ICC format specification for version 2.x profiles. For more information on profile version numbers, see ColorSync and ICC Profile Format Version Numbers . For a description of CMHeader , the ColorSync 1.0 profile header, see CMHeader . To obtain a copy of the International Color Consortium Profile Format Specification, or to get other information about the ICC, visit the ICC Web site at http://www.color.org .

Your application cannot obtain a discrete profile header value using the element tag scheme available for use with elements outside the header. Instead, to set or modify values of a profile header, your application must obtain the entire profile header using the function CMGetProfileHeader and replace the header using the function CMSetProfileHeader .

struct CM2Header {
    unsigned long       size;                   /* total size of profile */
    OSType              CMMType;                /* CMM signature, registered with
                                                    CS2 consortium */
    unsigned long       profileVersion;         /* version of the profile format */
    OSType              profileClass;           /* input, display, output, devicelink,
                                                    abstract, color conversion, or
                                                    named color profile class */
    OSType              dataColorSpace;         /* color space of data */
    OSType              profileConnectionSpace; /* profile connection color space */
    CMDateTime          dateTime;               /* date & time of profile creation */
    OSType              CS2profileSignature;    /* `acsp' constant, required by ICC */
    OSType              platform;               /* primary profile platform, registered
                                                    with CS2 consortium */
    unsigned long       flags;                  /* gives hints for certain options */
    OSType              deviceManufacturer;     /* registered with ICC consortium */
    unsigned long       deviceModel;            /* registered with ICC consortium */
    unsigned long       deviceAttributes[2];    /* attributes such as paper type */
    unsigned long       renderingIntent;        /* preferred rendering intent of object
                                                    tagged with this profile */
    CMFixedXYZColor     white;                  /* profile illuminant */
    OSType              creator;                /* profile creator */
    char                reserved[44];           /* reserved for future use */
};

Field descriptions

size
The total size in bytes of the profile.
CMMType
The signature of the preferred CMM for color-matching and color-checking sessions for this profile. To avoid conflicts with other CMMs, this signature must be registered with the ICC. For the signature of the default CMM, see Signature of ColorSync's Default Color Management Module .
profileVersion
The version of the profile format. The first 8 bits indicate the major version number, followed by 8 bits indicating the minor version number. The following 2 bytes are reserved.
The profile version number is not tied to the version of the ColorSync Manager. Profile formats and their versions are defined by the ICC. For example, a major version change may indicate the addition of new required tags to the profile format; a minor version change may indicate the addition of new optional tags.
profileClass
One of the seven profile classes supported by the ICC: input, display, output, named color space, device link, color space conversion, or abstract. For the signatures representing profile classes, see Profile Class .
dataColorSpace
The color space of the profile. Color values used to express colors of images using this profile are specified in this color space. For a list of the color space signatures, see Color Space Signatures .
profileConnectionSpace
The profile connection space, or PCS. The signatures for the two profile connection spaces supported by ColorSync, cmXYZData and cmLabData , are described in Color Space Signatures .
dateTime
The date and time when the profile was created. You can use this value to keep track of your own versions of this profile. For information on the date and time format, see Date and Time .
CS2profileSignature
The 'acsp' constant as required by the ICC format.
platform
The signature of the primary platform on which this profile runs. For Apple Computer, this is 'APPL' . For other platforms, refer to the International Color Consortium Profile Format Specification .
flags
Flags that provide hints, such as preferred quality and speed options, to the preferred CMM. The flags field consists of an unsigned long data type. The 16 bits in the low word, 0-15, are reserved for use by the ICC. The 16 bits in the high word, 16-31, are available for use by color management systems. For information on how these bits are defined and how your application can set and test them, see Flag Mask Definitions for Version 2.x Profiles .
deviceManufacturer
The signature of the manufacturer of the device to which this profile applies. This value is registered with the ICC.
deviceModel
The model of this device, as registered with the ICC.
deviceAttributes
Attributes that are unique to this particular device setup, such as media, paper, and ink types. The data type for this field is an array of two unsigned longs. The low word of deviceAttributes[0] is reserved by the ICC. The high word of deviceAttributes[0] and the entire word of deviceAttributes[1] are available for vendor use. For information on how the bits in deviceAttributes are defined and how your application can set and test them, see Device Attribute Values for Version 2.x Profiles .
renderingIntent
The preferred rendering intent for the object or file tagged with this profile. Four types of rendering intent are defined: perceptual, relative colorimetric, saturation, and absolute colorimetric. The renderingIntent field consists of an unsigned long data type. The low word is reserved by the ICC and is used to set the rendering intent. The high word is available for use. For information on how the bits in renderingIntent are defined and how your application can set and test them, see Rendering Intent Values for Version 2.x Profiles .
white
The profile illuminant white reference point, expressed in the XYZ color space.
creator
Signature identifying the profile creator.
reserved
This field is reserved for future use.

CMAppleProfileHeader

The ColorSync Manager defines the CMAppleProfileHeader structure to provide access to both version 2.x and version 1.0 profiles, as specified by the International Color Consortium. For related information, see ColorSync and ICC Profile Format Version Numbers . To obtain a copy of the International Color Consortium Profile Format Specification, or to get other information about the ICC, visit the ICC Web site at http://www.color.org .

union CMAppleProfileHeader {
    CMHeader        cm1;    /* ColorSync version 1.0 profile header */
    CM2Header       cm2;    /* ColorSync version 2.x profile header */
};
cm1
A version 1.0 profile header. For a description of the ColorSync version 1.0 profile header, see CMHeader .
cm2
A current profile header. For a description of the ColorSync profile header, see CM2Header .

© 1988-1999 Apple Computer, Inc. — (Last Updated 20 Jan 99)