LICCProfile::SetTagData

#include "ltwrappr.h"

L_INT LICCProfile::SetTagData(pTagData, uTagSig, uTagTypeSig);

L_UCHAR * pTagData;

pointer to a buffer

L_UINT uTagSig;

tag signature

L_UINT uTagTypeSig;

tag type signature

Sets a tag inside the ICC profile.

Parameter

Description

pTagData

Pointer to a buffer that contains the tag data.

uTagSig

A value that represents the signature of the tag to be created. For all possible values including the private tags, refer to ICCTAGSIGNATURE. Signatures of private tags must be registered with the ICC.

uTagTypeSig

A value that represents the signature of the tag type used for creating the tag. For all possible values including the private tag type signatures, refer to ICCTAGTYPESIGNATURE. Signatures of private tag types must be registered with the ICC.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The pTagData pointer should be a pointer to a structure that contains all the data required for the tag to be created.

This structure should be of the same type as the ICC tag type required for the tag to be created. 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 tag is set correctly in the ICC profile.

To add multiple tags to a profile, call this function repeatedly. Each subsequent tag added is appended to the list of tags pointed to by the pTagData member of the class object's ICCPROFILEEXT member structure.

Required DLLs and Libraries

LTCLR

LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LICCProfile::Free, LICCProfile::Initialize, LICCProfile::Load, LICCProfile::Save, LICCProfile::Fill, LICCProfile::InitHeader, LICCProfile::SetCMMType, LICCProfile::SetDeviceClass, LICCProfile::SetColorSpace, LICCProfile::SetConnectionSpace, LICCProfile::SetPrimaryPlatform, LICCProfile::SetFlags, LICCProfile::SetDevManufacturer, LICCProfile::SetDevModel, LICCProfile::SetDeviceAttributes, LICCProfile::SetRenderingIntent, LICCProfile::SetCreator, LICCProfile::SetDateTime, LICCProfile::Convert2bFixed2bNumberToDouble, LICCProfile::ConvertDoubleTo2bFixed2bNumber, LICCProfile::GetTagData, LICCProfile::CreateTagData, LICCProfile::DeleteTag, LICCProfile::GenerateFile, LICCProfile::GeneratePointer, LICCProfile::GetTagTypeSig, LICCProfile::FreeTagType, Class Members

Topics:

Using ICC Profile Functions

 

ICC Profile Functions: Tags

Example

This example will create an ICC profile, and then create a tag, and then set it into the ICC profile, finally, it will free the profile

L_INT LICCProfile_SetTagDataExample(L_TCHAR* szFileName) 
{ 
   L_INT nRet = FAILURE; 
   LICCProfile IccProfile; 
   SYSTEMTIME SystemTime; 
   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; 
   } 
   GetSystemTime(&SystemTime); 
   IccDateTimeType.DateTime.uYear = SystemTime.wYear; 
   IccDateTimeType.DateTime.uMonth = SystemTime.wMonth; 
   IccDateTimeType.DateTime.uDay = SystemTime.wDay; 
   IccDateTimeType.DateTime.uHours = SystemTime.wHour; 
   IccDateTimeType.DateTime.uMinutes = SystemTime.wMinute; 
   IccDateTimeType.DateTime.uSeconds = SystemTime.wSecond; 
   // setting the tag inside the ICC profile 
   nRet = IccProfile.SetTagData ((L_UCHAR  *)(&IccDateTimeType), CalibrationDateTimeTag, DateTimeTypeSig); 
   // Free the ICC Profile 
   IccProfile.Free (); 
   return nRet; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Color Conversion C++ Class Library Help