Converts the information of an ICCTAG_CURVE_TYPE structure into one buffer of sequential bytes.
#include "l_bitmap.h"
L_LTCLR_API L_INT L_ConvertCurveTypeToBuffer(pData, pIccTagCurveType)
Pointer to a buffer to be updated with the converted information as one buffer of sequential bytes.
Pointer to an ICCTAG_CURVE_TYPE structure that contains the information to be converted into one buffer of sequential data.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The pData pointer must be allocated by the user. Its size must be equal to the size in bytes of the structure pointed to by the pIccTagCurveType parameter.
The size of the pData buffer can be calculated as follows: 4 + 4 + 4 + 2 * pIccTagCurveType.Curve.uCurveCount. For more information, refer to the ICC.1:2004-10 specification page 39 in the (https://www.color.org/index.xalter) website.
Win32, x64.
This example converts a ICCTAG_CURVE_TYPE structure into a buffer.
L_UCHAR* ConvertCurveTypeToBufferExample(pICCTAG_CURVE_TYPE pIccCurveType, L_INT* pnRet)
{
L_UCHAR * pData;
L_INT nDataSize;
// calculate the data size
nDataSize = 4 + 4 + 4 + 2 * pIccCurveType->Curve.uCurveCount;
// then allocate the destination data pointer
pData = (L_UCHAR *) calloc(nDataSize, sizeof(L_UCHAR));
if (pData == NULL)
{
*pnRet = ERROR_NO_MEMORY;
return NULL;
}
// now convert it into buffer
*pnRet = L_ConvertCurveTypeToBuffer(pData, pIccCurveType);
if(*pnRet != SUCCESS)
return NULL;
return pData;
}