Important: The information in this document is obsolete and should not be used for new development.
CMUpdateProfile
Saves modifications to the specified profile.
pascal CMError CMUpdateProfile (CMProfileRef prof);
prof
- A profile reference (page 3-63) to the profile to update.
- function result
- A result code of type CMError. See "Result Codes" (page 3-174) for a list of ColorSync-specific result codes.
DISCUSSION
TheCMUpdateProfile
function makes permanent any changes or additions your application has made to the profile identified by the profile reference, if no other references to that profile exist.The ColorSync Manager maintains a modified flag to track whether a profile has been modified. After updating a profile, the
CMUpdateProfile
function sets the value of the modified flag for that profile tofalse
.There are several situations in which you might call
CMUpdateProfile
.
You can call the CMGetProfileRefCount function (page 3-79) to determine the reference count for a profile reference. If the count is greater than one, you cannot update the profile.
- A single profile has been opened more than once, with a new profile reference created each time the profile is opened. (Each profile reference refers to the same profile.) If you call
CMUpdateProfile
to update such a profile, the function will return an error value.- A profile has been opened, then copied one or more times. (Each profile reference refers to a unique profile.) You can call
CMUpdateProfile
to update any of the profiles.- A profile has been opened, then cloned one or more times. (Again, each profile reference refers to a unique profile.) You can call
CMUpdateProfile
to update any of the profiles.
You cannot use the
CMUpdateProfile
function to update a ColorSync 1.0 profile. For information on updating a ColorSync 1.0 profile, see the appendix, "ColorSync Manager Backward Compatibility," in Advanced Color Imaging on the Mac OS.After you fill in tags and their data elements for a new profile created by calling the
CMNewProfile
function (page 3-75), you must call theCMUpdateProfile
function to write the element data to the new profile.If you modify an open profile, you must call
CMUpdateProfile
to save the changes to the profile file before you call theCMCloseProfile
function (page 3-71). Otherwise, the changes are discarded.To modify a profile header, you use the
CMGetProfileHeader
function (page 3-88) and theCMSetProfileHeader
function (page 3-97).To set profile elements outside the header, you use the
CMSetProfileElement
function (page 3-96), theCMSetProfileElementSize
function (page 3-93), and theCMSetPartialProfileElement
function (page 3-94).