Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging Reference /
Chapter 3 - ColorSync Manager Reference for Applications and Device Drivers / ColorSync Manager Functions
Accessing Profile Elements /


CMGetIndProfileElement

Obtains the element data corresponding to a particular index from the specified profile.

pascal CMError CMGetIndProfileElement (
CMProfileRef prof, 
unsigned long index, 
unsigned long *elementSize,
void *elementData);
prof
A profile reference (page 3-63) to the profile containing the element.
index
The index of the element whose data you want to obtain. This is a one-based element index within the range returned as the elementCount parameter of the CMCountProfileElements function.
elementSize
A pointer to an element data size. On input, specify the size of the element data to copy (except when elementData is set to NULL). Specify NULL to copy the entire element data. To obtain a portion of the element data, specify the number of bytes to be copy.
On output, the size of the element data actually copied.
elementData
A pointer to memory for element data. On input, you allocate memory. On output, this buffer holds the element data.
To obtain the element size in the elementSize parameter without copying the element data to this buffer, specify NULL for this parameter.
function result
A result code of type CMError. See "Result Codes" (page 3-174) for a list of ColorSync-specific result codes.
DISCUSSION
Before you call the CMGetIndProfileElement function to obtain the element data for an element at a specific index, you first determine the size in bytes of the element data. To determine the data size, you can

Once you have determined the size of the element data, you allocate a buffer to hold as much of the data as you need. If you want all of the element data, you specify NULL in the elementSize parameter. If you want only a portion of the element data, you specify the number of bytes you want in the elementSize parameter. You supply a pointer to the data buffer in the elementData parameter. After calling CMGetIndProfileElement, the elementSize parameter contains the size in bytes of the element data actually copied.

SEE ALSO
Before calling this function, you should call the CMCountProfileElements function (page 3-86). It returns the profile's total element count in the elementCount parameter.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996