L_InitICCHeader

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

L_LTCLR_API L_INT L_InitICCHeader(pICCProfile)

Initializes the ICC header with its default values.

Parameters

pICCPROFILEEXT pICCProfile

Pointer to the ICCPROFILEEXT structure in which to initialize the header.

Returns

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

Comments

The header information is contained within the IccHeader member of the ICCPROFILEEXT structure. The ICCPROFILEECT should be initialized, by calling L_InitICCProfile, before calling this function. This function initializes the IccHeader member of the ICCPROFILEEXT structure with its default values. It must be called before filling any of the header fields. Once the header fields have been initialized, they can be set using the following functions:

L_SetICCCMMType

L_SetICCColorSpace

L_SetICCConnectionSpace

L_SetICCCreator

L_SetICCDateTime

L_SetICCDeviceAttributes

L_SetICCDeviceClass

L_SetICCDevManufacturer

L_SetICCDevModel

L_SetICCFlags

L_SetICCPrimaryPlatform

L_SetICCRenderingIntent

If this function is called after any of the functions listed above have been called, the header fields will be reinitialized to their default values, and the individually set values will be lost.

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

Platforms

Win32, x64.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example, initializes an ICCPROFILEEXT structure, goes through all the steps of initializing and filling the fields of the header, creates some tags, generates ICC profile pointer, saves it into an ICC file, and then returns the ICCPROFILEEXT structure.

L_INT InitICCHeaderExample(pICCPROFILEEXT pIccProfile) 
{ 
   L_INT nRet; 
 
   // Initialize the header 
   nRet = L_InitICCHeader(pIccProfile);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the CMM type to zero 
   nRet = L_SetICCCMMType (pIccProfile, 0);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the Device Class to Input Class 
   nRet = L_SetICCDeviceClass (pIccProfile, InputClass);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the Color Space to RGB 
   nRet = L_SetICCColorSpace (pIccProfile, RgbData);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the PCS to XYZ 
   nRet = L_SetICCConnectionSpace (pIccProfile, XyzData);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the primary platform to zero 
   nRet = L_SetICCPrimaryPlatform (pIccProfile, NoPlatformSignature); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the profile flags into not embedded, and independent 
   nRet = L_SetICCFlags (pIccProfile, ICC_EMBEDDED_PROFILE_FALSE | ICC_USE_ANYWHERE);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the device manufacturer signature to zero 
   nRet = L_SetICCDevManufacturer (pIccProfile, 0);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the device model to 0 
   nRet = L_SetICCDevModel (pIccProfile, 0);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the device attributes to be reflective, glossy, positive and colored media 
   nRet = L_SetICCDeviceAttributes(pIccProfile, ICC_REFLECTIVE | ICC_GLOSSY | ICC_MEDIA_POLARITY_POSITIVE | ICC_COLOR_MEDIA); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the profile rendering intent 
   nRet = L_SetICCRenderingIntent (pIccProfile, Perceptual);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Set the profile creator to 0 
   nRet = L_SetICCCreator (pIccProfile, 0);  
 
   return SUCCESS; 
} 

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

LEADTOOLS Color Conversion C API Help