Creates an ICC tag.
#include "ltkrn.h"
#include "ltclr.h"
L_LTCLR_API L_INT L_CreateICCTagData(pDestTagData, pSrcTagData, uTagTypeSig)
A pointer to a buffer to be updated with the newly created tag.
A pointer to a buffer that contains the original tag data.
A value that indicates the signature of the tag type to be created. Possible values include private tag types and the values listed in ICCTAGTYPESIGNATURE.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function does not insert a tag into the ICC profile. It only creates a tag and updates the pDestTagData parameter with a pointer to the newly created tag. This is cast to the desired tag type.
This function converts the original source data, which is in little Endian format, into the ICC profile format, which is in big Endian format.
Before exiting the program, call L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters to free the contents of the allocated pDestTagData. In addition, the user should free the pDestTagData pointer itself, since the user allocated it.
Win32, x64.
This function creates an ICC tag type (dateTimeType) and returns it.
L_INT CreateICCTagDataExample(pICCTAG_DATE_TIME_TYPE pIccDstDateTimeType)
{
SYSTEMTIME systemTime;
ICCTAG_DATE_TIME_TYPE iccSrcDateTimeType;
// Preparing the structure
GetSystemTime(&systemTime);
iccSrcDateTimeType.DateTime.uYear = systemTime.wYear;
iccSrcDateTimeType.DateTime.uMonth = systemTime.wMonth;
iccSrcDateTimeType.DateTime.uDay = systemTime.wDay;
iccSrcDateTimeType.DateTime.uHours = systemTime.wHour;
iccSrcDateTimeType.DateTime.uMinutes = systemTime.wMinute;
iccSrcDateTimeType.DateTime.uSeconds = systemTime.wSecond;
// Creating tag type data
return L_CreateICCTagData((L_UCHAR *) pIccDstDateTimeType, (L_UCHAR *) &iccSrcDateTimeType, DateTimeTypeSig);
}