![]() |
CMCheckColors |
||||
Header: | CMMComponent.h | Carbon status: | Unsupported | |
Handles the kCMMCheckColors request by checking the specified colors against the gamut of the destination profile.
CMCheckColors ();
A CMM must respond to the kCMMCheckColors request code. The ColorSync Manager sends this request code to your CMM on behalf of an application or device driver that called the CWCheckColors 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 kCMMCheckColors request code by calling a CMM-defined function (for example, CMCheckColors) to handle the request.
When your CMM receives a kCMMCheckColors request code, your CMM should test the given list of colors against the gamut specified by the destination profile to report if the colors fall within a destination devices color gamut. Before the Component Manager calls your CMM with a ColorSync request to gamut check colors, it calls your CMM with a kNCMMInit, kCMMInit, or kCMMConcatInit request passing your CMM references to the profiles to use for the color-checking session and requesting your CMM to initialize the session.
If the Component Manager calls your CMM with a ColorSync kNCMMInit or kCMMInit request, it passes references to the source and destination profiles to use for the color-checking session. (If it calls your CMM with the ColorSync kCMMConcatInit request, it passes a pointer to an array of type ConcatProfileSet containing a set of profiles or a device link profile specified by the calling program to use for the color-checking session.)
When the Component Manager calls your CMM with the kCMMCheckColors request code, it passes to your CMM in the CMSession parameter a handle to your CMMs storage for the calling applications or device drivers component instance. This is the storage whose data you initialized when the Component Manager called you to initialize the session for this component instance.
Using the profile data set in your storage for this component instance, your CMCheckColors function should check the colors specified in the myColors array against the color gamut of the destination profile. Your function should use the result array to return indication of whether the colors in the list are in or out of gamut for the destination device. If you used some other method to store profile data for this component instance when you initialized the session, you should obtain the profile data you require for the color matching from that storage. The color list may contain multichannel color data types, so your CMM must support them. If your CMM does not support these color data types, you should return an unimplemented error in response to the initialization request code. See the functions NCMInit and CMConcatInit for more information.
For each color in the list, your CMCheckColors function should set the corresponding bit in the result bit array if the color is out of gamut for the destination device as specified by the destination profile. The leftmost bit in the field corresponds to the first color in the list.
The gamut test your function performs provides a preview of color matching. The ColorSync Manager returns the results to the calling application or device driver.
Use CWCheckColors instead. CMCheckColors is an API to CMMs -- Component Manager structures that Mac OS X does not support. In Carbon, CMMs are replced by opaque structures of type CFBundle.
© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)