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 4 - ColorSync Manager Reference for Color Management Modules / Optional CMM-Defined Functions
/


MyCMMValidateProfile

Handles the kCMMValidateProfile request by determining if the specified profile contains the minimum set of elements required for a profile of its type.

A CMM should respond to the kCMMValidateProfile request code, but it is not required to do so. The ColorSync Manager sends this request code to your CMM on behalf of an application or device driver that called the CMValidateProfile function. The ColorSync Manager dispatches this request to the Component Manager, which calls your CMM to service the request. A CMM typically responds to the kCMMValidateProfile request code by calling a CMM-defined function (for example, MyCMMValidateProfile) to handle the request.

The MyCMMValidateProfile function is a color management module-defined subroutine.

pascal CMError MyCMMValidateProfile (
ComponentInstance CMSession,
CMProfileRef prof, 
Boolean *valid); 
CMSession
A handle to your CMM's storage for the instance of your component associated with the calling application or device driver.
prof
A reference to the profile to validate.
valid
A pointer to a flag whose value you set to true if the profile contains the elements required for a color-matching or color-checking session for a profile of this type and false if it doesn't.
function result
A result code of type CMError. See "Result Codes" (page 3-172) for a list of ColorSync-specific result codes.
DISCUSSION
Your MyCMMValidateProfile function should test the profile whose reference is passed in the prof parameter to determine if the profile contains the minimum set of elements required for a profile of its type. For each profile type, such as a device profile, there is a specific set of required tagged elements defined by the ICC that the profile must include.

The ICC also defines optional tags, which may be included in a profile. Your CMM might use these optional elements to optimize or improve its processing. Additionally, a profile might include private tags defined to provide your CMM with processing capability it uses. The profile developer can define these private tags, register the tag signatures with the ICC, and include the tags in a profile.

Your MyCMMValidateProfile function should check for the existence of the required minimum set of profile elements for a profile of this type and any optional or private tags required by your CMM.

Instead of itself checking the profile for the minimum profile elements requirements for the profile type, your MyCMMValidateProfile function may use the Component Manager functions to call the default Apple-supplied CMM and have it perform the minimum defaults requirements validation. The signature of the Apple-supplied CMM is 'appl'.

To call the Apple-supplied CMM when responding to a kCMMValidateProfile request from an application, your CMM can use the standard mechanisms used by applications to call another component. For information, see the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996