![]() |
CMNewProfile |
||||
Header: | CMApplication.h | Carbon status: | Supported | |
Creates a new profile and associated backing copy.
CMError CMNewProfile ( CMProfileRef *prof, const CMProfileLocation *theProfile );
A pointer to a profile reference of type CMProfileRef. On return, a reference to the new profile.
A pointer of type CMProfileLocation to the profile location where the new profile should be created. A profile is commonly disk-file basedthe 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 is not 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.
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 the function CMUpdateProfile to save the element data to the profile file. The default ColorSync profile contents include a profile header of type CM2Header and an element table.
To set profile elements outside the header, you use the function CMSetProfileElement, the function CMSetProfileElementSize, and the function CMSetPartialProfileElement. 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 function CMGetProfileHeader to get a copy of the header, assign values to the header fields, then call the function CMSetProfileHeader to write the new header to the profile.
For each profile class, 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.
Supported in Carbon. Available in Carbon 1.0.2 and later when ColorSync 2.0 or later is present.
© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)