Carbon


CMGetProfileRefCount

Header: CMApplication.h Carbon status: Supported

Obtains the current reference count for the specified profile.

CMError CMGetProfileRefCount (
    CMProfileRef prof, 
    SInt32 *count
);
Parameter descriptions
prof

A profile reference of type CMProfileRef to the profile whose reference count is obtained.

count

A pointer to a reference count. On return, the reference count for the specified profile reference.

DISCUSSION

The ColorSync Manager keeps an internal reference count for each profile reference returned from calls such as CMOpenProfile or CMNewProfile. Calling the function CMCloneProfileRef increments the count; calling the function CMCloseProfile 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.

To copy a profile with the function CMCopyProfile, you must obtain a reference to that profile by either opening the profile or creating it. To open a profile, use the function CMOpenProfile. To create a new profile, use the function CMNewProfile. 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 function CMCloneProfileRef to increment the reference count for the reference each time you reuse it. Calling the CMCloneProfileRef function increments the count; calling the function CMCloseProfile 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.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when ColorSync 2.1 or later is present.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)