Initializes the ICC header with its default values.
#include "ltwrappr.h"
L_INT LICCProfile::InitHeader();
| Value | Meaning |
|---|---|
| SUCCESS | The function was successful. |
| < 1 | An error occurred. Refer to Return Codes. |
The header information is contained within the IccHeader member of the class object's ICCPROFILEEXT member structure. The class object should be initialized by calling LICCProfile::Initialize, before calling this function. This function initializes the IccHeader member of the class object's ICCPROFILEEXT member 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:
If this function is called after any of the functions listed above, the header fields will be re-initialized to their default values, and the individually set values will be lost.
LICCProfile::Initialize should be called before calling LICCProfile::InitHeader. If LICCProfile::Initialize is called after LICCProfile::InitHeader, the default values set by LICCProfile::InitHeader will be lost.
This example, initializes an ICC Profile, goes through all the steps of initializing and filling the fields of the header, creates some tags, generates an ICC profile pointer, saves it into an ICC file, and then frees the ICC Profile
L_INT LICCProfile_InitHeaderExample(){L_INT nRet = FAILURE;LICCProfile IccProfile;// Initialize the ICC ProfilenRet = IccProfile.Initialize ();if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Initialize the headernRet = IccProfile.InitHeader();if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the CMM type to zeronRet = IccProfile.SetCMMType (0);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the Device Class to Input ClassnRet = IccProfile.SetDeviceClass (InputClass);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the Color Space to RGBnRet = IccProfile.SetColorSpace (RgbData);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the PCS to XYZnRet = IccProfile.SetConnectionSpace (XyzData);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the primary platform to zeronRet = IccProfile.SetPrimaryPlatform (NoPlatformSignature);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the profile flags into not embedded, and independentnRet = IccProfile.SetFlags (ICC_EMBEDDED_PROFILE_FALSE|ICC_USE_ANYWHERE);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the device manufacturer signature to zeronRet = IccProfile.SetDevManufacturer (0);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the device model to 0nRet = IccProfile.SetDevModel (0);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the device attributes to be reflective, glossy, positive and colored medianRet = IccProfile.SetDeviceAttributes (ICC_REFLECTIVE|ICC_GLOSSY|ICC_MEDIA_POLARITY_POSITIVE|ICC_COLOR_MEDIA);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the profile rendering intentnRet = IccProfile.SetRenderingIntent (Perceptual);if (nRet != SUCCESS){IccProfile.Free ();return nRet;}// Set the profile creator to 0nRet = IccProfile.SetCreator (0);// Free the ICC ProfileIccProfile.Free ();return nRet;}