PATHMac OS 8 Developer Documentation > Mutlimedia and Graphics > ColorSync Manager >

Managing Color With ColorSync


Using Newer Versions of the ColorSync Manager With ColorSync 1.0 Profiles

Despite differences between the version 2.x and ColorSync 1.0 profile formats, you can use most of the ColorSync Manager 2.x functions to gain access to ColorSync 1.0 profiles and their contents and to color match to and from the two disparate profile formats, if necessary. The ColorSync Manager makes this possible.

You can open a reference to a ColorSync 1.0 profile using 2.x functions and special data structures that accommodate both profile styles. You can also match the colors of an image expressed in the color gamut of one device whose characteristics are described by a ColorSync 1.0 profile to the colors within the gamut of another device whose characteristics are described by a version 2.x profile.

IMPORTANT

If you are color matching between devices that both use ColorSync 1.0 profiles, you should use the ColorSync functions that work with 1.0 profiles for the process.

The next section describes

ColorSync Manager 2.x Functions Not Supported for ColorSync 1.0 Profiles

Yo u cannot use the ColorSync Manager's CMUpdateProfile function to update a ColorSync 1.0 profile. The ColorSync Manager does not provide functions for profile version conversions. This is the domain of profile-building tools and calibration applications.

The ColorSync Manager 2.x versions provide a set of functions to search the ColorSync Profiles folder for specific profiles that meet search criteria. These functions act on version 2.x profiles only. If the ColorSync Profiles folder contains ColorSync 1.0 profiles, these functions do not acknowledge them or return results that include them. The 2.x search functions, which are not supported for ColorSync 1.0 functions, are the CMIterateColorSyncFolder , CMNewProfileSearch , CMUpdateProfileSearch , CMDisposeProfileSearch , CMSearchGetIndProfile , CMSearchGetIndProfileFileSpec , CMProfileIdentifierFolderSearch , and CMProfileIdentifierListSearch functions.

You cannot use the ColorSync Manager's NCMUseProfileComment function to generate automatically the picture comments required to embed a ColorSync 1.0 profile. This function is designed to work with version 2.x profiles only.

Using ColorSync 1.0 Profiles With Newer Versions of the ColorSync Manager

You can use versions 2.0 and higher of the ColorSync Manager to match a document image with an embedded 1.0 source profile to the color gamut of a printer defined by a version 2.x profile. Newer versions of the ColorSync Manager are able to contend with both profile formats.

The sections that follow explain how to obtain a reference to the ColorSync 1.0 profile, get the profile's header, and get its synthesized tags.

Opening a ColorSync 1.0 Profile

To use a ColorSync 1.0 profile, you must obtain a reference to the profile. Obtaining a reference to the profile is synonymous with opening the profile for your program's use. If the profile is embedded in a document, you must extract the profile before you can open it.

You can use the CMOpenProfileFile function to obtain a reference to a ColorSync 1.0 profile. Other ColorSync Manager functions that you use to gain access to the profile's contents or perform color matching based on the profile require the profile reference as a parameter.

Obtaining a ColorSync 1.0 Profile Header

After you obtain a reference to a profile, you can gain access to the profile's contents. To gain access to the contents of any of the fields of a profile header, you must get the entire header. The ColorSync Manager allows you to do this using the CMGetProfileHeader function. You pass this function the profile reference and a data structure to hold the returned header. The ColorSync Manager defines the following union of type CMAppleProfileHeader, containing variants for ColorSync 1.0 and version 2.x ColorSync profile headers for this purpose:

union CMAppleProfileHeader {
    CMHeader        cm1;
    CM2Header       cm2;
};

You use the cm1 variant for a ColorSync 1.0 profile header. You can easily test for the version of a profile header to determine which variant to use because the offset of the header version is at the same place for both ColorSync 1.0 profiles and version 2.x profiles.

Obtaining ColorSync 1.0 Profile Elements

The ColorSync Manager provides four tags to allow you to obtain four ColorSync 1.0 profile elements pointed to from the profile header or contained outside the header. To obtain the profile element, you specify its associated tag signature as a parameter to the CMGetProfileElement function along with the profile reference. The ColorSync Manager provides the following enumeration that defines these tags:

enum {
        cmCS1ChromTag   = 'chrm',
        cmCS1TRCTag     = 'trc ',
        cmCS1NameTag    = 'name',
        cmCS1CustTag    = 'cust'
};
cmCS1ChromTag
Profile chromaticities tag signature. Element data for this tag specifies the XYZ chromaticities for the six primary and secondary colors (red, green, blue, cyan, magenta, and yellow).
cmCS1TRCTag
Profile response data tag signature. Element data for this tag specifies the profile response data for the associated device.
cmCS1NameTag
Profile name string tag signature. Element data for this tag specifies the profile name string. This is an international string consisting of a Macintosh script code followed by a length byte and up to 63 additional bytes composing a text string that identifies the profile.
cmCS1CustTag
Custom tag signature. Element data for this tag specifies the private data for a custom CMM.

Embedding ColorSync 1.0 Profiles

In ColorSync 1.0, picture comment types cmBeginProfile and cmEndProfile are used to begin and end a picture comment.

The cmEnableMatching and cmDisableMatching picture comments are used to begin and end color matching in ColorSync 1.0 and in newer versions of the ColorSync Manager.


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