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
elementCountparameter of theCMCountProfileElementsfunction.elementSize- A pointer to an element data size. On input, specify the size of the element data to copy (except when
elementDatais set toNULL). SpecifyNULLto 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
elementSizeparameter without copying the element data to this buffer, specifyNULLfor 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 theCMGetIndProfileElementfunction 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
CMGetIndProfileElementInfofunction (page 3-91), passing the element's index- call the
CMGetIndProfileElementfunction itself, specifying a pointer to an unsigned long data type in theelementSizefield and aNULLvalue in theelementDatafield
NULLin theelementSizeparameter. If you want only a portion of the element data, you specify the number of bytes you want in theelementSizeparameter. You supply a pointer to the data buffer in theelementDataparameter. After callingCMGetIndProfileElement, theelementSizeparameter contains the size in bytes of the element data actually copied.SEE ALSO
Before calling this function, you should call theCMCountProfileElementsfunction (page 3-86). It returns the profile's total element count in theelementCountparameter.