Important: The information in this document is obsolete and should not be used for new development.
CMNewProfile
Creates a new profile and associated backing copy.
pascal CMError CMNewProfile ( CMProfileRef *prof, const CMProfileLocation *theProfile);
prof- A pointer to a profile reference (page 3-63). On output, a reference to the new profile.
theProfile- 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 theCMCloseProfilefunction, or you can create a profile that is accessed through a procedure provided by your application. To create a temporary profile, you either specifycmNoProfileBaseas the kind of profile in the profile location structure or specifyNULLfor this parameter.- function result
- A result code of type CMError. See "Result Codes" (page 3-174) for a list of ColorSync-specific result codes.
DISCUSSION
TheCMNewProfilefunction 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 callCMUpdateProfile(page 3-73) to save the element data to the profile file. The default ColorSync profile contents include a profile header of typeCM2Header(page 3-43) and an element table.To set profile elements outside the header, you use the
CMSetProfileElementfunction (page 3-96), theCMSetProfileElementSizefunction (page 3-93), and theCMSetPartialProfileElementfunction (page 3-94). You set these elements individually, identifying them by their tag names.When you create a new profile, all fields of the
CM2Headerprofile header are set to 0 except thesizeandprofileVersionfields.To set the header elements, you call theCMGetProfileHeaderfunction (page 3-88) to get a copy of the header, you assign values to the header fields, and you then call theCMSetProfileHeaderfunction (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
CMUpdateProfilefunction to write the new profile elements to the profile file.
- Note
- 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.
![]()
SEE ALSO
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.