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 Reference /
Chapter 3 - ColorSync Manager Reference for Applications and Device Drivers / ColorSync Manager Functions
Accessing Profiles /


CMGetProfileRefCount

Obtains the current reference count for the specified profile.

pascal CMError CMGetProfileRefCount (
CMProfileRef prof,
long *count);
prof
A profile reference (page 3-63) to the profile whose reference count is obtained.
count
A pointer to a reference count. On output, the reference count for the specified profile reference.
function result
A result code of type CMError. See "Result Codes" (page 3-174) for a list of ColorSync-specific result codes.
DISCUSSION
The ColorSync Manager keeps an internal reference count for each profile reference returned from calls such as CMOpenProfile or CMNewProfile. Calling the CMCloneProfileRef function (page 3-78) increments the count; calling the CMCloseProfile function (page 3-71) decrements it. The profile remains open as long as the reference count is greater than 0, indicating at least one routine retains a reference to the profile. When the count reaches 0, the ColorSync Manager releases all memory, files, or resources allocated in association with that profile.

An application that manages profiles closely can call the CMGetProfileRefCount function to obtain the reference count for a profile reference, then perform special handling if necessary, based on the reference count.

SEE ALSO
To copy a profile with the CMCopyProfile function (page 3-76), you must obtain a reference to that profile by either opening the profile or creating it. To open a profile, use the CMOpenProfile function (page 3-69). To create a new profile, use the CMNewProfile function (page 3-75). As an alternative to using the CMCopyProfile function to duplicate an entire profile, you can use the same profile reference more than once. To do so, you call the CMCloneProfileRef function (page 3-78) to increment the reference count for the reference each time you reuse it. Calling the CMCloneProfileRef function increments the count; calling the CMCloseProfile function (page 3-71) decrements it. The profile remains open as long as the reference count is greater than 0, indicating that at least one routine retains a reference to the profile.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996