L_InitICCProfile

#include "ltkrn.h"
#include "ltclr.h"

L_LTCLR_API L_INT L_InitICCProfile(pICCProfile, uStructSize)

Initializes an ICCPROFILEEXT structure.

Parameters

pICCPROFILEEXT pICCProfile

Pointer to the ICCPROFILEEXT structure to initialize.

L_SIZE_T uStructSize

Value that indicates the size of the structure pointed to by pICCProfile. Pass sizeof(ICCPROFILEEXT).

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The parameter pICCProfile must be allocated before sending it to the function.

An ICCPROFILEEXT structure must be initialized before loading an ICC Profile. To initialize an ICCPROFILEEXT structure, call L_InitICCProfile with the uStructSize parameter set to sizeof(MEMICCPROFILEEXT).

This function should be called before calling L_InitICCHeader. If this function is called after L_InitICCHeader, the default values set by L_InitICCHeader will be lost.

When the ICCPROFILEEXT structure is no longer needed, be sure to free the memory allocated by calling L_FreeICCProfile.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example loads an ICC Profile from an Image, fill the ICC structure with it, and then saves the profile into another image.

L_INT InitICCProfileExample(pICCPROFILEEXT pIccProfile, 
                                            L_TCHAR      * pszImage1, 
                                            L_TCHAR      * pszImage2) 
{ 
   L_INT nRet; 
   UNREFERENCED_PARAMETER(pszImage1); 
   UNREFERENCED_PARAMETER(pszImage2); 
 
   // initializing the ICC profile 
   nRet = L_InitICCProfile (pIccProfile, sizeof(ICCPROFILEEXT));  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Load an ICC Profile that is embedded in an image 
   nRet = L_LoadICCProfile(pszImage1, pIccProfile, NULL); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Fill the ICCPROFILEEXT structure with the ICC data loaded from the image 
   nRet = L_FillICCProfileStructure(pIccProfile, pIccProfile->pData, pIccProfile->uDataSize); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Save the ICC Profile into another image 
   nRet = L_SaveICCProfile(pszImage2, pIccProfile, NULL); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   // finally free the ICC Profile 
   L_FreeICCProfile(pIccProfile); 
 
   return SUCCESS; 
   //return nRet; 
} 

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Color Conversion C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.