kCMMConcatInitrequest 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
kCMMConcatInitrequest 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
CWConcatColorWorldfunction. The ColorSync Manager dispatches this request to the Component Manager, which calls your CMM to service the request. A CMM typically responds to the
kCMMConcatInitrequest 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
profileSetfield of the data structure contains the array. For a description of the
CMConcatProfileSetdata 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.
DISCUSSIONUsing the private storage pointed to by the
MyCMConcatInitfunction 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
profileSetparameter. 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).
- You should use the quality flag setting--indicating normal mode, draft mode, or best mode--specified by the first profile for the entire color-matching session; you should ignore the quality flags of following profiles in the sequence. The profile header
flagfield holds the quality flag setting. Your CMM may choose to ignore the quality flag. This is allowed, but not recommended unless you support best mode by default.
- You must use the rendering intent specified by the first profile to color match to the second profile, the rendering intent specified by the second profile to color match to the third profile, and so on through the series of concatenated profiles.
- If the calling application or driver passed a color space profile in the middle of the profile sequence, the Apple-supplied CMM ignores this profile. Your CMM should also ignore it.
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
SetComponentInstanceStoragefunction 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
sessionparameter. For complete details on the
SetComponentInstanceStoragefunction, see the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox.
The Component Manager may call your CMM with the
kCMMConcatInitrequest 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).