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
/


MyCMMGetNamedColorName

Handles the kCMMGetNamedColorName request by returning a named color name from a named color space profile for a specific named color index.

A CMM may respond to the kCMMGetNamedColorName 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 CMMGetNamedColorName function. The ColorSync Manager dispatches this request to the Component Manager, which calls your CMM to service the request. A CMM that handles the kCMMGetNamedColorName request code typically responds by calling a CMM-defined function (for example, MyCMMGetNamedColorName).

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

pascal CMError MyCMMGetNamedColorName(
ComponentInstance CMSession,
CMProfileRef prof,
unsigned long index,
StringPtr name)
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 to a named color space profile.
index
An index value for a named color.
name
A pointer to a Pascal color name string. On output, it identifies the named color specified by index.
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 index, the MyCMMGetNamedColorName function does a lookup into the named color tag of the profile whose reference is passed in the prof parameter and returns the name. If the index is greater than the number of named colors, MyCMMGetNamedColorName returns an error code.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996