Important: The information in this document is obsolete and should not be used for new development.
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 theCMCountProfileElements
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 toNULL
). SpecifyNULL
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, specifyNULL
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 theCMGetIndProfileElement
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
- call the
CMGetIndProfileElementInfo
function (page 3-91), passing the element's index- call the
CMGetIndProfileElement
function itself, specifying a pointer to an unsigned long data type in theelementSize
field and aNULL
value in theelementData
field
NULL
in theelementSize
parameter. If you want only a portion of the element data, you specify the number of bytes you want in theelementSize
parameter. You supply a pointer to the data buffer in theelementData
parameter. After callingCMGetIndProfileElement
, theelementSize
parameter contains the size in bytes of the element data actually copied.SEE ALSO
Before calling this function, you should call theCMCountProfileElements
function (page 3-86). It returns the profile's total element count in theelementCount
parameter.