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


Handles the kCMMConcatInit request by initializing any private data the CMM will need for a color session involving the specified set of profiles.

A CMM should respond to the kCMMConcatInit 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 CWConcatColorWorld 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 kCMMConcatInit request code by calling a CMM-defined function (for example, MyCMConcatInit) to handle the request.

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

pascal CMError MyCMConcatInit (
ComponentInstance CMSession,
CMConcatProfileSet *profileSet); 
A handle to your CMM's storage for the instance of your component associated with the calling application or device driver.
A pointer to an array of profiles (page 3-46) to use in a color-matching or color-checking session. The profiles in the array are in processing order--source through destination. The profileSet field of the data structure contains the array. For a description of the CMConcatProfileSet data structure, see "Concatenated Profile Set Structure" (page 3-46).
function result
A result code of type CMError. See "Result Codes" (page 3-172) for a list of ColorSync-specific result codes.
Using the private storage pointed to by the CMSession handle, your MyCMConcatInit function should initialize any private data your CMM will need for a color session involving the set of profiles specified by the profile array pointed to by the profileSet parameter. Your function should also initialize any additional private data needed in handling subsequent calls pertaining to this component instance.

A color-matching or color-checking session for a set of profiles entails various color transformations among devices in a sequence for which your CMM is responsible. Your function must obtain required information from the profiles and initialize private data for subsequent color-matching or color-checking sessions with these values. After your function returns to the Component Manager, it no longer has access to the profiles.

This request gives you the opportunity to examine the profile contents before storing them. If you do not support some aspect of the profile, then you should return an unimplemented error in response to this request. For example, if your CMM does not implement multichannel color support, you should return an unimplemented error at this point.

When your CMM uses a device-linked profile or a set of concatenated profiles, you must adhere to the following guidelines and rules:

For specific guidelines on handling device-linked profiles and additional information on handling concatenated profiles, see "ColorSync Manager Reference for Applications and Device Drivers" (page 3-7).

The Component Manager calls your CMM with a standard open request to open the CMM when a ColorSync-supportive application or device driver requests that the Component Manager open a connection to your component. At this time, your component should allocate any memory it needs to maintain a connection for the requesting application or driver. You should attempt to allocate memory from the current heap zone. If that attempt fails, you should allocate memory from the system heap or the temporary heap. You can use the SetComponentInstanceStorage function to associate the allocated memory with the component instance. Whenever the calling application or driver requests services from your component, the Component Manager supplies you with the handle to this memory in the session parameter. For complete details on the SetComponentInstanceStorage function, see the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox.

The Component Manager may call your CMM with the kCMMConcatInit request code multiple times after it calls your CMM with a request to open the CMM. For example, it may call your CMM with an initialization request once with one pair of profiles and then again with another pair of profiles. For each call, you need to reinitialize the storage based on the content of the current profiles.

Your CMM should support all seven classes of profiles defined by the ICC. For information on the seven classes of profiles, see "Profile Classes" (page 3-13).

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996