![]() |
CMGetProfileElement |
||||
Header: | CMApplication.h | Carbon status: | Supported | |
Obtains element data from the specified profile based on the specified element tag signature.
CMError CMGetProfileElement ( CMProfileRef prof, OSType tag, UInt32 *elementSize, void *elementData );
A profile reference of type CMProfileRef to the profile containing the target element.
The tag signature (for example, ‘A2B0, or constant cmAToB0Tag) for the element in question. The tag identifies the element. For a complete list of the public tag signatures a profile may contain, including a description of each tag, refer to the International Color Consortium Profile Format Specification. The signatures for profile tags are defined in the CMICCProfile.h header file.
A pointer to a size value. On input, you specify the size of the element data to copy. Specify NULL to copy the entire element data. To obtain a portion of the element data, specify the number of bytes to copy.
On return, the size of the data returned.
A pointer to memory for element data. On input, you allocate memory. On return, 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.
Before you call the CMGetProfileElement function to obtain the element data for a specific element, you must know the size in bytes of the element data so you can allocate a buffer to hold the returned data.
The CMGetProfileElement function serves two purposes: to get an elements size and to obtain an elements data. In both instances, you provide a reference to the profile containing the element in the prof parameter and the tag signature of the element in the tag parameter.
To obtain the element data size, call the CMGetProfileElement function specifying a pointer to an unsigned long data type in the elementSize field and a NULL value in the elementData field.
After you obtain the element size, you should allocate a buffer large enough to hold the returned element data, then call the CMGetProfileElement function again, specifying NULL in the elementSize parameter to copy the entire element data and a pointer to the data buffer in the elementData parameter.
To copy only a portion of the element data beginning from the first byte, allocate a buffer the size of the number of bytes of element data you want to obtain and specify the number of bytes to copy in the elementSize parameter. In this case, On return the elementSize parameter contains the size in bytes of the element data actually returned.
You cannot use the CMGetProfileElement function to copy a portion of element data beginning from an offset into the data. To copy a portion of the element data beginning from any offset, use the function CMGetPartialProfileElement.
You cannot use this function to obtain a portion of the CM2Header profile header. Instead, you must call the function CMGetProfileHeader to copy the entire profile header and read its contents.
Supported in Carbon. Available in Carbon 1.0.2 and later when ColorSync 2.0 or later is present.
© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)