Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging Reference /
Chapter 3 - ColorSync Manager Reference for Applications and Device Drivers / ColorSync Manager Functions
Accessing Profiles /


Creates a new profile and associated backing copy.

pascal CMError CMNewProfile (
CMProfileRef *prof, 
                        const CMProfileLocation *theProfile);
A pointer to a profile reference (page 3-63). On output, a reference to the new profile.
A pointer to the profile location (page 3-40) where the new profile should be created. A profile is commonly disk-file based--the disk file type for a profile is 'prof'. However, to accommodate special requirements, you can create a handle- or pointer-based profile, you can create a temporary profile that isn't saved after you call the CMCloseProfile function, or you can create a profile that is accessed through a procedure provided by your application. To create a temporary profile, you either specify cmNoProfileBase as the kind of profile in the profile location structure or specify NULL for this parameter.
function result
A result code of type CMError. See "Result Codes" (page 3-174) for a list of ColorSync-specific result codes.
The CMNewProfile function creates a new profile and backing copy in the location you specify. After you create the profile, you must fill in the profile header fields and populate the profile with tags and their element data, and then call CMUpdateProfile (page 3-73) to save the element data to the profile file. The default ColorSync profile contents include a profile header of type CM2Header (page 3-43) and an element table.

To set profile elements outside the header, you use the CMSetProfileElement function (page 3-96), the CMSetProfileElementSize function (page 3-93), and the CMSetPartialProfileElement function (page 3-94). You set these elements individually, identifying them by their tag names.

When you create a new profile, all fields of the CM2Header profile header are set to 0 except the size and profileVersion fields.To set the header elements, you call the CMGetProfileHeader function (page 3-88) to get a copy of the header, you assign values to the header fields, and you then call the CMSetProfileHeader function (page 3-97) to write the new header to the profile.

For each profile type, such as a device profile, there is a specific set of elements and associated tags, defined by the ICC, that a profile must contain to meet the baseline requirements. The ICC also defines optional tags that a particular CMM might use to optimize or improve its processing. You can also define private tags, whose tag signatures you register with the ICC, to provide a CMM with greater capability to refine its processing.

After you fill in the profile with tags and their element data, you must call the CMUpdateProfile function to write the new profile elements to the profile file.

This function is most commonly used by profile developers who create profiles for device manufacturers and by calibration applications. In most cases, application developers use existing profiles.
For information on how to fill in a profile with tags and element data including a description of the profile tags, refer to the International Color Consortium Profile Format Specification. See Advanced Color Imaging on the Mac OS, "Introduction to the ColorSync Manager," for information on how to obtain this document.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996