Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging on the Mac OS /
Appendix A - ColorSync Manager Backward Compatibility / Using the ColorSync Manager With ColorSync 1.0 Profiles


Using ColorSync 1.0 Profiles With the ColorSync Manager

To match an image contained in a document that includes the image's embedded ColorSync 1.0 source profile to the color gamut of a printer defined by a version 2.x profile, you must use the ColorSync Manager. The ColorSync Manager is equipped 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 ColorSync Manager 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'
};
'chrm'
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).
'trc'
Profile response data tag signature. Element data for this tag specifies the profile response data for the associated device.
'name'
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.
'cust'
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 the ColorSync Manager.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1996