Important: The information in this document is obsolete and should not be used for new development.
MyCMMGetNamedColorIndex
Handles thekCMMGetNamedColorIndex
request by returning a named color index from a named color space profile for a specific color name.A CMM may respond to the
kCMMGetNamedColorIndex
request code, but it is not required to do so. Most CMMs can rely on the default Apple CMM to handle this request code adequately. The ColorSync Manager sends this request code to your CMM on behalf of an application or device driver that called the CMMGetNamedColorIndex function. The ColorSync Manager dispatches this request to the Component Manager, which calls your CMM to service the request. A CMM that handles thekCMMGetNamedColorIndex
request code typically responds by calling a CMM-defined function (for example, MyCMMGetNamedColorIndex).The MyCMMGetNamedColorIndex function is a color management module-defined subroutine.
pascal CMError MyCMMGetNamedColorIndex( ComponentInstance CMSession, CMProfileRef prof, StringPtr name, unsigned long *index)
CMSession
- A handle to your CMM's storage for the instance of your component associated with the calling application or device driver.
prof
- A profile reference (page 3-61) to a named color space profile.
name
- A pointer to a Pascal color name string that identifies the named color to return the index value for.
index
- A pointer to a value of type unsigned long. On output, it specifies the index value for the named color specified by
name
.- function result
- A result code of type CMError. See "Result Codes" (page 3-172) for a list of ColorSync-specific result codes.
DISCUSSION
Based on the passed color name, the MyCMMGetNamedColorIndex function does a lookup into the named color tag of the profile whose reference is passed in theprof
parameter and, if the name is found in the tag, returns the index. Otherwise, MyCMMGetNamedColorIndex returns an error code.