#include "ltkrn.h"
#include "ltclr.h"
L_LTCLR_API L_INT L_InitICCHeader(pICCProfile)
pICCPROFILEEXT pICCProfile; |
pointer to a structure |
Initializes the ICC header with its default values.
Parameter |
Description |
pICCProfile |
Pointer to the ICCPROFILEEXT structure in which to initialize the header. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
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:
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.
Win32, x64.
Required DLLs and Libraries
LTCLR For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Platforms
Win32, x64.
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;
}