Gets a tag from the ICC profile.
#include "ltwrappr.h"
L_INT LICCProfile::GetTagData(pTagData, uTagSignature);
Pointer to a buffer to be updated with the tag data.
A value that indicates the signature of the tag to get from the ICC profile. For all possible values including the private tags, refer to ICCTAGSIGNATURE. Signatures of private tags must be registered with the ICC.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The pTagData pointer should point to a structure of the same type as the tag type to be retrieved by this function. In case of a private tag type, the pTagData must point to a structure of type ICCTAG_UNKNOWN_TYPE.
If only the tag is private, this function returns ERROR_ICC_UNKNOWN_TAG. If only the tag type is private, this function returns ERROR_ICC_UNKNOWN_TYPE. If both the tag and the type are private, this function returns ERROR_ICC_UNKNOWN_TAG_AND_TYPE. In all three of these cases however, the pTagData parameter is updated correctly with the tag in the ICC profile.
This example will load an ICC profile, get a tag, and then free the ICC profile
L_INT LICCProfile_GetTagDataExample(L_TCHAR* szFileName)
{
L_INT nRet = FAILURE;
LICCProfile IccProfile;
ICCTAG_DATE_TIME_TYPE IccDateTimeType;
// Initialize the ICC Profile
nRet = IccProfile.Initialize ();
if (nRet != SUCCESS)
{
IccProfile.Free ();
return nRet;
}
// Load an ICC Profile that is embedded in an image
nRet = IccProfile.Load (szFileName, NULL);
if (nRet != SUCCESS)
{
IccProfile.Free ();
return nRet;
}
// Fill the ICC Profile with the ICC data loaded from the image
nRet = IccProfile.Fill (IccProfile.GetProfile ()->pData, (L_UINT)(IccProfile.GetProfile()->uDataSize));
if (nRet != SUCCESS)
{
IccProfile.Free ();
return nRet;
}
// Get Calibration Date and Time tag
nRet = IccProfile.GetTagData ((L_UCHAR *)(&IccDateTimeType), CalibrationDateTimeTag);
// Free the ICC Profile
IccProfile.Free ();
return nRet;
}