Introduction

Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits.

Introduction

LEADTOOLS Color Conversion Color Space features can convert images from any color resolution to any other color resolution. Whether you are working with medical images, scanned documents or digital photographs, LEADTOOLS can help you provide the correct color depth for the hardware your clients are using, from 1-bit to 64-bit,*** with multiple dithering methods using various palette options. These functions are included with LEADTOOLS Raster, Vector, Medical, and Document Imaging products.

Key Features:

  • Expose up to 8 different dithering methods in your application, including: Floyd Stein, Burkes, Ordered dithering, Stucki, Stephens, Sierra and Jarvis.

  • Use flexible palette options, including LEAD's fixed palette, an auto-optimized palette, or a user defined palette.

  • Apply palettes to a single image, or to an entire list of images.

  • Images can be converted, separated to and reconstructed from individual RGB, CMYK, CMY, HSV, HSL, YUV*, YIQ*, CIELAB*, XYZ*, YCCK*, Y41P*, UYVY*, YUY2*, YVU9* and YCC* color planes using LEAD's built in conversion functions, ICC color profiles* or Emulation Tables*.

  • When working with 12*** and 16*** bit grayscale images, LEADTOOLS' window leveling** allows you to select the desired range of bits to be used for display or processing.

* | Included only in LEADTOOLS Raster Imaging Pro, Document Imaging products and Medical Imaging products.
** | Included only in Medical Imaging products.
*** | Included only in Document Imaging Products and Medical Imaging products.

  • The Color Conversion SDK supports the following conversions:

Source Color Space | Can be converted to | Conversion method | Recommended
RGB | Any other color space. | Built-in, ICC profiles, or emulation tables, depending on the destination color space. |
BGR | Any other color space. | Built-in, ICC profiles, or emulation tables, depending on the destination color conversion. |
YUV | Any other color space. | Built in. |
CMYK | Any other color space. | 1.Emulation Tables (one way CMYK => RGB) 2.ICC Profiles. 3.Built in. | The best conversion is through the ICC Profiles (USE_ICC), this is because of the nature of the CMYK conversion, which is machine-dependant. You can use profiles that vary in the degree of black color (ink) generation.
HSV | Any other color space. | Built in. |
HSL | Any other color space. | Built in. |
YIQ | Any other color space. | Built in. |
CMYK | Any other color space. | 1.Built in. 2.ICC Profiles |
LAB | Any other color space. | 1. Emulation Tables (one way CMYK => RGB). 2. ICC Profiles. 3. Built in. | For two-way conversion, RGB to LAB and vice versa, the best solution is with emulation tables and Built in conversions, because the colors are preserved better. However for one way you can use ICC profiles.
XYZ | Any other color space. | Built in. |
YCCK | Any other color space. | Built in. |
Y41P | Any other color space. | Built in. |
UYVY | Any other color space. | Built in. |
YUY2 | Any other color space. | Built in. |
YVU9 | Any other color space. | Built in. |
YCC | Any other color space. | Built in. |

Supported Environments

The toolkit comes in Win32 and x64 editions that can support development of software applications for any of the following environments:

Windows Vista

Windows XP

Windows 2000

For more information, refer to:

Programming with LEADTOOLS Color Space Conversion

Tutorials

Demo Programs

Palettes and Manipulating Palettes

Dithering and Supported Dithering Methods

Additional LEADTOOLS Image Processing functionality

Demos | Sample Programs | Unlocking Features | Install Directory | Redistributables | Documentation | Support | Licensing

© Copyright LEAD Technologies, Inc. 1991-2009. ALL RIGHTS RESERVED


Version History

Version History

Current version: | 16.5.0.0
Last update: | June 8, 2009

Changes from Version 16 to Version 16.5

Changes from Version 15 to Version 16

Changes from Version 14.5 to Version 15

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Version 13


Changes from Version 16 to Version 16.5

Version 16.5 of this C DLL has not changed from version 16.

For more information, refer to:

http://www.leadtools.com/Home2/general/new-in-v16_5.htm


Changes from Version 15 to Version 16

Version 16 of the LEADTOOLS Color Conversion C DLL has not changed from version 15.

For more information, refer to:

http://www.leadtools.com/Home2/general/new-in-v16.htm


Changes from Version 14.5 to Version 15

Changes from Version 14.5 to Version 15

Version 15 of the Color Conversion C DLL changed from version 14.5 as follows:

  • LEADTOOLS now supports both ANSI and UNICODE development in the same libraries.

  • LEADTOOLS now supports development for x64 platforms.

  • LEADTOOLS has added signed image support to 50 functions. Over half of all LEADTOOLS image functions now support both signed and unsigned images.

  • LEADTOOLS now supports the Microsoft HD Photo file format (HDP).

  • LEADTOOLS has added support for reading TIFF images with ZIP compression.

Changed or removed structures and functions:

The following functions have been renamed:

L_FreeICCProfileExt renamed to L_FreeICCProfile

L_InitICCProfileExt renamed to L_InitICCProfile

L_LoadICCProfileExt renamed to L_LoadICCProfile

The following functions have been removed:

New Structures:

ICC_CLUT16

ICC_CLUT8

New Functions:

L_ConvertCLUTToBuffer

L_ConvertCurveTypeToBuffer

L_ConvertParametricCurveTypeToBuffer

L_CreateGrayScaleBitmap

L_DoubleToU8Fixed8Number

L_GetParametricCurveNumberOfParameters

L_SetICCProfileId

L_U8Fixed8NumberToDouble

For more information, refer to:

http://www.leadtools.com/Home2/general/new-in-v15.htm


Changes from Version 14 to Version 14.5

Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS Color Conversion C DLL changed from Version 14 as follows:

  • LEADTOOLS supports CMYK functions, which handle CMYK TIFF Files as separate bitmaps.

  • New functionality handles compact TIFF files, enumerates all the tags in TIFF and Exif files, and deletes tags from TIFF and Exif files.

  • LEADTOOLS has added new functionality to create a new region, or update an existing region, based on either an HSV range or an RGB range.

  • When saving a JBIG2 file, you can get or change the current values for the control options used by LEADTOOLS.

  • LEADTOOLS provides functionality for compressing and decompressing ABIC images in buffers.

  • LEADTOOLS now supports the following new file formats:

File Formats: ABC Format (ABC)

File Formats: ABIC Format (ABIC, ICA)

File Formats: JBIG2 Format (JB2)

New structures:

ICCPROFILEEXT

ICCHEADER

ICCTAG

ICCTAG_LIST

ICC_DATE_TIME_NUMBER

ICC_XYZ_NUMBER

ICCCOLORSPACE

ICCPROFILECLASS

ICCPLATFORMSIGNATURE

ICCRENDERINGINTENT

ICCTAGSIGNATURE

For more information, refer to:

http://www.leadtools.com/Home2/press/14.5press.htm


Changes from Version 13 to Version 14

Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS Color Conversion C DLL changed from Version 13 as follows:

  • LEADTOOLS now supports UNICODE.

Changed Structures:

  • CONVERSION_PARAMS takes 2 new members.

Changed Functions:

  • L_ClrConvertToBitmap takes 1 new parameter.

  • L_ClrConvertDirectToBitmap takes 1 new parameter.

For more information, refer to:

http://www.leadtools.com/Home2/press/14press.htm


Version 13

Version 13

Version 13 is the first version of LEADTOOLS Color Conversion C DLL.

The rest of this topic lists the new functions in this toolkit.

L_ClrConvert

L_ClrConvertDirect

L_ClrConvertDirectToBitmap

L_ClrConvertToBitmap

L_ClrDlg

L_ClrFree

L_ClrInit

L_ClrIsValid

L_ClrSetConversionParams


Programming with LEADTOOLS Color Space Functions

Programming with LEADTOOLS Color Conversion Functions

LEADTOOLS provides functions for converting between color-spaces using different methods and options. The toolkit supports conversions among RGB, BGR, YUV, CMYK, HSV, HLS, YIQ, CMY, LAB, YCCK, Y41P, UYVY, YUY2, YVU9, and YCC color spaces.

LEADTOOLS Color Conversion provides two methods to accomplish conversion:

  • Direct Conversion.

  • Indirect Conversion.

Direct Conversion

This process doesn't require any initialization code. L_ClrConvertDirect can be called to convert directly between two color spaces. This function uses built-in equations and options and is the same as using the second methods with USE_BUILTIN.

L_ClrConvertDirectToBitmap can also be used to convert directly, however this function will return a LEAD BITMAPHANDLE representation of the destination buffer. This function is valid for conversions from any color space to RGB or BGR.

Indirect Conversion

To begin using the available indirect conversion feature in the LEADTOOLS Color Conversion toolkit, the user should declare an instance of CONVERSION_PARAMS structure; then fill it depending on the conversion process options. The user may optionally utilize emulation tables. For more information, refer to Emulation Tables.

Next, the user should initialize a color conversion handle. For more information refer to Initializing a Color Conversion Handle.

After the user has established a Color Conversion handle, he or she is ready to convert image data from a specific one-color conversion model to another. For more information, refer to Conversion Process.

When the handle to the Color Conversion is no longer needed, it should be freed. For more information, refer to Freeing the Color Conversion Handle.

The user can also initiate a conversion visually with L_ClrDlg, which brings up a color space option dialog. Based on the option set in that dialog, a color handle will be returned and/or the option specified in the dialog packed in CONVERSION_PARAMS instance.

For more information, refer to:

Initializing a Color Conversion Handle

Start Conversion

Alignment Parameters

Freeing the Color Conversion Handle

Using ICC Profile Functions


Demo Programs

Demo Programs

The following demo programs are in separate EXAMPLES subdirectories (such as C:\LEAD Technologies\LEADTOOLS 1X\Examples\CDLL, , where "1X" indicates the version you installed). The executable files for these examples were compiled with Document/Medical capabilities. To get Document/Medica l capabilities, you must buy a LEADTOOLS Document/Medical toolkit. Otherwise, if you recompile the examples, the resulting executable files will not have the Document/Medical capabilities.

  • ColorConversion_Original.exe: Uses pull-down menus to demonstrate most LEADTOOLS Color Conversion features in one application.

  • ColorConversion: Loads and displays the image file specified on the command line, then uses the L_ConvertColorSpace function to convert from RGB to YUV, CMYK, and other formats, redisplaying the image after all color conversions are complete.


Initializing a Color Conversion Handle

Initializing a Color Conversion Handle

To begin using the LEADTOOLS Color Conversion toolkit, initialize a color conversion handle. To do this, call the L_ClrInit function. Each call to the L_ClrInit function will create a color conversion handle of type L_HANDLE. This handle is passed to many of the LEADTOOLS Color Conversion C DLL functions, so this function must be called before calling many functions in case of indirect conversion.

Another way to initialize a color conversion handle is by calling L_ClrDlg, which brings up a color space option dialog. Based on the option set in that dialog, a color handle will be returned and/or the option specified in the dialog packed in CONVERSION_PARAMS instance.

To check the validity of the created color conversion handle call the L_ClrIsValid function.

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Conversion Process

Start Conversion

After the user has established a color conversion handle and set the conversion process options, he or she can start converting with the L_ClrConvert or L_ClrConvertToBitmap functions.

L_ClrConvert can be called many times for the same color conversion handle, with the possibility of adjusting the conversion options using the L_ClrSetConversionParams function.

To align the input and output buffers, refer to Alignment parameters

For information on YUV Conversion, refer to Generic YUV Conversion.

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Alignment Parameters

Alignment parameters

The conversion functions L_ClrConvert, and L_ClrConvertDirect, take two alignment parameters, one for the input buffer, and the other one for the output buffer. Non-zero values for these parameters indicate that the input and output buffer's scanlines (rows of pixels) are padded with extra non-image bytes so that the total number of bytes in each scanline is a multiple of nInAlign (input buffer) or nOutAlign (output buffer).

For example, consider having a 3 column x 1 row CMY image buffer (9 bytes total) to be converted to RGB:

If the input buffer is not aligned and you need the output buffer to be aligned by 4 bytes (a memory need), call L_ClrConvert or L_ClrConvertDirect with:

nInAlign = 0
nOutAlign = 4

If the above 3 column x 1 row CMY input buffer is 4-bytes aligned (12 bytes total), and the output buffer is not to be aligned call L_ClrConvert or L_ClrConvertDirect with:

nInAlign = 4
nOutAlign = 0

If the above 3 column x 1 row CMY input buffer is 4-bytes aligned (12 bytes total), and the output buffer needs to be 4-bytes aligned, call L_ClrConvert or L_ClrConvertDirect with:

nInAlign = 4
nOutAlign = 4

Any other combination may be used for any supported color conversions. In any case the user should allocate enough memory for the actual pixels and the additional alignment bytes if any.

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Freeing the Color Conversion Handle

Freeing the Color Conversion Handle

When the Color Conversion handle is no longer needed, the user must free the handle by calling the L_ClrFree function. At this point the Color Conversion handle becomes invalid. Before starting another conversion process, the user must establish a new Color Conversion handle by calling the L_ClrInit function.

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Multi-Step Conversions

Multi-step Conversion

In some cases, to achieve better quality, it is recommended to divide the conversion into two steps. For example, if the conversion from CMYK to Lab is needed, first convert from CMYK to RGB, then convert from RGB to Lab. This lets you use other methods for the conversion like the ICC profiles or the emulation tables, which give better results. In addition to this, each color space can be converted to itself. This is sometimes needed for aligning or copying a buffer.

There is also the USE_AUTO method, which guarantees the best conversion algorithm.

Conversions from one color space to the same is supported with both built-in and custom ICC options. The built-in conversion will perform a copy, while the custom ICC depends on the input profiles. For example, a conversion from CIELab with D50 white point to CIELab with D65 white point can be done with D50-CIELab as input profile and D65-CIELab as output profile.

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Converting Large Images

Converting Large Images

When using the toolkit to convert a large image, you will obtain better performance if you convert a large number of pixels with each function call. In the following examples, a single call to L_ColorConvertDirectprocesses either the entire image, or an entire scan line:

For the entire image, use:

L_ColorConvertDirect(CCS_CMYK, CCS_RGB, pIn, pOut, 640, 480, 0, 0);

or, for an entire scan line, use:

for (int k=0; k<480; k++)

L_ColorConvertDirect(CCS_CMYK, CCS_RGB, pIn, pOut, 640, 1, 0, 0);

but do not use:

for (int k=0; k<480; k++)

for (int k=0; k<640; k++)

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


YUV Conversions

YUV Conversions

In addition to YUV support and other commonly used YUV formats (YUY2, UYVY, Y41P, and YVU9), the toolkit supports generic YUV to RGB conversion. This enables you to first define YUV formats using the YUV_PARAMS structure, then use L_ClrConvert to do the conversion.

For more information, refer to:

Generic YUV Conversion

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Using ICC Profile Functions

Using ICC Profile Functions

The ICC Profile format is defined by the International Color Consortium (ICC). For background on the origination and purpose of this format, refer to www.color.org.

Creating an ICC Profile

To create an ICC profile, start by calling L_InitICCProfile to initialize an ICC profile structure (ICCPROFILEEXT). This must be called before creating a new profile or loading an existing profile. Within the ICCPROFILEEXT structure is an ICCHEADER structure that contains header information for the profile. Once the ICCPROFILEEXT structure has been initialized, the header must be initialized by calling L_InitICCHeader. This sets the members of the ICCHEADER structure to their default values. The following functions can be used to change the ICCHEADER values from default values to custom values:

L_SetICCCMMType

L_SetICCColorSpace

L_SetICCConnectionSpace

L_SetICCCreator

L_SetICCDateTime

L_SetICCDeviceAttributes

L_SetICCDeviceClass

L_SetICCDevManufacturer

L_SetICCDevModel

L_SetICCFlags

L_SetICCPrimaryPlatform

L_SetICCRenderingIntent

L_SetICCProfileId

Tags

The ICC Profile can also include tags. Tags can be inserted in an ICC profile, created but not inserted, or deleted. To insert a tag in an ICC profile, do the following:

  • Define a structure of the same "type" as the tag to be created.

  • Fill the structure with the required data.

  • Call the L_SetICCTagData function to insert the tag into the ICC profile.

To create a tag without inserting it into an ICC profile, call L_CreateICCTagData. When that tag is no longer needed, free it by calling L_FreeICCTagType.

At anytime the user can get a tag from an ICC profile by calling the L_GetICCTagData function. The user can delete a tag by calling the L_DeleteICCTag function.

Tags are of various types. These types have a signature associated with them to identify them. Tags also have signatures associated with them. One or both of these signatures may be used when creating, inserting or deleting tags. To get the signature of a specific tag type, call the L_GetICCTagTypeSig function. For more information on tags, types and signatures, please refer to the documentation available through www.color.org.

When working with ICC profiles, it may be necessary to convert values from one form to another. Variables of the type L_IccS15Fixed16Number, or L_IccU16Fixed16Number require data in a 2 bytes fixed, 2 bytes number form. The L_DoubleTo2bFixed2bNumber function converts a double value into a 2 bytes fixed, 2 bytes number form, allowing the user to set these variables. The L_2bFixed2bNumberToDouble function converts a 2 bytes fixed, 2 bytes number value into a double value, allowing the user to get data from these variables.

Similarly, the type L_IccU8Fixed8Number requires data in a 1 byte fixed, 1 byte number form. The L_DoubleToU8Fixed8Number function converts a double value into a 1 byte fixed, 1 byte number form. The L_U8Fixed8NumberToDouble function converts a 1 byte fixed, 1 byte number value into a double value.

The pData pointer of the ICCPROFILEEXT structure points to a block of memory that contains the ICC profile as a whole. This pointer does not generate automatically after each new tag added or deleted. Therefore, to regenerate a pointer to the updated profile, call the L_GenerateICCPointer function. Please note however, that before calling any of the L_GenerateICCFile or L_SaveICCProfile functions, make sure that the uDataSize and pData pointer of the ICCPROFILEEXT has the right data either by loading an ICC profile into them, or by calling the L_GenerateICCPointer to generate them.

The user can export the information of some tags into a buffer of sequential bytes using the following functions:

L_ConvertCurveTypeToBuffer, converts the information of an ICCTAG_CURVE_TYPE structure (CurveType tag) into one buffer of sequential bytes.

L_ConvertCLUTToBuffer, converts the information of an ICC_CLUT8 or ICC_CLUT16 structure (the color of the lookup table data used into LutAToBType and LutBToAType tags) into one buffer of sequential bytes.

L_ConvertParametricCurveTypeToBuffer, converts the information of an ICCTAG_PARAMETRIC_CURVE_TYPE structure (ParametricCurveType tag) into one buffer of sequential bytes. To retrieve the number of parameters of a parametric curve type function, call the L_GetParametricCurveNumberOfParameters function. This number of parameters will be used in calculating the size of the buffer that will be filled by the converted data.

Loading an ICC Profile

ICC profiles can be saved to ICC files or embedded in image files and loaded at a later date. Before loading an existing ICC profile from a saved file, the L_InitICCProfile function must be called to initialize the ICC profile structure.

To load an ICC profile from an image file, call L_LoadICCProfile. This function loads the pData member of the ICCPROFILEEXT structure with a pointer to one block of memory that contains the entire ICC profile. It also loads the uDataSize member with the size of the profile. Once this information has been loaded, call L_FillICCProfileStructure to extract the ICC profile information from the memory block and fill the appropriate members of the ICCPROFILEEXT structure.

A profile structure can also be loaded directly from an ICC profile file, using the L_FillICCProfileFromICCFile function.

Saving an ICC Profile

An ICC profile can be saved, or embedded, in a TIFF, GIF or JPEG image file by calling L_SaveICCProfile. To save an ICC profile to an ICC profile file, call L_GenerateICCFile.

Freeing an ICC Profile

When an ICC profile structure is no longer needed, free the structure by calling L_FreeICCProfile.

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Files To Be Included With Your Application

Files To Be Included With Your Application

Files for redistribution are installed by the LEADTOOLS setup. For more information on the installation directory structure, refer to Installation Directory.

Note: | You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license. For these special licensing situations, see the notes below accompanying the specific file.
Note: | You may not distribute the header files with your application, and you may not provide software development capabilities in your application.

The following table summarizes the files you must include on your distribution diskettes to support the LEADTOOLS functions. Most files in the table are optional. These files are referred to as "Redistributables" in the License Agreement.

Please note that LTKRN is required for ALL C DLL applications. For more information on LTKRN and other files for the Raster C DLL, refer to Files To Be Included With Your Application.

Note:

All Unicode versions of LEADTOOLS require Microsoft Unicode Layer for Windows (UNICOWS.DLL) in order to function on Windows 95/98/Me. You can obtain MSUL from: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_mslu.asp.

Redistributable Name: | Explanation: | Win32 Platforms: | x64 Platforms:
LTCLR | LEADTOOLS Color Conversion. The Header File is Ltclr.h. | DLL: Ltclru.dll Library: Ltclr_u.lib | DLL: Ltclrx.dll Library: Ltclr_x.lib

The following files are provided for customizing emulation tables:

Source

Convert to

src_cmyk_image.tif

RGB image (i.e. dst_cmyk2rgb_image.tif)

src_rgb_image.tif

Lab image ( i.e. dst_rgb2lab_image.tif)

src_lab_image.tif

RGB image (i.e. dst_lab2rgb_image.tif)

If custom emulation tables are to be used, you can convert the above files using your own or any third party application to the needed color space. A set of images already converted and ready for use (dst_cmyk2rgb_image.tif, dst_rgb2lab_image.tif, and dst_lab2rgb_image.tif), is provided. However, using the provided set of converted images will produce the same results as the built-in emulation tables.


ICC Profile Functions: Creating an ICC Profile

ICC Profile Functions:
Creating an ICC Profile

L_InitICCHeader

L_InitICCProfile

L_SetICCCMMType

L_SetICCColorSpace

L_SetICCConnectionSpace

L_SetICCCreator

L_SetICCDateTime

L_SetICCDeviceAttributes

L_SetICCDeviceClass

L_SetICCDevManufacturer

L_SetICCDevModel

L_SetICCFlags

L_SetICCPrimaryPlatform

L_SetICCProfileId

L _SetICCRenderingIntent


ICC Profile Functions: Freeing an ICC Profile

ICC Profile Functions:
Freeing an ICC Profile

L_FreeICCProfile


ICC Profile Functions: Loading an ICC Profile

ICC Profile Functions:
Loading an ICC Profile

L_FillICCProfileFromICCFile

L_FillICCProfileStructure

L_InitICCProfile

L_LoadICCProfile


ICC Profile Functions: Saving an ICC Profile

ICC Profile Functions:
Saving an ICC Profile

L_GenerateICCFile

L_SaveICCProfile


ICC Profile Functions: Tags

ICC Profile Functions:
Tags

L_2bFixed2bNumberToDouble

L_ConvertCLUTToBuffer

L_ConvertCurveTypeToBuffer

L_ConvertParametricCurveTypeToBuffer

L_CreateICCTagData

L_DeleteICCTag

L_DoubleTo2bFixed2bNumber

L_DoubleToU8Fixed8Number

L_FreeICCTagType

L_GenerateICCFile

L_GenerateICCPointer

L_GetICCTagData

L_GetICCTagTypeSig

L_GetParametricCurveNumberOfParameters

L_SaveICCProfile

L_SetICCTagData

L_U8Fixed8NumberToDouble


Data Types

Data Types

Basic Data Types and Keywords

LEADTOOLS Basic Data Types

Keywords Used in Declarations

Color Conversion Data Types

Data Type | Defined As | Notes
L_Icc7BitAscii | L_UCHAR | must be terminated by NULL
Fixed Numbers
L_IccS15Fixed16Number | L_INT32 | fixed signed 4 bytes, with 16 fractional bits
L_IccU16Fixed16Number | L_UINT32 | fixed unsigned 4 bytes, with 16 fractional bits
L_IccU1Fixed15Number | L_UINT16 | fixed unsigned 2 bytes, with 15 fractional bits
L_IccU8Fixed8Number | L_UINT16 | fixed unsigned 2 bytes, with 8 fractional bits
Unsigned Integer Numbers
L_IccUInt16Number | L_UINT16 |
L_IccUInt32Number | L_UINT32 |
L_IccUInt64Number | L_UINT64 |
L_IccUInt8Number | L_UCHAR |
Signed Integer Numbers
L_IccInt8Number | L_CHAR |
L_IccInt16Number | L_INT16 |
L_IccIn328Number | L_INT32 |
L_IccInt64Number | L_INT64 |
L_IccSignature | L_INT32 |

Color Conversion Structures

WHITEPOINT

CMYK_PARAMS

YUV_PARAMS

LAB_PARAMS

CONVERSION_PARAMS

MEMICCPROFILE

ICC Profile Structures

ICCPROFILEEXT

ICCHEADER

ICCTAG

ICCTAG_LIST

ICCTAG_UNKNOWN_TYPE

ICCTAG_XYZ_TYPE

ICC_XYZ_NUMBER

ICCTAG_VIEW_COND_TYPE

ICC_VIEW_COND

ICCTAG_UINT8_ARRAY_TYPE

ICCTAG_UINT64_ARRAY_TYPE

ICCTAG_UINT32_ARRAY_TYPE

ICCTAG_UINT16_ARRAY_TYPE

ICCTAG_U16_FIXED16_ARRAY_TYPE

ICCTAG_TEXT_TYPE

ICCTAG_SIGNATURE_TYPE

ICCTAG_S15_FIXED16_ARRAY_TYPE

ICCTAG_RESPONSE_CURVE_SET16_TYPE

ICC_RESPONSE_CURVE

ICC_CURVE_STRUCTURE

ICC_XYZ_ARRAY

ICC_RESPONSE_ARRAYS

ICC_RESPONSE_16_NUMBER

ICCTAG_PROFILE_SEQ_DESC_TYPE

ICC_PROFILE_SEQ_DESC

ICC_PROFILE_DESC

ICCTAG_PARAMETRIC_CURVE_TYPE

ICC_PARAMETRIC_CURVE

ICCTAG_NAMED_COLOR2_TYPE

ICC_NAMED_COLOR2

ICC_NAMED_COLOR2_DATA

ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE

ICC_MULTI_LOCALIZED_UNICODE

ICC_NAME_RECORD

ICCTAG_MEASUREMENT_TYPE

ICC_MEASUREMENT

ICCTAG_LUT_A_TO_B_TYPE, ICCTAG_LUT_B_TO_A_TYPE

ICC_MATRIX

ICCTAG_LUT8_TYPE

ICC_LUT8

ICC_CLUT8

ICCTAG_LUT16_TYPE

ICC_LUT16

ICC_CLUT16

ICCTAG_DATE_TIME_TYPE

ICC_DATE_TIME_NUMBER

ICCTAG_DATA_TYPE

ICC_DATA

ICCTAG_CURVE_TYPE

ICC_CURVE

ICCTAG_COLORANT_TABLE_TYPE

ICC_COLORANT_TABLE_DATA

ICCTAG_COLORANT_ORDER_TYPE

ICCTAG_CHROMATICITY_TYPE

ICC_CHROMATICITY

ICC_CHANNEL_COORD

ICCTAG_BASE

ICCDATATYPEFLAGS

ICCCOLORANTTYPE

ICCMEASUREMENTSIGNATURE

ICCFUNCTIONTYPE

ICCMEASUREMENTFLARE

ICCMEASUREMENTGEOMETRY

ICCSTANDARDOBSERVER

ICCTAGTYPESIGNATURE

ICCTECHNOLOGYSIGNATURE

ICCTAGSIGNATURE

ICCPROFILECLASS

ICCCOLORSPACE

ICCRENDERINGINTENT

ICCPLATFORMSIGNATURE

ICCSTANDARDILLUMINANT

Structures Used with Input and Output Functions

WINDOWS Structures


LEADTOOLS Basic Data Types

LEADTOOLS Basic Data Types

LEADTOOLS has defined the following basic data types for portability:

Data Type

Definition and Usage

L_WCHAR

Defined as WCHAR; used as a 16-bit UNICODE character.

L_CHAR

Defined as char; used as a signed 8-bit integer.

L_UCHAR

Defined as unsigned char; used as an unsigned 8-bit integer.

Integer types

L_INT8

Defined as signed char; used as an 8-bit signed integer.

L_INT16

Defined as signed short; used as a 16-bit signed integer.

L_INT32

Defined as signed int; used as a 32-bit signed integer.

L_INT64

Defined as signed __int64; used as a 64-bit signed integer.

L_UINT8

Defined as unsigned char; used as an 8-bit unsigned integer.

L_UINT16

Defined as unsigned short; used as a 16-bit unsigned integer.

L_UINT32

Defined as unsigned int; used as a 32-bit unsigned integer.

L_UINT64

Defined as unsigned __int64; used as a 64-bit unsigned integer.

L_INT

Defined as int; used as a 32-bit signed integer.

L_UINT

Defined as unsigned int; used as a 32-bit unsigned integer.

Long and Short

L_LONG

Defined as long; used as a signed integer, 32-bits or larger.

L_ULONG

Defined as unsigned long; used as an unsigned integer, 32-bits or larger.

L_USHORT

Defined as unsigned short; used as a 16-bit unsigned integer.

Float types

L_FLOAT

Defined as float; used as a floating point number.

L_DOUBLE

Defined as double; used as a double precision floating point number.

32/64 Types

L_INT_PTR

Defined as INT_PTR; Guaranteed to be the same size as a pointer. The size changes with pointer size (32/64). Used where a pointer is cast to an integer type.

L_UINT_PTR

Defined as UINT_PTR; Unsigned variation of L_INT_PTR.

L_LONG_PTR

Defined as LONG_PTR; Guaranteed to be the same size as a pointer. The size changes with pointer size (32/64). Used where a pointer is cast to an integer type.

L_ULONG_PTR

Defined as ULONG_PTR; Unsigned variation of L_LONG_PTR.

L_SIZE_T

Defined as SIZE_T; Maximum number of bytes to which a pointer can refer.

L_SSIZE_T

Signed version of L_SIZE_T.

Other types

L_VOID

Defined as void; used as a void.

L_BITFIELD

Defined as L_UINT; used as a bit field.

L_COLOREF

Defined as COLORREF; See Windows SDK.

Booleans

L_BOOL

Defined as BOOL; used as a boolean value.

UNICODE types

L_TCHAR

Defined as either char or TCHAR. If FOR_UNICODE is defined, then L_TCHAR will be defined as TCHAR.

Handles

L_HANDLE

Defined as HANDLE; See Windows SDK.

L_HFILE

Defined as HANDLE; See Windows SDK.

L_HWND

Defined as HWND; See Windows SDK.

L_HGDIOBJ

Defined as HGDIOBJ; See Windows SDK.

L_HDC

Defined as HDC; See Windows SDK.

L_HRGN

Defined as HRGN; See Windows SDK.

L_HPALETTE

Defined as HPALETTE; See Windows SDK.

L_HBITMAP

Defined as HBITMAP; See Windows SDK.

L_HCURSOR

Defined as HCURSOR; See Windows SDK.

L_HICON

Defined as HICON; See Windows SDK.

L_HMETAFILE

Defined as HMETAFILE; See Windows SDK.

L_HENHMETAFILE

Defined as HENHMETAFILE; See Windows SDK.

L_HDIB

Defined as HDIB; See Windows SDK.

L_HINSTANCE

Defined as HINSTANCE; See Windows SDK.

L_HPEN

Defined as HPEN; See Windows SDK.

L_HFONT

Defined as HFONT; See Windows SDK.

L_HBRUSH

Defined as HBRUSH; See Windows SDK.

L_HGLOBAL

Defined as HGLOBAL; See Windows SDK.

Structures

L_POINT

Defined as POINT; See Windows SDK.

L_RECT

Defined as RECT; See Windows SDK.

L_BITMAPINFOHEADER

Defined as BITMAPINFOHEADER; See Windows SDK.

L_BITMAPINFO

Defined as BITMAPINFO; See Windows SDK.

L_RGBQUAD

Defined as RGBQUAD; See Windows SDK.

L_RGBQUAD16

typedef struct tagL_RGBQUAD16
{
   L_UINT16 rgbBlue;  // 16-bit blue component
   L_UINT16 rgbGreen; // 16-bit green component
   L_UINT16 rgbRed;   // 16-bit red component
   L_UINT16 rgbReserved; // reserved - use 0
}
L_RGBQUAD16;

Calling Convention

L_xxx_API

Defined as __declspec(dllimport) __stdcall. NOTE: xxx is the module designation. Examples: L_LTDIS_API - LTDIS, L_LTKRN_API - LTKRN


WINDOWS Structures

WINDOWS Structures

BITMAPINFO

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure please refer to the Microsoft SDK documentation for BITMAPINFO.

L_COLORREF defined as COLORREF

COLORREF is a Windows data type. For further information concerning COLORREF, please refer to the Microsoft SDK documentation.

DWORD

DWORD is a Windows data type, 32 bit unsigned int. For further information concerning DWORD, please refer to the Microsoft SDK documentation.

EXTLOGPEN

EXTLOGPEN is a standard Windows structure. For further information concerning EXTLOGPEN, please refer to the Microsoft SDK documentation or your compiler's documentation.

L_HANDLE defined as HANDLE

Handle is a standard Windows structure. For further information concerning HANDLE, please refer to the Microsoft SDK documentation or your compiler's documentation.

L_HCURSOR defined as HCURSOR

HCURSOR is a standard Windows data type. For further information concerning HCURSOR, please refer to the Microsoft SDK documentation or your compiler's documentation.

L_HDC defined as HDC

HDC is a standard Windows structure. For further information concerning HDC, please refer to the Microsoft SDK documentation or your compiler's documentation.

L_HGLOBAL defined as HGLOBAL

HGLOBAL is a standard Windows data type. For further information concerning HGLOBAL, please refer to the Microsoft SDK documentation or your compiler's documentation.

L_HICON defined as HICON

HICON is a standard Windows data type. For further information concerning HICON, please refer to the Microsoft SDK documentation or your compiler's documentation.

L_HWND defined as HWND

HWND is a standard Windows data type. For further information concerning HWND, please refer to the Microsoft SDK documentation or your compiler's documentation.

LOGBRUSH

LOGBRUSH is a standard Windows structure. For further information concerning LOGBRUSH, please refer to the Microsoft SDK documentation or your compiler's documentation.

LOGPEN

LOGPEN is a standard Windows structure. For further information concerning LOGPEN, please refer to the Microsoft SDK documentation or your compiler's documentation.

L_RECT defined as RECT

LPRECT is a standard Windows structure. For further information concerning LPRECT, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPBYTE

LPBYTE is a standard Windows data type. For further information concerning LPBYTE, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPSTR

LPSTR is a standard Windows data type. For further information concerning LPSTR, please refer to the Microsoft SDK documentation or your compiler's documentation.

OPENFILENAMEW

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure please refer to the Microsoft SDK documentation for OPENFILENAMEW.

POINT

POINT is a standard Windows structure. For further information concerning POINT, please refer to the Microsoft SDK documentation or your compiler's documentation.

GUID

GUID is a standard Windows structure. For further information concerning GUID, please refer to the Microsoft SDK documentation or your compiler's documentation.


Keywords Used in Declarations

LEADTOOLS uses the following keywords in declarations of functions, structures, and datatypes:

Keyword | Definition and Usage
EXT_CALLBACK | Defined as _cdecl ; used as an attribute for all toolkit callback functions.
pEXT_CALLBACK | Defined as EXT_CALLBACK *; used as an attribute when defining pointers to toolkit callback functions.


CMYK_PARAMS

CMYK_PARAMS

typedef struct _CMYK_PARAMS
{
L_UINT uStructSize;
L_INT nGcr_level; /* value between 0.0 and 1.0 */
L_INT nMask;
} CMYK_PARAMS, *LPCMYK_PARAMS;

The CMYK_PARAMS structure provides information about CMYK conversion properties.

Parameter | Description
uStructSize | Size of this structure.
nGcr_level | GCR (Gray Component Replacement) value. Possible values are between 0 and 1000.
nMask | Masking value, currently there is only one used value:
 | Value | Meaning
 | CMYK_GCR | Change the nGcr_level.

Comments

LPCMYK_PARAMS is a pointer to a CMYK_PARAMS structure. Where the function parameter type is LPCMYK_PARAMS, you can declare a CMYK_PARAMS variable, update the structure's fields, and pass the variable's address. Declaring a LPCMYK_PARAMS variable is necessary only if your program requires a pointer.

CMYK_PARAMS is used with the CONVERSION_PARAMS structure.

The mask value will be used only when updating the CMYK conversion using L_ClrSetConversionParams function.

The higher the GCR, the more the gray components are replaced with blackness.


CONVERSION_PARAMS

CONVERSION_PARAMS

typedef struct _CONVERSION_PARAMS
{
L_UINT uStructSize ;
L_INT nActiveMethod;
LPWHITEPOINT pWpoint;
L_TCHAR sInputProfile[MAX_PATH];
pMEMICCPROFILE pMemInputProfile;
L_TCHAR sOutputProfile[MAX_PATH];
pMEMICCPROFILE pMemOutputProfile;
L_TCHAR sDstInputTable[MAX_PATH];
LPCMYK_PARAMS pCmykParams;
LPYUV_PARAMS pYuvParams;
LPLAB_PARAMS pLabParams;
L_INT nMethod;
L_INT nQuantization; /* Reserved, must be 8*/

} CONVERSION_PARAMS, *LPCONVERSION_PARAMS;

Parameter | Description
uStructSize | Size of this structure.
nActiveMethod | Active conversion method. Possible values should be one and only one of the following:
 | Value | Meaning
 | USE_BUILTIN | [1] For equations.
 | USE_ICC | [2] For profiles.
 | USE_CUSTOM_ICC | [4] For custom profiles.
 | USE_ET | [8] For emulation tables.
 | USE_CUSTOM_ET | [16] For custom emulation tables
 | USE_AUTO | [32] For best conversion.
 | Since the nMethod member may contain more than one conversion method, this member is used to determine which method to use in the conversion process.
pWpoint | Pointer to a WHITEPOINT structure that describes the white point.
sInputProfile | Character string that contains the input profile name, used with USE_CUSTOM_ICC active conversion method (nActiveMethod member).
pMemInputProfile | Pointer to an MEMICCPROFILE structure that contains information about the input memory profile to be used as the input profile.
sOutputProfile | Character string that contains the output profile name, used with USE_CUSTOM_ICC active conversion method (nActiveMethod member).
pMemOutputProfile | Pointer to a MEMICCPROFILE structure that contains information about the input memory profile to be used as the output profile.
sDstInputTable | Character string that contains the destination image name for emulation, used with USE_CUSTOM_ICC active conversion method (nActiveMethod member.
pCmykParams | Pointer to a CMYK_PARAMS structure that describes the CMYK conversion properties. If this parameter is NULL, default values are assumed.
pYuvParams | Pointer to a YUV PARAMS structure that describes the YUV conversion properties. If this parameter is NULL, default values are assumed.
pLabParams | Pointer to a LAB PARAMS structure that describes the CIELab conversion properties. If this parameter is NULL, default values are assumed.
nMethod | Conversion method when the conversion method is used with the L_ClrInit function. Possible values are:
 | Value | Meaning
 | USE_BUILTIN | [1] For equations (default).
 | USE_ICC | [2] For profiles.
 | USE_CUSTOM_ICC | [4] For custom profiles.
 | USE_ET | [8] For emulation tables. This option is valid for CMYK to RGB, RGB to CIELab, and CIELab to RGB conversions only.
 | USE_CUSTOM_ET | [16] For custom emulation tables. This option is valid for CMYK to RGB, RGB to CIELab, and CIELab to RGB conversions only.
 | USE_AUTO | [32] For best conversion
 | USE_ALL | [63] For all of the above

The nMethod can be used to initialize the SDK with more than one conversion method. Therefore, the nActiveMethod member should be set with the conversion method to be used.

Use L_ClrSetConversionParams to switch between conversions by specifying CHANGE_ACTIVE_METHOD for this member.

When the conversion method is used with the L_ClrSetConversionParams function, the possible values are:

Value

Meaning

CHANGE_ACTIVE_METHOD

[1] Change the active method.

CHANGE_CUSTOM_PROFILES

[2] Change profiles.

CHANGE_WHITE_POINT

[4] Change white point.

CHANGE_ET

[8] Change emulation tables.

CHANGE_CMYK

[16] Change CMYK parameters.

CHANGE_YUV

[32] Change YUV parameters.

CHANGE_LAB

[64] Change LAB parameters

CHANGE_ALL

[127] Change all of the above.

nQuantization

Quantization level, must be 8.

Comments

If the conversion is from CMYK to RGB or RGB to/from CIELab, and the nActiveMethod member is set to USE_CUSTOM_ET, the user should specify the full path to the images in the sDstInputTable member. The following table shows the image dimensions to be used in the emulation tables that are passed to the sDstInputTable member:

Conversion | Image Dimensions
CMYK to RGB | 289x289 RGB TIF image
RGB to CIELab | 190x190 CIELab TIF image
CIELab to RGB | 190x190 RGB TIFF image

There are cmyk_src_image.tif, rgb_src_image.tif, and lab_src_image.tif images distributed with the library. They can be used and converted, using any tool, to their RGB, CIELab, and RGB equivalents respectively.

When using the custom ICC engine (USE_CUSTOM_ICC set in the nMethod member), there are two ways to specify the source and/or destination profiles:

  • Profiles from disk files: sInputProfile and sOutputProfile are used.

  • Profiles resident in memory: pMemInputProfile and pMemOutputProfile are used.

Any combination of the input and output profiles is allowed. For example, a file source profile can be used with a memory destination profile.

If all four options for source and destination profiles are set (sInputProfile, sOutputProfile, pMemInputProfile and pMemOutputProfile), the memory profiles get the highest priority. Therefore, if you set both sInputProfile and pMemInputProfile, only the source specified in pMemInputProfile will be used. In addition, if only a source profile is provided (either file or memory), without a destination profile, the ICC engine will use the default destination profile.

When using USE_ICC or USE_CUSTOM_ICC, any color that does not exist in ICC profile tables will be calculated as an average of the closest colors. If any color component is outside the range (i.e. above its maximum or below its minimum) that value will be cropped to the maximum/minimum value of that component in the specified color space.


ICC_CHANNEL_COORD

ICC_CHANNEL_COORD

typedef struct __ICC_CHROMATICITY_CHANNELS
{
L_IccU16Fixed16Number Coords[2];
} ICC_CHANNEL_COORD, * pICC_CHANNEL_COORD;

The ICC_CHANNEL_COORD structure is used to save xy coordinate values.

Member | Description
Coords | Pointer to an array that contains the xy coordinate values of the channels.


ICC_CHROMATICITY

ICC_CHROMATICITY

typedef struct __ICC_CHROMATICITY
{
L_IccUInt16Number uChannelsCount;
L_UINT32 uColorantType;
pICC_CHANNEL_COORD pChannels;
} ICC_CHROMATICITY, *pICC_CHROMATICITY;

The ICC_CHROMATICITY structure is used to save ChromaticityType data.

Member | Description
uChannelsCount | Number of device channels.
uColorantType | Encoded value of phosphor or colorant type. For a list of possible values, refer to ICCCOLORANTTYPE.
pChannels | Pointer to an ICC_CHANNEL_COORD structure that contains the CIE xy coordinate values of the channels.


ICC_CLUT16

ICC_CLUT16

typedef struct __ICC_CLUT16
{
L_IccUInt8Number NumOfGridPoints[16];
L_IccUInt8Number uPrecision;
L_IccUInt8Number uPad[3];
L_IccUInt16Number * pData;
} ICC_CLUT16, * pICC_CLUT16;

The ICC_CLUT16 structure is used to color the lookup table data used in ICCTAG_LUT_A_TO_B_TYPE and ICCTAG_LUT_B_TO_A_TYPE structures.

Member | Description
NumOfGridPoints | Array that contains number of grid points in each dimension. The number of available dimensions can be obtained by the value of uInputChannels member of either ICCTAG_LUT_A_TO_B_TYPE or ICCTAG_LUT_B_TO_A_TYPE structure.
uPrecision | Value that represents the precision of data elements, in bytes. Value must be 02h.
uPad | Reserved for padding. Pass 0.
pData | Pointer to a buffer that contains CLUT data points.


ICC_CLUT8

ICC_CLUT8

typedef struct __ICC_CLUT8
{
L_IccUInt8Number NumOfGridPoints[16];
L_IccUInt8Number uPrecision;
L_IccUInt8Number uPad[3];
L_IccUInt8Number * pData;
} ICC_CLUT8, * pICC_CLUT8;

The ICC_CLUT8 structure is used to color the lookup table data used in ICCTAG_LUT_A_TO_B_TYPE and ICCTAG_LUT_B_TO_A_TYPE structures.

Member | Description
NumOfGridPoints | Array that contains number of grid points in each dimension. The number of available dimensions can be obtained by the value of uInputChannels member of either ICCTAG_LUT_A_TO_B_TYPE or ICCTAG_LUT_B_TO_A_TYPE structure.
uPrecision | Value that represents the precision of data elements, in bytes. Its value must be 01h.
uPad | Reserved for padding. Pass 0.
pData | Pointer to a buffer that contains CLUT data points.


ICC_COLORANT_TABLE_DATA

ICC_COLORANT_TABLE_DATA

typedef struct __ICC_COLORANTTABLEDATA
{
L_Icc7BitAscii pColorantName[32];
L_IccUInt16Number uPCSValue[3];
} ICC_COLORANT_TABLE_DATA, *pICC_COLORANT_TABLE_DATA;

The ICC_COLORANT_TABLE_DATA structure is used to save ColorantTableType data.

Member | Description
pColorantName | Pointer to an array of 32 bytes that contains the colorant name (null terminated).
uPCSValue | PCS values of the colorant in the color space of the profile.


ICC_CURVE

ICC_CURVE

typedef struct __ICCCURVE
{
L_IccUInt32Number uCurveCount;
L_IccUInt16Number* pCurveData;
} ICC_CURVE, *pICC_CURVE;

The ICCTAG_CURVE_TYPE structure is used to save CurveType data.

Member | Description
uCurveCount | Number of entries in the buffer pointed to by pCurveData
pCurveData | Pointer to a buffer that contains the actual curve data.


ICC_CURVE_STRUCTURE

ICC_CURVE_STRUCTURE

typedef struct __ICC_CURVESTRUCTURE
{
L_UINT32 uMeasurementSig;
L_IccUInt32Number * pMeasurementCount;
pICC_XYZ_NUMBER pMeasOfPatch;
pICC_RESPONSE_ARRAYS pRespArrays;
} ICC_CURVE_STRUCTURE, * pICC_CURVE_STRUCTURE;

The ICC_CURVE_STRUCTURE structure is used to save curve data.

Member | Description
uMeasurementSig | A value that indicates the measurement unit signature. For a list of possible values, refer to ICCMEASUREMENTSIGNATURE.
pMeasurementCount | Pointer to a buffer that contains the number of measurements for each channel. There is one entry for each channel.
pMeasOfPatch | Pointer to an array of ICC_XYZ_NUMBER structures with number-of-channels measurements of patch with the maximum colorant value. PCS values are relative colorimetric. For more information on the "number-of-channels measurements of patch with the maximum colorant value", refer to www.color.org.
pRespArrays | Pointer to an array of ICC_RESPONSE_ARRAYS structures. There is one structure for each channel.


ICC_DATA

ICC_DATA

typedef struct __ICCDATA
{
L_UINT32 uDataFlag;
L_Icc7BitAscii* pData;
L_UINT uDataElementsCount;
} ICC_DATA, * pICC_DATA;

The ICC_DATA structure is used to save DataType data.

Member | Description
uDataFlag | A value that indicates the function type. For a list of possible values, refer to ICCDATATYPEFLAGS.
pData | Pointer to a buffer that contains the tag data.
uDataElementsCount | Number of data elements in the buffer pointed to by pData.


ICC_DATE_TIME_NUMBER

ICC_DATE_TIME_NUMBER

typedef struct __ICCDATETIME
{
L_IccUInt16Number uYear;
L_IccUInt16Number uMonth;
L_IccUInt16Number uDay;
L_IccUInt16Number uHours;
L_IccUInt16Number uMinutes;
L_IccUInt16Number uSeconds;
} ICC_DATE_TIME_NUMBER, * pICC_DATE_TIME_NUMBER;

The ICC_DATE_TIME_NUMBER structure is used to save DateTimeType data.

Member | Description
uYear | Number of the year (actual year, e.g. 1994).
uMonth | Number of the month (1-12).
uDay | Number of the day of the month (1-31).
uHours | Number of hours (0-23).
uMinutes | Number of minutes (0-59).
uSeconds | Number of seconds (0-59).

Comments

All the ICC_DATE_TIME_NUMBER values in a profile are in Coordinated Universal Time (UTC, also known as GMT or ZULU Time). Profile writers are required to convert local time to UTC when setting these values.


ICC_LUT16

ICC_LUT16

typedef struct __ICCLUT16
{
L_IccUInt8Number uInputChan;
L_IccUInt8Number uOutputChan;
L_IccUInt8Number uClutPoints;
L_IccUInt8Number uPad;
L_IccS15Fixed16Number nE00;
L_IccS15Fixed16Number nE01;
L_IccS15Fixed16Number nE02;
L_IccS15Fixed16Number nE10;
L_IccS15Fixed16Number nE11;
L_IccS15Fixed16Number nE12;
L_IccS15Fixed16Number nE20;
L_IccS15Fixed16Number nE21;
L_IccS15Fixed16Number nE22;
L_IccUInt16Number uInputEnt;
L_IccUInt16Number uOutputEnt;
L_IccUInt16Number * pInputTables;
L_IccUInt16Number * pCLUT;
L_IccUInt16Number * pOutputTables;
} ICC_LUT16, * pICC_LUT16;

The ICC_LUT16 structure is used to save lut16Type data.

Member | Description
uInputChan | Number of input channels.
uOutputChan | Number of output channels.
uClutPoints | Number of CLUT grid points (identical for each side).
uPad | Reserved for padding, must be set to zero.
nE00 | Encoded E00 parameter.
nE01 | Encoded E01 parameter.
nE02 | Encoded E02 parameter.
nE10 | Encoded E10 parameter.
nE11 | Encoded E11 parameter.
nE12 | Encoded E12 parameter.
nE20 | Encoded E20 parameter.
nE21 | Encoded E21 parameter.
nE22 | Encoded E22 parameter.
uInputEnt | Number of input table entries.
uOutputEnt | Number of output table entries.
pInputTables | Pointer to a buffer that contains input tables.
pCLUT | Pointer to a buffer that contains CLUT values.
pOutputTables | Pointer to a buffer that contains output tables.


ICC_LUT8

ICC_LUT8

typedef struct __ICCLUT8
{
L_IccUInt8Number uInputChan;
L_IccUInt8Number uOutputChan;
L_IccUInt8Number uClutPoints;
L_IccUInt8Number uPad;
L_IccS15Fixed16Number nE00;
L_IccS15Fixed16Number nE01;
L_IccS15Fixed16Number nE02;
L_IccS15Fixed16Number nE10;
L_IccS15Fixed16Number nE11;
L_IccS15Fixed16Number nE12;
L_IccS15Fixed16Number nE20;
L_IccS15Fixed16Number nE21;
L_IccS15Fixed16Number nE22;
L_IccUInt16Number uInputEnt;
L_IccUInt16Number uOutputEnt;
L_IccUInt8Number * pInputTables;
L_IccUInt8Number * pCLUT;
L_IccUInt8Number * pOutputTables;
} ICC_LUT8, * pICC_LUT8;

The ICC_LUT8 structure is used to save Lut8Type data.

Member | Description
uInputChan | Number of input channels.
uOutputChan | Number of output channels.
uClutPoints | Number of CLUT grid points (identical for each side).
uPad | Reserved for padding, must be set to zero.
nE00 | Encoded E00 parameter.
nE01 | Encoded E01 parameter.
nE02 | Encoded E02 parameter.
nE10 | Encoded E10 parameter.
nE11 | Encoded E11 parameter.
nE12 | Encoded E12 parameter.
nE20 | Encoded E20 parameter.
nE21 | Encoded E21 parameter.
nE22 | Encoded E22 parameter.
uInputEnt | Number of input table entries.
uOutputEnt | Number of output table entries.
pInputTables | Pointer to a buffer that contains input tables.
pCLUT | Pointer to a buffer that contains CLUT values.
pOutputTables | Pointer to a buffer that contains output tables.


ICC_MATRIX

ICC_MATRIX

typedef struct _MATRIX
{
L_IccS15Fixed16Number pElement[12];
} ICC_MATRIX, * pICC_MATRIX;

The ICC_MATRIX structure is used to save matrix data.

Member | Description
pElement | Pointer to a buffer that contains matrix data to be used in ICCTAG_LUT_A_TO_B_TYPE or ICCTAG_LUT_B_TO_A_TYPE tags.


ICC_MEASUREMENT

ICC_MEASUREMENT

typedef struct __ICCMEASUREMENT
{
L_UINT32 uStdObserver;
ICC_XYZ_NUMBER Backing;
L_UINT32 uGeometry;
L_UINT32 uFlare;
L_UINT32 uIlluminant;
} ICC_MEASUREMENT, * pICC_MEASUREMENT;

The ICC_MEASUREMENT structure is used to save MeasurementType tag type data.

Member | Description
uStdObserver | A value that represents the standard observer. For a list of possible values, refer to ICCSTANDARDOBSERVER.
Backing | A value that represents XYZ tristimulus values for measurement backing.
uGeometry | A value that represents the measurement geometry. For a list of possible values, refer to ICCMEASUREMENTGEOMETRY.
uFlare | A value that represents the measurement flare. For a list of possible values, refer to ICCMEASUREMENTFLARE.
uIlluminant | A value that represents the standard illuminant. For a list of possible values, refer to ICCSTANDARDILLUMINANT.


ICC_MULTI_LOCALIZED_UNICODE

ICC_MULTI_LOCALIZED_UNICODE

typedef struct __ICC_MULTILOCALIZEDUNICODE
{
L_IccUInt32Number uNameRecordsCount;
L_IccUInt32Number uNameRecordSize;
pICC_NAME_RECORD pNameRecordsData;
L_UINT16 * pUnicodeCharacters;
} ICC_MULTI_LOCALIZED_UNICODE, * pICC_MULTI_LOCALIZED_UNICODE;

The ICC_MULTI_LOCALIZED_UNICODE structure is used to save MultiLocalizedUnicodeType tag data.

Member | Description
uNameRecordsCount | A value that represents the number of name records in the buffer pointed to by pNameRecordsData.
uNameRecordSize | A value that represents the length, in bytes, of each name record in the buffer pointed to by pNameRecordsData.
pNameRecordsData | Pointer to an ICC_NAME_RECORD structure that contains name record data.
pUnicodeCharacters | Pointer to a buffer of UNICODE characters.


ICC_NAME_RECORD

ICC_NAME_RECORD

typedef struct __ICC_NAME_RECORD
{
L_IccUInt16Number uNameLangCode;
L_IccUInt16Number uNameCountryCode;
L_IccUInt32Number uNameLength;
L_IccUInt32Number uNameOffset;
} ICC_NAME_RECORD, * pICC_NAME_RECORD;

The ICC_NAME_RECORD structure is used to save name record data.

Member | Description
uNameLangCode | A value that represents the name language code from ISO-639.
uNameCountryCode | A value that represents the name country code from ISO-13166.
uNameLength | A value that represents the name length, in bytes.
uNameOffset | A value that represents the name offset from the start of the tag in bytes.


ICC_NAMED_COLOR2

ICC_NAMED_COLOR2

typedef struct __ICCNAMEDCOLOR2
{
L_IccUInt32Number uVendorFlag;
L_IccUInt32Number uNamedColorsCount;
L_IccUInt32Number uDeviceCoordsCount;
L_Icc7BitAscii pPrefix[32];
L_Icc7BitAscii pSuffix[32];
pICC_NAMED_COLOR2_DATA pNamedColors;
} ICC_NAMED_COLOR2, * pICC_NAMED_COLOR2;

The ICC_NAMED_COLOR2 structure is used to save named color 2 tag type data.

Member | Description
uVendorFlag | A value that indicates a vendor specific flag.
uNamedColorsCount | A value that indicates the number of named colors.
uDeviceCoordsCount | A value that indicates the number of device coordinates for each name color.
pPrefix | Pointer to a buffer that contains a prefix for each color name. This is a 32-byte field that includes null termination.
pSuffix | Pointer to a buffer that contains a suffix for each color name. This is a 32-byte field that includes null termination.
pNamedColors | Pointer to an ICC_NAMED_COLOR2_DATA structure that contains the named color’s data.


ICC_NAMED_COLOR2_DATA

ICC_NAMED_COLOR2_DATA

typedef struct __ICC_NAMEDCOLORDATA
{
L_Icc7BitAscii uColorRootName[32];
L_IccUInt16Number uColorPCSCoord[3];
L_IccUInt16Number * uColorDeviceCoord;
} ICC_NAMED_COLOR2_DATA, * pICC_NAMED_COLOR2_DATA;

The ICC_NAMED_COLOR2_DATA structure is used to save a named color’s data.

Member | Description
uColorRootName | Array that contains the color root name. This is a 32-byte field including null termination.
uColorPCSCoord | Array that contains the named color’s PCS encoding.
uColorDeviceCoord | Pointer to a buffer that contains the named color’s device coordinates.


ICC_PARAMETRIC_CURVE

ICC_PARAMETRIC_CURVE

typedef struct __ICCPARAMETRICCURVE
{
L_UINT16 uFunctionType;
L_IccUInt8Number uReserved[2];
L_IccS15Fixed16Number * pParameters;
} ICC_PARAMETRIC_CURVE, * pICC_PARAMETRIC_CURVE;

The ICC_PARAMETRIC_CURVE structure is used to save parametric curve tag data.

Member | Description
uFunctionType | A value that indicates the function type. For a list of possible values, refer to ICCFUNCTIONTYPE.
uReserved | Reserved. Must be set to 0.
pParameters | A pointer to a buffer that contains one or more parameters for the function specified in uFunctionType. For more information on the functions and their parameters, refer to www.color.org.


ICC_PROFILE_DESC

ICC_PROFILE_DESC

typedef struct __ICCPROFILEDESC
{
L_IccUInt32Number DevManufacturerSig;
L_IccUInt32Number DevModelSig;
L_IccUInt8Number DevAttributes[8];
L_IccUInt32Number DevTechInfo;
ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE DevManufacturerDesc;
ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE DevModelDesc;
} ICC_PROFILE_DESC, * pICC_PROFILE_DESC;

The ICC_PROFILE_SEQ_DESC structure is used to save profile description structures data.

Member | Description
DevManufacturerSig | A value that indicates the device manufacturer's signature. This is from the corresponding profile’s header information.
DevModelSig | A value that indicates the device model signature. This is from the corresponding profile’s header information.
DevAttributes | A value that indicates the attributes. This is from the corresponding profile’s header information.
DevTechInfo | A value that indicates the device technology information such as CRT, Dye Sublimation, etc. This corresponds to profile’s technology signature.
DevManufacturerDesc | An ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE structure that contains a displayable description of the device manufacturer. (profile’s deviceMfgDescTag) For information on the profile's deviceMfgDescTag, refer to www.color.org.
DevModelDesc | An ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE structure that contains the displayable description of the device model (profile’s deviceModelDescTag). For information on the profile's deviceModelDescTag, refer to www.color.org.


ICC_PROFILE_SEQ_DESC

ICC_PROFILE_SEQ_DESC

typedef struct __ICCPROFILESEQDESC
{
L_IccUInt32Number uCount;
pICC_PROFILE_DESC pProfDescription;
} ICC_PROFILE_SEQ_DESC, * pICC_PROFILE_SEQ_DESC;

The ICC_PROFILE_SEQ_DESC structure is used to save profile description structures data.

Member | Description
uCount | A value that indicates the number of description structures in the buffer pointed to by pProfDescription.
pProfDescription | Pointer to an ICC_PROFILE_DESC structure that contains the profile description data.


ICC_RESPONSE_16_NUMBER

ICC_RESPONSE_16_NUMBER

typedef struct _ICC_RESPONSE_16_NUMBER
{
L_IccUInt16Number uDeviceCode;
L_IccUInt16Number uReserved;
L_IccS15Fixed16Number uMeasurement;
} ICC_RESPONSE_16_NUMBER, * pICC_RESPONSE_16_NUMBER;

The ICC_RESPONSE_16_NUMBER structure is used to save response arrays data.

Member | Description
uDeviceCode | 16-bit number in the interval [DeviceMin to DeviceMax].
uReserved | Reserved. Must be set to zero.
uMeasurement | Measurement value.

Comments

Note that DeviceMin is encoded as 000h, and DeviceMax is encoded as FFFh.


ICC_RESPONSE_ARRAYS

ICC_RESPONSE_ARRAYS

typedef struct __ICC_RESPONSEARRAYS
{
pICC_RESPONSE_16_NUMBER pResponseNumber;
} ICC_RESPONSE_ARRAYS, * pICC_RESPONSE_ARRAYS;

The ICC_RESPONSE_ARRAYS structure is used to save response arrays data.

Member | Description
pResponseNumber | Pointer to one or more ICC_RESPONSE_16_NUMBER structures that contain measurement information for each channel.


ICC_RESPONSE_CURVE

ICC_RESPONSE_CURVE

typedef struct __ICC_RESPONSECURVE
{
L_IccUInt16Number uChannelsCount;
L_IccUInt16Number uMeasurementTypesCount;
L_IccUInt32Number * pResponseDataOffsets;
pICC_CURVE_STRUCTURE pCurveStructure;
} ICC_RESPONSE_CURVE, * pICC_RESPONSE_CURVE;

The ICC_RESPONSE_CURVE structure is used to save a ResponseCurveSet16Type Tag.

Member | Description
uChannelsCount | Non-negative value that indicates the number of channels.
uMeasurementTypesCount | Non-negative value that indicates the number of measurement types.
pResponseDataOffsets | A pointer to a buffer of offsets, each relative to byte 0 of this structure, with one entry for each measurement type. Each will point to the response data for the measurement unit.
pCurveStructure | A pointer to an ICC_CURVE_STRUCTURE structure that contains the curve data.


ICC_VIEW_COND

ICC_VIEW_COND

typedef struct __ICC_VIEWCOND
{
ICC_XYZ_NUMBER AbsIlluminant;
ICC_XYZ_NUMBER AbsSurround;
L_UINT32 uIlluminantType;
} ICC_VIEW_COND, * pICC_VIEW_COND;

The ICC_VIEW_COND structure is used to save viewing condition parameters.

Member | Description
AbsIlluminant | CIE ‘absolute’ XYZ values for illuminant (in which Y is in cd/m2)
AbsSurround | CIE ‘absolute’ XYZ values for surround (in which Y is in cd/m2)
uIlluminantType | A value that represents the illuminant type. For a list of possible values, refer to ICCSTANDARDILLUMINANT.

Comments

The viewing condition described in this tag is the actual viewing condition assumed for the media for which the profile is defined, specified in CIE ‘absolute’ units. Note that the luminanceTag must be the same as the Y value given in this tag. For more information on the "luminanceTag", refer to the ICC web site (www.color.org).


ICC_XYZ_ARRAY

ICC_XYZ_ARRAY

typedef struct _ICC_XYZ_ARRAY
{
pICC_XYZ_NUMBER XYZData;
} ICC_XYZ_ARRAY, *pICC_XYZ_ARRAY;

The ICC_XYZ_ARRAY structure is used to save XYZ color space data.

Member | Description
XYZData | Array of XYZ numbers.


ICC_XYZ_NUMBER

ICC_XYZ_NUMBER

typedef struct _ICC_XYZ_NUMBER
{
L_IccS15Fixed16Number nX;
L_IccS15Fixed16Number nY;
L_IccS15Fixed16Number nZ;
} ICC_XYZ_NUMBER, *pICC_XYZ_NUMBER;

The ICC_XYZ_NUMBER structure is used to save XYZ color space data.

Member | Description
nX | A value that represents the X tristimulus value of an XYZ color space.
nY | A value that represents the Y tristimulus value of an XYZ color space.
nZ | A value that represents the Z tristimulus value of an XYZ color space.


ICCCOLORANTTYPE

ICCCOLORANTTYPE

typedef enum
{
UnknownColorant = 0x0000,
ITU_R_BT709 = 0x0001,
SMPTE_RP145_1994 = 0x0002,
EBU_TECH3213_E = 0x0003,
P22 = 0x0004
} ICCCOLORANTTYPE;

This enumerated type is used within the ICC_CHROMATICITY structure to indicate phosphor or colorant type.


ICCCOLORSPACE

ICCCOLORSPACE

typedef enum
{
XyzData = 0x58595A20, /* 'XYZ ' */
LabData = 0x4C616220, /* 'Lab ' */
LuvData = 0x4C757620, /* 'Luv ' */
YCbCrData = 0x59436272, /* 'YCbr' */
YxyData = 0x59787920, /* 'Yxy ' */
RgbData = 0x52474220, /* 'RGB ' */
GrayData = 0x47524159, /* 'GRAY' */
HsvData = 0x48535620, /* 'HSV ' */
HlsData = 0x484C5320, /* 'HLS ' */
CmykData = 0x434D594B, /* 'CMYK' */
CmyData = 0x434D5920, /* 'CMY ' */
ColorData2 = 0x32434C52, /* '2CLR' */
ColorData3 = 0x33434C52, /* '3CLR' */
ColorData4 = 0x34434C52, /* '4CLR' */
ColorData5 = 0x35434C52, /* '5CLR' */
ColorData6 = 0x36434C52, /* '6CLR' */
ColorData7 = 0x37434C52, /* '7CLR' */
ColorData8 = 0x38434C52, /* '8CLR' */
ColorData9 = 0x39434C52, /* '9CLR' */
ColorData10 = 0x41434C52, /* 'ACLR' */
ColorData11 = 0x42434C52, /* 'BCLR' */
ColorData12 = 0x43434C52, /* 'CCLR' */
ColorData13 = 0x44434C52, /* 'DCLR' */
ColorData14 = 0x45434C52, /* 'ECLR' */
ColorData15 = 0x46434C52, /* 'FCLR' */
} ICCCOLORSPACE;

This enumerated type is used within the ICC_HEADER structure to indicate the color space.


ICCDATATYPEFLAGS

ICCDATATYPEFLAGS

typedef enum
{
ASCII = 0x00000000,
Binary = 0x00000001,
} ICCDATATYPEFLAGS;

This enumerated type is used within the ICC_DATA structure to indicate which data type is used.


ICCFUNCTIONTYPE

ICCFUNCTIONTYPE

typedef enum
{
Func4Bytes = 0x0000L, /* Y = X^(gamma) */
Func12Bytes = 0x0001L, /* Y = (aX + b) ^ (gamma), (X >= -b/a)
Y = 0 , (X < - b/a) */
Func16Bytes = 0x0002L, /* Y = (aX + b)^(gamma) + c, (X >= -b/a)
Y = c , (X < -b/a) */
Func20Bytes = 0x0003L, /* Y = (aX + b)^(gamma), (X >= -b/a)
Y = cX , (X < -b/a) */
Func28Bytes = 0x0004L /* Y = (aX + b)^(gamma) + e, (X >= -b/a)
Y = (cX + f) , (X < -b/a) */
} ICCFUNCTIONTYPE;

This type is used within the ICC_PARAMETRIC_CURVE structure to indicate the function type.


ICCHEADER

ICCHEADER

typedef struct _ICCHEADER
{
L_IccUInt32Number uSize;
L_IccSignature nCmmID;
L_IccUInt32Number uVersion;
L_UINT32 uDeviceClass;
L_UINT32 uColorSpace;
L_UINT32 uPCS;
ICC_DATE_TIME_NUMBER DateTime;
L_IccSignature nProfileSignature;
L_UINT32 uPlatform;
L_IccUInt32Number uFlags;
L_IccSignature nManufacturer;
L_IccUInt32Number uModel;
L_IccUInt64Number uAttributes;
L_IccUInt32Number uRenderingIntent;
ICC_XYZ_NUMBER Illuminant;
L_IccSignature nCreator;
L_IccUInt8Number uProfileID[16];
L_IccUInt8Number uReserved[28];
} ICCHEADER, * pICCHEADER;

The ICCHEADER structure is used to save all the information and data about an ICC profile header.

Member | Description
uSize | A value that indicates the size of the ICC profile in bytes.
nCmmID | A value that indicates the Color Management Module for the profile.
uVersion | A value that indicates the version of the ICC profile.
uDeviceClass | A value that indicates the device class profile of the ICC profile. For a list of possible values, refer to ICCPROFILECLASS.
uColorSpace | A value that indicates the color space used for the ICC profile. For a list of possible values, refer to ICCCOLORSPACE.
uPCS | A value that indicates the color space used for the Profile Connection Space. For a list of possible values, refer to ICCCOLORSPACE.
DateTime | A pointer to ICC_DATE_TIME_NUMBER structure that contains the date and time of creation of the ICC profile.
nProfileSignature | A value that indicates the profile signature.
uPlatform | A value that indicates the primary platform for which the ICC profile was created. For a list of possible values, refer to ICCPLATFORMSIGNATURE.
uFlags | Flags that indicate if the ICC profile is embedded, and if the ICC profile can be used independently from the embedded color data. You can use a bitwise OR (|) to specify one flag from each group. The following flags indicate if the ICC profile is embedded or not:
 | Value | Meaning
 | ICC_EMBEDDED_PROFILE_FALSE | [0x00000000] ICC profile is not embedded
 | ICC_EMBEDDED_PROFILE_TRUE | [0x00000001] ICC profile is embedded
 | The following flags indicate if the ICC profile can be used independently from the embedded color data or not:
 | Value | Meaning
 | ICC_USE_ANYWHERE | [0x00000000] ICC profile can be used independently
 | ICC_USE_WITH_EMBEDDED_DATA_ONLY | [0x00000002] ICC profile cannot be used independently
nManufacturer | A value that indicates the device manufacturer for the device for which the ICC profile was created.
uModel | A value that indicates the model of the device for which the ICC profile was created.
uAttributes | Flags that identify attributes unique to a particular device. You can use a bitwise OR (|) to specify one flag from each group. The following flags indicate the transparency of the media:
 | Value | Meaning
 | ICC_REFLECTIVE | [0x0000000000000000] Reflective media
 | ICC_TRANSPARENCY | [0x0000000000000001] Transparent media
 | The following flags indicate if the media is glossy or matte:
 | Value | Meaning
 | ICC_GLOSSY | [0x0000000000000000] Glossy media
 | ICC_MATTE | [0x0000000000000002] Matte media
 | The following flags indicate media polarity:
 | Value | Meaning
 | ICC_MEDIA_POLARITY_POSITIVE | [0x0000000000000000] Positive media polarity
 | ICC_MEDIA_POLARITY_NEGATIVE | [0x0000000000000004] Negative media polarity
 | The following flags indicate if the media is colored or not:
 | Value | Meaning
 | ICC_COLOR_MEDIA | [0x0000000000000000] Color media
 | ICC_BLACK_AND_WHITE | [0x0000000000000008] Black and white media
uRenderingIntent | A value that indicates the rendering intent. For a list of possible values, refer to ICCRENDERINGINTENT.
Illuminant | A pointer to ICC_XYZ_NUMBER structure that indicates the CIEXYZ values of the illuminant used for the profile connection space.
nCreator | A value that identifies the creator of the ICC profile.
uProfileID | An array that contains 16 byte values generated using an MD5 algorithm. This indicates a checksum value for the ICC profile.
uReserved | An array of reserved bytes for the ICC organization.

Comments

The nCmmID value must match a CMM type signature registered in the ICC registry. If no preferred CMM is identified, this field is set to zero (00000000h). The registration authority for this data is the ICC Technical Secretary. Set the ICC web site (www.color.org) for contact information.

The uVersion contains the value ICC_PROFILE_VER42 for ICC version 4.2.0.0 over which this ICC profile structure and all the functions associated with it was built.

For all profile classes, other than a device link profile, the profile connection space field uPCS is either XyzData or LabData. When the device class is a device link profile, the value of the profile connection space must be an appropriate color space from the list in ICCCOLORSPACE.

The nProfileSignature contains the fixed value of ICC_PROFILE_SIG. Please note that ICC_PROFILE_SIG is the actual value that is always used for the nProfileSignature member.

If there is no primary platform identified, uPlatform is set to NoPlatformSignature.

The nManufacturer and uModel values must match the signature contained in the appropriate section of the ICC signature registry found at (www.color.org). If not used, this field is set to zero (00000000h).

For the Illuminant field, the only illuminant permitted for the profile connection space is D50 (where X=0.9642; Y=1.0 and z=0.8249).

The nCreator value must match the signature contained in the device manufacturer section of the ICC signature registry found at (www.color.org). If not used, this field is set to zero (00000000h).

The uProfileID value is generated using the MD5 fingerprinting method as defined in the Internet RFC 1321. If it has not been calculated, the value of the uProfileID is set to zero (00000000h).

The uReserved member is reserved for future ICC definition and is set to zero (00000000h).


ICCMEASUREMENTFLARE

ICCMEASUREMENTFLARE

typedef enum
{
Flare0 = 0x00000000L, /* 0% flare */
Flare100 = 0x00010000L /* 100% flare */
} ICCMEASUREMENTFLARE;

This type is used within the ICC_MEASUREMENT structure to indicate the measurement flare.


ICCMEASUREMENTGEOMETRY

ICCMEASUREMENTGEOMETRY

typedef enum
{
GeometryUnknown = 0x00000000L, /* Unknown */
Geometry045or450 = 0x00000001L, /* 0/45, 45/0 */
Geometry0dord0 = 0x00000002L /* 0/d or d/0 */
} ICCMEASUREMENTGEOMETRY;

This type is used within the ICC_MEASUREMENT structure to indicate the measurement geometry.


ICCMEASUREMENTSIGNATURE

ICCMEASUREMENTSIGNATURE

typedef enum
{
StaA = 0x53746141L,
StaE = 0x53746145L,
StaI = 0x53746149L,
StaT = 0x53746154L,
StaM = 0x5374614DL,
DN = 0x434E2020L,
DN_P = 0x434E2050L,
DNN = 0x434E4E20L,
DNNP = 0x434E4E50L
} ICCMEASUREMENTSIGNATURE;

This type is used within the ICC_CURVE_STRUCTURE structure to indicate the curve measurement signature.


ICCPLATFORMSIGNATURE

ICCPLATFORMSIGNATURE

typedef enum
{
NoPlatformSignature = 0x00000000L, /* No Platform Signature */
MacintoshSignature = 0x4150504CL, /* 'APPL' */
MicrosoftSignature = 0x4D534654L, /* 'MSFT' */
SolarisSignature = 0x53554E57L, /* 'SUNW' */
SGISignature = 0x53474920L /* 'SGI ' */
} ICCPLATFORMSIGNATURE;

This enumerated type is used within the ICC_HEADER structure to indicate the primary platform.


ICCPROFILECLASS

ICCPROFILECLASS

typedef enum
{
InputClass = 0x73636E72L, /* 'scnr' */
DisplayClass = 0x6D6E7472L, /* 'mntr' */
OutputClass = 0x70727472L, /* 'prtr' */
DeviceLinkClass = 0x6C696E6BL, /* 'link' */
AbstractClass = 0x61627374L, /* 'abst' */
ColorSpaceClass = 0x73706163L, /* 'spac' */
NamedColorClass = 0x6E6D636CL /* 'nmcl' */
} ICCPROFILECLASS;

This enumerated type is used within the ICC_HEADER structure to indicate the profile class.


ICCPROFILEEXT

ICCPROFILEEXT

typedef struct _ICCPROFILEEXT
{
L_UINT uStructSize;
L_SIZE_T uDataSize;
L_SIZE_T uTagDataSize;
pICCHEADER pIccHeader;
ICCTAG_LIST tagList;
L_UCHAR * pTagData;
L_UCHAR * pData;
} ICCPROFILEEXT, * pICCPROFILEEXT;

The ICCPROFILEEXT structure is used to save all the information and data about an ICC profile.

Member | Description
uStructSize | Size of the structure in bytes. Use the sizeof operator to calculate this value.
uDataSize | A value that indicates the size of the pData pointer in bytes.
uTagDataSize | A value that indicates the size of the pTagData pointer in bytes.
pIccHeader | A pointer to an ICCHEADER structure that has all the ICC header’s data.
tagList | A pointer to an ICCTAG_LIST structure that contains information and data about all the tags in the ICC profile.
pTagData | A pointer to a buffer that contains all the tags' data.
pData | A pointer to a buffer that contains all the ICC profile’s data.

Comments

The data in all the fields is converted into little Endian format, except for the data in the pTagData and the pData pointers. The user doesn't need to access the data in the pData and pTagData pointers directly. The ICC defined functions provide access to the data in them. Consequently, the data in these two members are kept in big Endian format.

When loading an existing ICC profile (one that has been saved to either an image file or an ICC profile file) into this structure, the pData member will contain all the profile data in one block of memory, and the pTagData member will contain only the tags data in one block of memory. The uDataSize member contains the size of the pData pointer which is the ICC profile’s size, and the uTagDataSize member contains the size of the pTagData pointer.

When creating a new ICC profile, or modifying an existing one, the pTagData and uTagDataSize are constantly updated, so they will always contain the correct information for the profile. However, the pData and uDataSize will not contain the correct information until after the L_GenerateICCPointer function has been called. The L_GenerateICCPointer function generates the pData pointer to the updated profile information and fills in the uDataSize member with the updated value.


ICCRENDERINGINTENT

ICCRENDERINGINTENT

typedef enum
{
Perceptual = 0x00000000,
RelativeColorimetric = 0x00000001,
Saturation = 0x00000002,
AbsoluteColorimetric = 0x00000003
} ICCRENDERINGINTENT;

This enumerated type is used within the ICC_HEADER structure to indicate the rendering intent.


ICCSTANDARDILLUMINANT

ICCSTANDARDILLUMINANT

typedef enum
{
IccIlluminantUnknown = 0x00000000L,
IccIlluminantD50 = 0x00000001L,
IccIlluminantD65 = 0x00000002L,
IccIlluminantD93 = 0x00000003L,
IccIlluminantF2 = 0x00000004L,
IccIlluminantD55 = 0x00000005L,
IccIlluminantA = 0x00000006L,
IccIlluminantEquiPowerE = 0x00000007L,
IccIlluminantF8 = 0x00000008L
} ICCSTANDARDILLUMINANT;

This enumerated type is used within the ICC_MEASUREMENT structure to indicate the standard illuminant encoding.


ICCSTANDARDOBSERVER

ICCSTANDARDOBSERVER

typedef enum
{
StdObsUnknown = 0x00000000L, /* Unknown */
StdObs1931TwoDegrees = 0x00000001L, /* 2 deg */
StdObs1964TenDegrees  = 0x00000002L
 /* 10 deg */
} ICCSTANDARDOBSERVER;

This type is used within the ICC_MEASUREMENT structure to indicate the standard observer.


ICCTAG

ICCTAG

typedef struct _ICCTAG
{
L_UINT32 uSig;
L_IccUInt32Number uOffset;
L_IccUInt32Number uSize;
} ICCTAG, * pICCTAG;

The ICCTAG structure is used to save a tag’s information.

Member | Description
uSig | A value that indicates the tag signature. For a list of possible values, refer to ICCTAGSIGNATURE. It can also contain a private tag.
uOffset | A value that indicates the address of the beginning of the tag data element, with respect to the beginning of the profile data stream (which has an address of zero).
uSize | A value that indicates the tag data element size in bytes. This value does not include any padded bytes at the end of the data.

Comments

The uSig field can contain a private tag, but it must be registered with the ICC registry. The registration authority for this data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).


ICCTAG_BASE

ICCTAG_BASE

typedef struct __ICCTAG_BASE
{
L_UINT32 Signature;
L_UCHAR uReserved[4];
} ICCTAG_BASE, * pICCTAG_BASE;

The ICCTAG_BASE structure is used to save the basic part of each tag type.

Member | Description
Signature | A value that indicates the signature of the tag type.
uReserved | Pointer to an array of 4 reserved bytes. Must be set to 0.

Comments

The Signature value can be one of the values in the list ICCTAGTYPESIGNATURE or it can be a private tag. The registration authority for these data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).


ICCTAG_CHROMATICITY_TYPE

ICCTAG_CHROMATICITY_TYPE

typedef struct __ICCTAG_CHROMATICITY_TYPE
{
ICCTAG_BASE tagBase;
ICC_CHROMATICITY Chrom;
} ICCTAG_CHROMATICITY_TYPE, * pICCTAG_CHROMATICITY_TYPE;

The ICCTAG_CHROMATICITY_TYPE structure is used to save a ChromaticityType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Chrom | Pointer to an ICC_CHROMATICITY structure that contains the tag data.

Comments

The signature for this tag type is ChromaticityTypeSig (0x6368726D).


ICCTAG_COLORANT_ORDER_TYPE

ICCTAG_COLORANT_ORDER_TYPE

typedef struct __ICCTAG_COLORANT_ORDER_TYPE
{
ICCTAG_BASE tagBase;
L_IccUInt32Number uColorantsCount;
L_IccUInt8Number * pColorantsData;
} ICCTAG_COLORANT_ORDER_TYPE, * pICCTAG_COLORANT_ORDER_TYPE;

The ICCTAG_COLORANT_ORDER_TYPE structure is used to save a ColorantOrderType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
uColorantsCount | Number of data elements in the buffer pointed to by pColorantsData.
pColorantsData | A pointer to buffer that contains the tag’s data.

Comments

The signature for this tag type is ColorantOrderTypeSig (0x636c726f).


ICCTAG_COLORANT_TABLE_TYPE

ICCTAG_COLORANT_TABLE_TYPE

typedef struct __ICCTAG_COLORANT_TABLE_TYPE
{
ICCTAG_BASE tagBase;
L_IccUInt32Number uColorantsCount;
pICC_COLORANT_TABLE_DATA pColorantsData;
} ICCTAG_COLORANT_TABLE_TYPE, * pICCTAG_COLORANT_TABLE_TYPE;

The ICCTAG_COLORANT_TABLE_TYPE structure is used to save a ColorantTableType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
uColorantsCount | Number of data elements in the buffer pointed to by pColorantsData.
pColorantsData | A pointer to an ICC_COLORANT_TABLE_TYPE structure that contains the tag’s data.

Comments

The signature for this tag type is ColorantTableTypeSig (0x636c7274).


ICCTAG_CURVE_TYPE

ICCTAG_CURVE_TYPE

typedef struct __ICCTAG_CURVE_TYPE
{
ICCTAG_BASE tagBase;
ICC_CURVE Curve;
} ICCTAG_CURVE_TYPE, * pICCTAG_CURVE_TYPE;

The ICCTAG_CURVE_TYPE structure is used to save a CurveType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Curve | A pointer to an ICC_CURVE structure that contains the tag’s data.

Comments

The signature for this tag type is CurveTypeSig (0x63757276).


ICCTAG_DATA_TYPE

ICCTAG_DATA_TYPE

typedef struct __ICCTAG_DATA_TYPE
{
ICCTAG_BASE tagBase;
ICC_DATA Data;
} ICCTAG_DATA_TYPE, * pICCTAG_DATA_TYPE;

The ICCTAG_DATA_TYPE structure is used to save a DataType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Data | A pointer to an ICC_DATA structure that contains the tag’s data.

Comments

The signature for this tag type is DataTypeSig (0x64617461).


ICCTAG_DATE_TIME_TYPE

ICCTAG_DATE_TIME_TYPE

typedef struct __ICCTAG_DATE_TIME_TYPE
{
ICCTAG_BASE tagBase;
ICC_DATE_TIME_NUMBER DateTime;
} ICCTAG_DATE_TIME_TYPE, * pICCTAG_DATE_TIME_TYPE;

The ICCTAG_DATE_TIME_TYPE structure is used to save a DateTimeType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
DateTime | A pointer to an ICC_DATE_TIME_NUMBER structure that contains the tag’s data.

Comments

The signature for this tag type is DateTimeTypeSig (0x6474696D).


ICCTAG_LIST

ICCTAG_LIST

typedef struct _ICCTAG_LIST
{
L_IccUInt32Number uTagCount;
pICCTAG pTags;
} ICCTAG_LIST, * pICCTAG_LIST;

The ICCTAG_LIST structure is used to save a list of all the tags in the ICC profile.

Member | Description
uTagCount | A value that indicates the number of tags contained in the tags list.
pTags | A pointer to a list of ICCTAG structures that contain all the tags in the ICC profile.


ICCTAG_LUT_A_TO_B_TYPE

ICCTAG_LUT_A_TO_B_TYPE, ICCTAG_LUT_B_TO_A_TYPE

typedef struct __ICCTAG_LUT_A2B_B2A_TYPE
{
ICCTAG_BASE tagBase;
L_IccUInt8Number uInputChannels;
L_IccUInt8Number uOutputChannels;
L_IccUInt8Number uPad[2];
L_IccUInt32Number uOffsetToCurveB;
L_IccUInt32Number uOffsetToMatrix;
L_IccUInt32Number uOffsetToCurveM;
L_IccUInt32Number uOffsetToCLUT;
L_IccUInt32Number uOffsetToCurveA;
L_IccUInt8Number * pData;
L_UCHAR * pCurveB;
L_UCHAR * pCurveM;
L_UCHAR * pCurveA;
L_UCHAR * pCLUT;
ICC_MATRIX Matrix;
} ICCTAG_LUT_A_TO_B_TYPE, * pICCTAG_LUT_A_TO_B_TYPE,
ICCTAG_LUT_B_TO_A_TYPE, * pICCTAG_LUT_B_TO_A_TYPE;

The ICCTAG_LUT_A_TO_B_TYPE and ICCTAG_LUT_B_TO_A_TYPE structures are used to save LutAToBType and LutBToAType tags.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
uInputChannels | Number of input channels.
uOutputChannels | Number of output channels.
uPad | Reserved bytes for padding. Must be set to zero.
uOffsetToCurveB | Offset to first "B" curve.
uOffsetToMatrix | Offset to matrix.
uOffsetToCurveM | Offset to first "M" curve.
uOffsetToCLUT | Offset to CLUT.
uOffsetToCurveA | Offset to first "A".
pData | Pointer to a buffer that contains tag’s data.
pCurveB | Pointer to a buffer that contains the B curves data.
pCurveM | Pointer to a buffer that contains the M curves data.
pCurveA | Pointer to a buffer that contains the A curves data.
pCLUT | Pointer to a buffer that contains the CLUT data.
Matrix | Pointer to an ICC_MATRIX structure that contains the Matrix data.

Comments

The signatures for these tag types are LutAtoBTypeSig (0x6D414220) and LutBtoATypeSig (0x6D424120).

Note that when creating one of these tag types using the L_CreateICCTagData function, there is no need to supply the following fields: uOffsetToCurveB, uOffsetToMatrix, uOffsetToCurveM, uOffsetToCLUT, uOffsetToCurveA. Their values will be calculated automatically by the L_CreateICCTagData function.


ICCTAG_LUT16_TYPE

ICCTAG_LUT16_TYPE

typedef struct __ICCTAG_LUT16_TYPE
{
ICCTAG_BASE tagBase;
ICC_LUT16 Lut16;
} ICCTAG_LUT16_TYPE, * pICCTAG_LUT16_TYPE;

The ICCTAG_LUT16_TYPE structure is used to save lut16Type data.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Lut16 | A pointer to an ICC_LUT16 structure that contains the tag’s data.

Comments

The signature for this tag type is Lut16TypeSig (0x6d667432).


ICCTAG_LUT8_TYPE

ICCTAG_LUT8_TYPE

typedef struct __ICCTAG_LUT8_TYPE
{
ICCTAG_BASE tagBase;
ICC_LUT8 Lut8;
} ICCTAG_LUT8_TYPE, * pICCTAG_LUT8_TYPE;

The ICCTAG_LUT8_TYPE structure is used to save lut8Type data.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Lut8 | A pointer to an ICC_LUT8 structure that contains the tag’s data.

Comments

The signature for this tag type is Lut8TypeSig (0x6d667431).


ICCTAG_MEASUREMENT_TYPE

ICCTAG_MEASUREMENT_TYPE

typedef struct __ICCTAG_MEASUREMENT_TYPE
{
ICCTAG_BASE tagBase;
ICC_MEASUREMENT Measurement;
} ICCTAG_MEASUREMENT_TYPE, * pICCTAG_MEASUREMENT_TYPE;

The ICCTAG_MEASUREMENT_TYPE structure is used to save MeasurementType tag data.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Measurement | A pointer to an ICC_MEASUREMENT structure that contains the tag’s data.

Comments

The signature for this tag type is MeasurementTypeSig (0x6D656173).


ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE

ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE

typedef struct __ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE
{
ICCTAG_BASE tagBase;
ICC_MULTI_LOCALIZED_UNICODE MultiLocalizedUnicode;
} ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE, * pICCTAG_MULTI_LOCALIZED_UNICODE_TYPE;

The ICCTAG_MULTI_LOCALIZED_UNICODE_TYPE structure is used to save multiLocalizedUnicodeType tag type.

Member | Description
tagBase | A pointer to ICCTAG_BASE structure that specifies the ICC signature.
MultiLocalizedUnicode | A pointer to ICC_MULTI_LOCALIZED_UNICODE structure that contains the tag’s data.

Comments

The signature for this tag type is MultiLocalizedUnicodeTypeSig (0x6D6C7563).


ICCTAG_NAMED_COLOR2_TYPE

ICCTAG_NAMED_COLOR2_TYPE

typedef struct __ICCTAG_NAMED_COLOR2_TYPE
{
ICCTAG_BASE tagBase;
ICC_NAMED_COLOR2 NColor;
} ICCTAG_NAMED_COLOR2_TYPE, * pICCTAG_NAMED_COLOR2_TYPE;

The ICCTAG_NAMED_COLOR2_TYPE structure is used to save a NamedColor2Type tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
NColor | A pointer to an ICC_NAMED_COLOR2 structure that contains the tag’s data.

Comments

The signature for this tag type is NAMEDCOLOR2TYPESIG.


ICCTAG_PARAMETRIC_CURVE_TYPE

ICCTAG_PARAMETRIC_CURVE_TYPE

typedef struct __ICCTAG_PARAMETRIC_CURVE_TYPE
{
ICCTAG_BASE tagBase;
ICC_PARAMETRIC_CURVE ParametricCurve;
} ICCTAG_PARAMETRIC_CURVE_TYPE, * pICCTAG_PARAMETRIC_CURVE_TYPE;

The ICCTAG_PARAMETRIC_CURVE_TYPE structure is used to save a ParametricCurveType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
ParametricCurve | A pointer to an ICC_PARAMETRIC_CURVE structure that contains the tag’s data.

Comments

The signature for this tag type is ParametricCurveTypeSig (0x70617261).


ICCTAG_PROFILE_SEQ_DESC_TYPE

ICCTAG_PROFILE_SEQ_DESC_TYPE

typedef struct __ICCTAG_PROFILE_SEQ_DESC_TYPE
{
ICCTAG_BASE tagBase;
ICC_PROFILE_SEQ_DESC Desc;
} ICCTAG_PROFILE_SEQ_DESC_TYPE, * pICCTAG_PROFILE_SEQ_DESC_TYPE;

The ICCTAG_PROFILE_SEQ_DESC_TYPE structure is used to save a ProfileSequenceDescType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
Desc | A pointer to an ICC_PROFILE_SEQ_DESC structure that contains the tag’s data.

Comments

The signature for this tag type is ProfileSequenceDescTypeSig (0x70736571).


ICCTAG_RESPONSE_CURVE_SET16_TYPE

ICCTAG_RESPONSE_CURVE_SET16_TYPE

typedef struct __ICCTAG_RESPONSE_CURVE_SET16_TYPE
{
ICCTAG_BASE tagBase;
ICC_RESPONSE_CURVE ResponseCurve;
} ICCTAG_RESPONSE_CURVE_SET16_TYPE, * pICCTAG_RESPONSE_CURVE_SET16_TYPE;

The ICCTAG_RESPONSE_CURVE_SET16_TYPE structure is used to save a ResponseCurveSet16Type tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
ResponseCurve | Pointer to an ICC_RESPONSE_CURVE structure that contains the tag’s data.

Comments

The signature for this tag type is ResponseCurveSet16TypeSig (0x72637332).

The purpose of this tag type is to provide a mechanism to relate physical colorant amounts with the normalized device codes produced by lut8Type, lut16Type, lutAToBType or lutBToAType tags so that corrections can be made for variation in the device without having to produce a new profile.


ICCTAG_S15_FIXED16_ARRAY_TYPE

ICCTAG_S15_FIXED16_ARRAY_TYPE

typedef struct __ICCTAG_S15_FIXED16_ARRAY_TYPE
{
ICCTAG_BASE tagBase;
L_IccS15Fixed16Number * pData;
L_UINT uDataElementsCount;
} ICCTAG_S15_FIXED16_ARRAY_TYPE, * pICCTAG_S15_FIXED16_ARRAY_TYPE;

The ICCTAG_S15_FIXED16_ARRAY_TYPE structure is used to save an s15Fixed16ArrayType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is S15Fixed16ArrayTypeSig (0x73663332).

This type represents an array of generic 4-byte/32-bit elements.

When used inside a chromaticAdaptationTag, it must have 9 elements as stated in the ICC.1:2004-10 ICC specification, page 30.


ICCTAG_SIGNATURE_TYPE

ICCTAG_SIGNATURE_TYPE

typedef struct __ICCTAG_SIGNATURE_TYPE
{
ICCTAG_BASE tagBase;
L_UINT32 uSignature;
} ICCTAG_SIGNATURE_TYPE, * pICCTAG_SIGNATURE_TYPE;

The ICCTAG_SIGNATURE_TYPE structure is used to save SignatureType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
uSignature | A value that represents a four-byte sequence signature, For a list of possible values, refer to ICCTECHNOLOGYSIGNATURE.

Comments

The signature for this tag type is SignatureTypeSig (0x73696720).


ICCTAG_TEXT_TYPE

ICCTAG_TEXT_TYPE

typedef struct __ICCTAG_TEXT_TYPE
{
ICCTAG_BASE tagBase;
L_Icc7BitAscii * pTextData;
} ICCTAG_TEXT_TYPE, * pICCTAG_TEXT_TYPE;

The ICCTAG_TEXT_TYPE structure is used to save a TextType tag.

Member | Description
tagBase | A pointer to ICCTAG_BASE structure that specifies the ICC signature.
pTextData | A pointer to a buffer that contains a string of 7-bit ASCII characters.

Comments

The signature for this tag type is TextTypeSig (0x74657874).


ICCTAG_U16_FIXED16_ARRAY_TYPE

ICCTAG_U16_FIXED16_ARRAY_TYPE

typedef struct __ICCTAG_U16_FIXED16_ARRAY_TYPE
{
ICCTAG_BASE tagBase;
L_IccU16Fixed16Number * pData;
L_UINT uDataElementsCount;
} ICCTAG_U16_FIXED16_ARRAY_TYPE, * pICCTAG_U16_FIXED16_ARRAY_TYPE;

The ICCTAG_U16_FIXED16_ARRAY_TYPE structure is used to save a u16Fixed16ArrayType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is U16Fixed16ArrayTypeSig (0x75663332).

This type represents an array of generic 4-byte/32-bit elements.


ICCTAG_UINT16_ARRAY_TYPE

ICCTAG_UINT16_ARRAY_TYPE

typedef struct __ICCTAG_UINT16_ARRAY_TYPE
{
ICCTAG_BASE tagBase;
L_IccUInt16Number * pData;
L_UINT uDataElementsCount;
} ICCTAG_UINT16_ARRAY_TYPE, * pICCTAG_UINT16_ARRAY_TYPE;

The ICCTAG_UINT16_ARRAY_TYPE structure is used to save a uInt16ArrayType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is UInt16ArrayTypeSig (0x75693136).

This type represents an array of generic 2-byte/16-bit elements.


ICCTAG_UINT32_ARRAY_TYPE

ICCTAG_UINT32_ARRAY_TYPE

typedef struct __ICCTAG_UINT32_ARRAY_TYPE
{
ICCTAG_BASE tagBase;
L_IccUInt32Number * pData;
L_UINT uDataElementsCount;
} ICCTAG_UINT32_ARRAY_TYPE, * pICCTAG_UINT32_ARRAY_TYPE;

The ICCTAG_UINT32_ARRAY_TYPE structure is used to save a uInt32ArrayType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is UInt32ArrayTypeSig (0x75693332).

This type represents an array of generic 4-byte/32-bit elements.


ICCTAG_UINT64_ARRAY_TYPE

ICCTAG_UINT64_ARRAY_TYPE

typedef struct __ICCTAG_UINT64_ARRAY_TYPE
{
ICCTAG_BASE tagBase;
L_IccUInt64Number * pData;
L_UINT uDataElementsCount;
} ICCTAG_UINT64_ARRAY_TYPE, * pICCTAG_UINT64_ARRAY_TYPE;

The ICCTAG_UINT64_ARRAY_TYPE structure is used to save a uInt64ArrayType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is UInt64ArrayTypeSig (0x75693634).

This type represents an array of generic 8-byte/64-bit elements.


ICCTAG_UINT8_ARRAY_TYPE

ICCTAG_UINT8_ARRAY_TYPE

typedef struct __ICCTAG_UINT8_ARRAY_TYPE
{
ICCTAG_BASE tagBase;
L_IccUInt8Number * pData;
L_UINT uDataElementsCount;
} ICCTAG_UINT8_ARRAY_TYPE, * pICCTAG_UINT8_ARRAY_TYPE;

The ICCTAG_UINT8_ARRAY_TYPE structure is used to save a uInt8ArrayType tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataElementsCount | A value that indicates the number of data elements in the pData pointer.

Comments

The signature for this tag type is UInt8ArrayTypeSig (0x75693038).

This type represents an array of generic 1-byte/8-bit elements.


ICCTAG_UNKNOWN_TYPE

ICCTAG_UNKNOWN_TYPE

typedef struct __ICCTAG_UNKNOWN_TYPE
{
ICCTAG_BASE tagBase;
L_Icc7BitAscii * pData;
L_UINT uDataSize;
} ICCTAG_UNKNOWN_TYPE, * pICCTAG_UNKNOWN_TYPE;

The ICCTAG_UNKNOWN_TYPE structure is used to save an unknown (or private) tag.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pData | Pointer to a buffer that contains the tag’s data.
uDataSize | A value that indicates the size of the pData pointer in bytes.

Comments

A private signature is used as the signature for this tag type.


ICCTAG_VIEW_COND_TYPE

ICCTAG_VIEW_COND_TYPE

typedef struct __ICCTAG_VIEW_COND_TYPE
{
ICCTAG_BASE tagBase;
ICC_VIEW_COND ViewCondition;
} ICCTAG_VIEW_COND_TYPE, * pICCTAG_VIEW_COND_TYPE;

The ICCTAG_VIEW_COND_TYPE structure is used to save a ViewingConditionsType tag.

Member | Description
tagBase | A pointer to ICCTAG_BASE structure that specifies the ICC signature.
ViewCondition | Pointer to ICC_VIEW_COND structure that contains the tag’s data.

Comments

The signature for this tag type is ViewingConditionsTypeSig (0x76696577).


ICCTAG_XYZ_TYPE

ICCTAG_XYZ_TYPE

typedef struct __ICCTAG_XYZ_TYPE
{
ICCTAG_BASE tagBase;
pICC_XYZ_NUMBER pXYZNumData;
L_UINT uXYZNumCount;
} ICCTAG_XYZ_TYPE, * pICCTAG_XYZ_TYPE;

The ICCTAG_XYZ_TYPE structure is used to save an XYZType tag type.

Member | Description
tagBase | A pointer to an ICCTAG_BASE structure that specifies the ICC signature.
pXYZNumData | Pointer to a buffer that will contain the tag’s data.
uXYZNumCount | A value that indicates number of XYZ elements in this tag data.

Comments

The signature for this tag type is XYZTypeSig (0x58595A20).


ICCTAGSIGNATURE

ICCTAGSIGNATURE

typedef enum
{
AToB0Tag = 0x41324230L, /* 'A2B0' */
AToB1Tag = 0x41324231L, /* 'A2B1' */
AToB2Tag = 0x41324232L, /* 'A2B2' */
BlueMatrixColumnTag = 0x6258595AL, /* 'bXYZ' */
BlueTRCTag = 0x62545243L, /* 'bTRC' */
BToA0Tag = 0x42324130L, /* 'B2A0' */
BToA1Tag = 0x42324131L, /* 'B2A1' */
BToA2Tag = 0x42324132L, /* 'B2A2' */
CalibrationDateTimeTag = 0x63616C74L, /* 'calt' */
CharTargetTag = 0x74617267L, /* 'targ' */
ChromaticAdaptationTag = 0x63686164L, /* 'chad' */
ChromaticityTag = 0x6368726DL, /* 'chrm' */
ColorantOrderTag = 0x636C726FL, /* 'clro' */
ColorantTableTag = 0x636C7274L, /* 'clrt' */
ColorantTableOutTag = 0x636C6F74L, /* 'clot' */
CopyrightTag = 0x63707274L, /* 'cprt' */
DeviceMfgDescTag = 0x646D6E64L, /* 'dmnd' */
DeviceModelDescTag = 0x646D6464L, /* 'dmdd' */
GamutTag = 0x67616D74L, /* 'gamt' */
GrayTRCTag = 0x6B545243L, /* 'kTRC' */
GreenMatrixColumnTag = 0x6758595AL, /* 'gXYZ' */
GreenTRCTag = 0x67545243L, /* 'gTRC' */
LuminanceTag = 0x6C756D69L, /* 'lumi' */
MeasurementTag = 0x6D656173L, /* 'meas' */
MediaBlackPointTag = 0x626B7074L, /* 'bkpt' */
MediaWhitePointTag = 0x77747074L, /* 'wtpt' */
NamedColor2Tag = 0x6E636C32L, /* 'ncl2' */
OutputResponseTag = 0x72657370L, /* 'resp' */
Preview0Tag = 0x70726530L, /* 'pre0' */
Preview1Tag = 0x70726531L, /* 'pre1' */
Preview2Tag = 0x70726532L, /* 'pre2' */
ProfileDescriptionTag = 0x64657363L, /* 'desc' */
ProfileSequenceDescTag = 0x70736571L, /* 'pseq' */
RedMatrixColumnTag = 0x7258595AL, /* 'rXYZ' */
RedTRCTag = 0x72545243L, /* 'rTRC' */
TechnologyTag = 0x74656368L, /* 'tech' */
ViewingCondDescTag = 0x76756564L, /* 'vued' */
ViewingConditionsTag = 0x76696577L /* 'view' */
} ICCTAGSIGNATURE;

This enumerated type indicates the tag signatures for all ICC tags.


ICCTAGTYPESIGNATURE

ICCTAGTYPESIGNATURE

typedef enum
{
ChromaticityTypeSig = 0x6368726DL, /* 'chrm' */
ColorantOrderTypeSig = 0x636c726fL, /* 'clro' */
ColorantTableTypeSig = 0x636c7274L, /* 'clrt' */
CurveTypeSig = 0x63757276L, /* 'curv' */
DataTypeSig = 0x64617461L, /* 'data' */
DateTimeTypeSig = 0x6474696DL, /* 'dtim' */
Lut16TypeSig = 0x6d667432L, /* 'mft2' */
Lut8TypeSig = 0x6d667431L, /* 'mft1' */
LutAtoBTypeSig = 0x6D414220L, /* 'mAB' */
LutBtoATypeSig = 0x6D424120L, /* 'mBA' */
MeasurementTypeSig = 0x6D656173L, /* 'meas' */
MultiLocalizedUnicodeTypeSig = 0x6D6C7563L, /* 'mluc' */
NamedColor2TypeSig = 0x6E636C32L, /* 'ncl2' */
ParametricCurveTypeSig = 0x70617261L, /* 'para' */
ProfileSequenceDescTypeSig = 0x70736571L, /* 'pseq' */
ResponseCurveSet16TypeSig = 0x72637332L, /* 'rcs2' */
S15Fixed16ArrayTypeSig = 0x73663332L, /* 'sf32' */
SignatureTypeSig = 0x73696720L, /* 'sig ' */
TextTypeSig = 0x74657874L, /* 'text' */
U16Fixed16ArrayTypeSig = 0x75663332L, /* 'uf32' */
UInt16ArrayTypeSig = 0x75693136L, /* 'ui16' */
UInt32ArrayTypeSig = 0x75693332L, /* 'ui32' */
UInt64ArrayTypeSig = 0x75693634L, /* 'ui64' */
UInt8ArrayTypeSig = 0x75693038L, /* 'ui08' */
ViewingConditionsTypeSig = 0x76696577L, /* 'view' */
XYZTypeSig = 0x58595A20L /* 'XYZ ' */
} ICCTAGTYPESIGNATURE;

This enumerated type indicates the tag type signatures for all ICC tag types.


ICCTECHNOLOGYSIGNATURE

ICCTECHNOLOGYSIGNATURE

typedef enum
{
FilmScanner = 0x6673636EL, /* 'fscn' */
DigitalCamera = 0x6463616DL, /* 'dcam' */
ReflectiveScanner = 0x7273636EL, /* 'rscn' */
InkJetPrinter = 0x696A6574L, /* 'ijet' */
ThermalWaxPrinter = 0x74776178L, /* 'twax' */
ElectrophotographicPrinter = 0x6570686FL, /* 'epho' */
ElectrostaticPrinter = 0x65737461L, /* 'esta' */
DyeSublimationPrinter = 0x64737562L, /* 'dsub' */
PhotographicPaperPrinter = 0x7270686FL, /* 'rpho' */
FilmWriter = 0x6670726EL, /* 'fprn' */
VideoMonitor = 0x7669646DL, /* 'vidm' */
VideoCamera = 0x76696463L, /* 'vidc' */
ProjectionTelevision = 0x706A7476L, /* 'pjtv' */
CRTDisplay = 0x43525420L, /* 'CRT ' */
PMDisplay = 0x504D4420L, /* 'PMD ' */
AMDisplay = 0x414D4420L, /* 'AMD ' */
PhotoCD = 0x4B504344L, /* 'KPCD' */
PhotoImageSetter = 0x696D6773L, /* 'imgs' */
Gravure = 0x67726176L, /* 'grav' */
OffsetLithography = 0x6F666673L, /* 'offs' */
Silkscreen = 0x73696C6BL, /* 'silk' */
Flexography = 0x666C6578L /* 'flex' */
} ICCTECHNOLOGYSIGNATURE;

This enumerated type is used within the ICC_TAG_SIGNATURE_TYPE structure to indicate the technology signature.


LAB_PARAMS

LAB_PARAMS

typedef struct
{
L_UINT uStructSize;
L_INT nMask;
L_INT L_offset;
L_INT L_range;
L_INT a_offset;
L_INT a_range;
L_INT b_offset;
L_INT b_range;
} LAB_PARAMS, *LPLAB_PARAMS;

The LAB_PARAMS structure provides information about CIELab conversion properties.

Parameter | Description
uStructSize | Size of this structure.
nMask | Masking value:
 | Value | Meaning
 | LAB_L_OFFSET | Change L_offset value
 | LAB_L_RANGE | Change L_range value
 | LAB_a_OFFSET | Change a_offset value
 | LAB_a_RANGE | Change a_range value
 | LAB_b_OFFSET | Change b_offset value
 | LAB_b_RANGE | Change b_range value
L_offset | L component offset
L_range | L componnt range
a_offset | a component offset
a_range | a Component range
b_offset | b Component offset
b_range | b Component range

Comments

The gamut capacity is expressed as an offset and range, with the exception of the minimum and maximum values. For example, in the T.42 CIELab, the communication conversion can be expressed as:

L_offset = 0;
L_range = 100
a_offset = 128
a_range = 170
b_offset = 96
b_range = 200

For more information on the CIELab color conversion, refer to www.itu.int.

LAB_PARAMS is used with the CONVERSION_PARAM structure.

The mask value will be used only when updating the CMYK conversion using L_ClrSetConversionParams function.


MEMICCPROFILE

MEMICCPROFILE

typedef struct _MEMICCPROFILE
{
L_UINT uStructSize ;
L_UCHAR* pData;
L_SIZE_T uDataSize ;
} MEMICCPROFILE, * pMEMCCPROFILE;

The MEMICCPROFILE structure provides information about an embedded ICC profile.

Member | Description
uStructSize | Size of this structure. Set this to sizeof(MEMICCPROFILE).
pData | Pointer to the actual ICC data.
uDataSize | Size of the ICC data pointed to by pData.

Comments

This structure is used by the following functions:

L_FreeICCProfile

L_InitICCProfile

L_LoadICCProfile


WHITEPOINT

WHITEPOINT

typedef struc _WHITEPOINT
{
L_INT nWhitePoint;
L_DOUBLE xWhite;
L_DOUBLE yWhite;
} WHITEPOINT, * LPWHITEPOINT;

The WHITEPOINT structure specifies the spectrum of the white color.

Parameter | Description
nWhitePoint | Common white points. Possible values:
 | Value | Meaning
 | CIELAB_D50 | D50 white point.
 | CIELAB_D55 | D55 white point.
 | CIELAB_D65 | D65 white point.
 | CIELAB_D75 | D75 white point.
 | CIELAB_D93 | D93 white point.
 | CIELAB_CUSTOM | Use the values of xWhite and yWhite members.
 | CIELAB_DEFAULT | Dfault (D55) white point.
xWhite | X value between 0.0 and 1.0.
yWhite | y value between 0.0 and 1.0.

Comments

LPWHITEPOINT is a pointer to a WHITEPOINT structure. Where the function parameter type is LPWHITEPOINT, you can declare a WHITEPOINT variable, update the structure's fields, and pass the variable's address. Declaring a LPWHITEPOINT variable is necessary only if your program requires a pointer.

WHITEPOINT is used with the CONVERSION_PARAMS structure.

Any of the predefined white points can be used, or custom x and y values can be used in an xyY system with CIELAB_CUSTOM, Y is always 1.0.


YUV_PARAMS

YUV_PARAMS

typedef struct
{
L_UINT uStructSize;
L_INT nMask;
L_INT nUh;
L_INT nUv;
L_INT nVh;
L_INT nVv;
L_INT *pOffsets;
L_INT nMacroPixel;
L_INT nRange;
L_BOOL bPlanar;
} YUV_PARAMS, *LPYUV_PARAMS;

The YUV_PARAMS structure provides information about YUV conversion properties. It is used to describe some YUV format to be converted to another color conversion. For more information see Generic YUV Conversion.

Parameter | Description
uStructSize | Size of this structure
nMask | Masking value. This can be any combination of the following values:
 | Value | Meaning
 | YUV_UH | Change the nUh value
 | YUV_UV | Change the nUv value
 | YUV_VH | Change the nVh value
 | YUV_VV | Change the nvV value
 | YUV_OFFSETS | Change the pOffsets value
 | YUV_MACROPIXEL | Change the nMacroPixel value
 | YUV_RANGE | Change the nRange value
nUh | Integer that represents the horizontal subsampling period of U
nUv | Integer that represents the vertical subsampling period of U.
nVh | Integer that represents the horizontal subsampling period of V.
nVv | Integer that represents the vertical subsampling period of V.

pOffsets | Pointer to integer array that represents offsets of the byte ordering for the proposed YUV format. When bPlanar is TRUE, the only useful data is pOffsets[0] which will indicate what is the arrangement of the YUV buffer. Possible values are:
 | Value | Meaning
 | PLANAR_YUV | Planes order, Y, U, V
 | PLANAR_YVU | Planes order, Y, V, U
 | PLANAR_UYV | Planes order, U, Y, V
 | PLANAR_UVY | Planes order, U, V, Y
 | PLANAR_VYU | Planes order, V, Y, U
 | PLANAR_VUY | Planes order, V, U, Y
nMacroPixel | Macropixel size, which is the number of pixels in the unit pixels group.
nRange | Integer represents the range of values in the input buffer; full range, or 16-240 (YUVRANGE_FULL, and YUVRANGE_16_240).
bPlanar | Value that indicates whether the buffer consists of the Y plane, V plane and U plane. Possible values are:
 | Value | Meaning
 | TRUE | The buffer consists of the Y, U, and V planes.
 | FALSE | The buffer does not consist of the Y, U, and V planes.

Comments

LPYUV_PARAMS is a pointer to a YUV_PARAMS structure. Where the function parameter type is LPYUV_PARAMS, you can declare a YUV_PARAMS variable, update the structure's fields, and pass the variable's address. Declaring a LPYUV_PARAMS variable is necessary only if your program requires a pointer.

YUV_PARAMS is used with the CONVERSION_PARAMS structure.


Return Codes

Return Codes

For a list of all possible return codes for LEADTOOLS Color Conversion functions, refer to LEADTOOLS C DLL Return Codes in the Raster Imaging help file.


L_2bFixed2bNumberToDouble

L_2bFixed2bNumberToDouble

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

L_LTCLR_API L_DOUBLE L_2bFixed2bNumberToDouble(uNumber)

L_UINT32 uNumber;

/* integer value */

Converts a 2-bytes fixed, 2-bytes fraction number format into a double fractional value.

Parameter | Description
uNumber | Value that represents the 2-bytes fixed, 2-bytes fraction number value to convert.

Returns

A double value that contains a fraction number representing the value passed to the function.

Comments

This function is used for ICC profiles purposes. The number passed must be one of the following types: L_IccS15Fixed16Number or L_IccU16Fixed16Number.

Each of these types is 4-bytes, divided into 2-bytes that contain the fixed part of the number, and 2-bytes that contain the fractional part of the number.

The (2b) found in the function name means (2-bytes).

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

This example takes a 2-bytes fixed, 2-bytes fraction value, and then converts it into double.

L_DOUBLE TowbFixed2bNumberToDoubleExample(L_IccU16Fixed16Number uNumber, L_INT* nRet)
{
   *nRet = SUCCESS;
   return L_2bFixed2bNumberToDouble(uNumber);
}


L_ClrConvert

L_ClrConvert

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

L_LTCLR_API L_INT L_ClrConvert(ClrHandle, pSrc, pDst, nWidth, nHeight, nInAlign, nOutAlign)

L_HANDLE ClrHandle; | /* handle to the color conversion */
L_UCHAR * pSrc; | /* pointer to the input buffer */
L_UCHAR * pDst; | /* pointer to the output buffer */
L_INT nWidth; | /* width of pixels to be processed */
L_INT nHeight; | /* height of pixels to be processed */
L_INT nInAlign; | /* each scanline in the input buffer is multiple of nInAlign bytes */
L_INT nOutAlign; | /* each scan line in the output buffer is multiple of nOutAlign bytes */

Converts image data in a buffer from one color conversion model to another.

Parameter | Description
ClrHandle | Handle to an existing color conversion. This handle is obtained by calling the L_ClrInit function.
pSrc | Pointer to the buffer holding the input data.
pDst | Pointer to the buffer that will hold the converted data.
nWidth | Width of pixels to be processed.
nHeight | Height of pixels to be processed.
nInAlign | Each scanline in the input buffer is a multiple of nInAlign bytes.
nOutAlign | Each scan line in the output buffer is a multiple of nOutAlign bytes.

Returns

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

Comments

Conversion is done by setting the active method value specified in the CONVERSION_PARAMS structure when calling L_ClrInit. To change the active method, use L_ClrSetConversionParams. Only methods supported by the initialized converter should be specified.

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

See Also

Functions: | L_ClrInit
Topics: | Conversion Process
 | Color Conversion C DLL Function Groups

Example

For an example, refer to L_ClrInit.


L_ClrConvertDirect

L_ClrConvertDirect

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

L_LTCLR_API L_INT L_ClrConvertDirect(nSrcFormat, nDstFormat, pSrcBuf, pDstBuf, nWidth, nHeight, nInAlign, nOutAlign)

L_INT nSrcFormat; | /* format of the input data */
L_INT nDstFormat; | /* format of the output data */
L_UCHAR * pSrcBuf; | /* pointer to the input buffer */
L_UCHAR * pDstBuf; | /* pointer to the output buffer */
L_INT nWidth; | /* width of pixels to be processed */
L_INT nHeight; | /* height of pixels to be processed */
L_INT nInAlign; | /* each scanline in the input buffer is a multiple of nInAlign bytes */
L_INT nOutAlign; | /* each scan line in the output buffer is a multiple of nOutAlign bytes */

Converts image data in a buffer from one color conversion model to another directly using built in algorithms.

Parameter | Description
nSrcFormat | Format of the source data. Possible values are:
 | Value | Meaning
 | CCS_RGB | [0x00] Color conversion is RGB.
 | CCS_YUV | [0x01] Color conversion is YUV.
 | CCS_CMYK | [0x02] Color conversion is CMYK.
 | CCS_HSV | [0x03] Color conversion is HSV.
 | CCS_HLS | [0x04] Color conversion is HLS.
 | CCS_YIQ | [0x05] Color conversion is YIQ.
 | CCS_CMY | [0x06] Color conversion is CMY.
 | CCS_LAB | [0x07] Color conversion is CIELAB.
 | CCS_XYZ | [0x08] Color conversion is CIEXYZ.
 | CCS_YCCK | [0x0B] Color conversion is YCCK.
 | CCS_BGR | [0x0C] Color conversion is BGR.
 | CCS_UYVY | [0x0E] Color conversion is UYVY.
 | CCS_YUY2 | [0x09] Color conversion is YUY2.
 | CCS_YVU9 | [0x0A] Color conversion is YVU9.
 | CCS_YCC | [0x0F] Color conversion is YCC.
nDstFormat | Format of the output data. Possible values are:
 | Value | Meaning
 | CCS_RGB | [0x00] Color conversion is RGB.
 | CCS_YUV | [0x01] Color conversion is YUV.
 | CCS_CMYK | [0x02] Color conversion is CMYK.
 | CCS_HSV | [0x03] Color conversion is HSV.
 | CCS_HLS | [0x04] Color conversion is HLS.
 | CCS_YIQ | [0x05] Color conversion is YIQ.
 | CCS_CMY | [0x06] Color conversion is CMY.
 | CCS_LAB | [0x07] Color conversion is CIELAB.
 | CCS_XYZ | [0x08] Color conversion is CIEXYZ.
 | CCS_BGR | [0x0C] Color conversion is BGR.
 | CCS_UYVY | [0x0E] Color conversion is UYVY.
 | CCS_YUY2 | [0x09] Color conversion is YUY2.
 | CCS_YVU9 | [0x0A] Color conversion is YVU9.
 | CCS_YCC | [0x0F] Color conversion is YCC.
pSrcBuf | Pointer to the buffer holding the input data.
pDstBuf | Pointer to the buffer that will hold the converted data.
nWidth | Width of pixels to be processed.
nHeight | Height of pixels to be processed.
nInAlign | Each scanline in the input buffer is a multiple of nInAlign bytes.
nOutAlign | Each scan line in the output buffer is a multiple of nOutAlign bytes.

Returns

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

Comments

Converting from any color space to YCCK color space is currently not supported.

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

See Also

Functions: | L_ClrConvert
Topics: | Programming with LEADTOOLS Color Conversion Functions
 | Color Conversion C DLL Function Groups

Example

L_INT ClrConvertDirectExample(
   L_UCHAR* pInput,
   L_UCHAR* pOutput,
   L_INT nWidth,
   L_INT nHeight)
{
   L_INT nRet;

   /* direct conversion using built in options */
   nRet = L_ClrConvertDirect(CCS_CMYK, /* input color conversion  */
      CCS_RGB,    /* output color conversion */
      pInput,     /* input buffer            */
      pOutput,    /* output buffer           */
      nWidth,     /* pixels width            */
      nHeight,    /* pixels height           */
      0,          /* 0 bytes align           */
      0);         /* 0 bytes align           */

   return nRet;
}


L_ClrConvertDirectToBitmap

L_ClrConvertDirectToBitmap

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

L_LTCLR_API L_INT L_ClrConvertDirectToBitmap(nSrcFormat, nDstFormat, pSrcBuf, pBitmap, uStructSize, nWidth, nHeight, nInAlign, nOutAlign)

L_INT nSrcFormat; | /* format of the input data */
L_INT nDstFormat; | /* format of the output data */
L_UCHAR * pSrcBuf; | /* pointer to the input buffer */
pBITMAPHANDLE * pBitmap; | /* pointer to the output LEAD bitmap */
L_UINT uStructSize; | /* size in bytes, of pBitmap */
L_INT nWidth; | /* width of pixels to be processed */
L_INT nHeight; | /* height of pixels to be processed */
L_INT nInAlign; | /* each scanline in the input buffer is a multiple of nInAlign bytes */
L_INT nOutAlign; | /* each scan line in the output buffer is a multiple of nOutAlign bytes */

Converts image data in a buffer from one color conversion model to RGB\BGR directly using built in algorithms, and sets the output as a LEAD bitmap.

Parameter | Description
nSrcFormat | Format of the source data. Possible values are:
 | Value | Meaning
 | CCS_RGB | [0x00] Color conversion is RGB.
 | CCS_YUV | [0x01] Color conversion is YUV.
 | CCS_CMYK | [0x02] Color conversion is CMYK.
 | CCS_HSV | [0x03] Color conversion is HSV.
 | CCS_HLS | [0x04] Color conversion is HLS.
 | CCS_YIQ | [0x05] Color conversion is YIQ.
 | CCS_CMY | [0x06] Color conversion is CMY.
 | CCS_LAB | [0x07] Color conversion is CIELAB.
 | CCS_XYZ | [0x08] Color conversion is CIEXYZ.
 | CCS_YCCK | [0x0B] Color conversion is YCCK.
 | CCS_BGR | [0x0C] Color conversion is BGR.
 | CCS_UYVY | [0x0E] Color conversion is UYVY.
 | CCS_YUY2 | [0x09] Color conversion is YUY2.
 | CCS_YVU9 | [0x0A] Color conversion is YVU9.
 | CCS_YCC | [0x0F] Color conversion is YCC.
 | CCS_IHS | [0x10] Color conversion is IHS.

nDstFormat | Format of the output data. Possible values are:
 | Value | Meaning
 | CCS_RGB | [0x00] Color conversion is RGB.
 | CCS_BGR | [0x0C] Color conversion is BGR.
pSrcBuf | Pointer to the buffer holding the input data.
pBitmap | Pointer to the LEAD bitmap that will hold the converted data.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nWidth | Width of pixels to be processed.
nHeight | Height of pixels to be processed.
nInAlign | Each scanline in the input buffer is a multiple of nInAlign bytes.
nOutAlign | Each scanline in the output buffer is a multiple of nOutAlign bytes.

Returns

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

Comments

This function works only for conversion to BGR or RGB color space formats.

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

See Also

Functions: | L_ClrConvert
Topics: | Programming with LEADTOOLS Color Conversion Functions
 | Color Conversion C DLL Function Groups

Example

L_INT ClrConvertDirectToBitmapExample(
   L_UCHAR* pInput,
   BITMAPHANDLE* pBitmap,
   L_INT nWidth,
   L_INT nHeight)
{
   L_INT nRet;

   /* direct conversion using built in options */
   nRet = L_ClrConvertDirectToBitmap(CCS_CMYK, /* input color conversion  */
      CCS_RGB,    /* output color conversion */
      pInput,     /* input buffer            */
      pBitmap,    /* output bitmap           */
      sizeof(BITMAPHANDLE),
      nWidth,     /* pixels width            */
      nHeight,    /* pixels height           */
      0,          /* 0 bytes align           */
      0);         /* 0 bytes align           */

   return nRet;
}


L_ClrConvertToBitmap

L_ClrConvertToBitmap

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

L_LTCLR_API L_INT L_ClrConvertToBitmap(ClrHandle, pSrcBuf, pBitmap, uStructSize, nWidth, nHeight, nInAlign, nOutAlign)

L_HANDLE ClrHandle; | /* handle to the color conversion */
L_UCHAR * pSrcBuf; | /* pointer to the input buffer */
pBITMAPHANDLE * pBitmap; | /* pointer to the output LEAD bitmap */
L_UINT uStructSize; | /* size, in bytes of pBitmap */
L_INT nWidth; | /* width of pixels to be processed */
L_INT nHeight; | /* height of pixels to be processed */
L_INT nInAlign; | /* each scanline in the input buffer is a multiple of nInAlign bytes */
L_INT nOutAlign; | /* each scan line in the output buffer is a multiple of nOutAlign bytes */

Converts image data in a buffer from one color conversion model to RGB\BGR, and sets it as a LEAD bitmap.

Parameter | Description
ClrHandle | Handle to an existing color conversion. This handle is obtained by calling the L_ClrInit function.
pSrcBuf | Pointer to the buffer holding the input data.
pBitmap | Pointer to the buffer that will hold the converted data bitmap.
uStructSize | Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).
nWidth | Width of pixels to be processed.
nHeight | Height of pixels to be processed.
nInAlign | Each scanline in the input buffer is a multiple of nInAlign bytes.
nOutAlign | Each scanline in the output buffer is a multiple of nOutAlign bytes.

Returns

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

Comments

Conversion is done by setting the active method value specified in the CONVERSION_PARAMS structure when calling L_ClrInit. To change the active method, use L_ClrSetConversionParams. Only methods supported by the initialized converter should be specified.

The conversion is done if it was initialized with BGR or RGB Color Spaces as the destination.

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

See Also

Functions: | L_ClrInit
Topics: | Conversion Process
 | Color Conversion C DLL Function Groups

Example

This example converts a CMYK bitmap buffer into RGB bitmap.

L_INT ClrConvertToBitmapExample(
   L_UCHAR* pInput,
   pBITMAPHANDLE pBitmap,
   L_INT nWidth,
   L_INT nHeight)
{
   L_INT nRet;

   /* Color Handle */
   HANDLE ClrHandle = NULL;

   /* initialize the color conversion */
   nRet = L_ClrInit(&ClrHandle, CCS_CMYK, CCS_RGB, NULL);
   if(nRet != SUCCESS)
      return nRet;

   /* convert the image buffer */
   nRet = L_ClrConvertToBitmap(ClrHandle, pInput, pBitmap, sizeof(BITMAPHANDLE), nWidth, nHeight, 0, 0);
   if(nRet != SUCCESS)
      return nRet;

   /* free the conversion */
   nRet = L_ClrFree(ClrHandle);
   if(nRet != SUCCESS)
      return nRet;

   return SUCCESS;
}


L_ClrDlg

L_ClrDlg

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

L_LTCLR_API L_INT L_ClrDlg(nDlg, hWnd, pClrHandle, pParams)

L_INT nDlg; | /* dialog constant */
L_HANDLE hWnd; | /* handle to the parent window */
L_HANDLE * pClrHandle; | /* pointer to the output color handle */
LPCONVERSION_PARAMS pParams; | /* pointer to the output conversion params */

Displays a color space dialog box to initialize, and creates a color handle and CONVERSION_PARAMS data.

Parameter | Description
nDlg | The color space dialog to display. Possible values are:
 | Value | Meaning
 | DLG_CMYK | CMYK dialog.
 | DLG_LAB | LAB dialog.
hWnd | Handle to parent window.
pClrHandle | Pointer to color handle to be set by the dialog. Pass NULL if it is not needed.
pParams | Pointer to a CONVERSION_PARAMS structure to be set by the dialog. Pass NULL if it is not needed.

Returns

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

Comments

This is another way of initializing the toolkit without using L_ClrInit. You can use it to retrieve a Color handle and/or a CONVERSION_PARAMS structure, for use later in initialization or modification by L_ClrSetConversionParams.

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

See Also

Functions: | L_ClrInit
Topics: | Conversion Process
 | Color Conversion C DLL Function Groups

Example

This example opens the CMYK dialog and creates a color handle and CONVERSION_PARAMS data.

L_INT ClrDlgExample(
   HWND hWnd,
   HANDLE* pClrHandle)
{
   L_INT nRet;
   CONVERSION_PARAMS convparams; /* conversion options */

   /* Conversion with options:
      The conversion will be done with the options specified in the convparams variable*/
   /* set the convparams size */
   convparams.uStructSize = sizeof(CONVERSION_PARAMS);

   /* we want to use the built in ICC conversion method and built in conversion */
   /* use built in conversion and LEAD ICC Engine*/
   convparams.nMethod = USE_BUILTIN | USE_ICC;

   /* set the active conversion method */
   convparams.nActiveMethod = USE_BUILTIN;

   /* allocate a D50 white point option */
   convparams.pWpoint = (LPWHITEPOINT)malloc(sizeof(WHITEPOINT));

   /* D50 white point */
   convparams.pWpoint->nWhitePoint = CIELAB_D50;

   /* allocate a cmyk option */
   convparams.pCmykParams = (LPCMYK_PARAMS)malloc(sizeof(CMYK_PARAMS));
   convparams.pCmykParams->uStructSize = sizeof(CMYK_PARAMS);
   convparams.pCmykParams->nMask = CMYK_GCR;

   /* 17.5 % GCR value */
   convparams.pCmykParams->nGcr_level = 175;

   nRet = L_ClrDlg(DLG_CMYK, hWnd, pClrHandle, &convparams);

   return nRet;
}


L_ClrFree

L_ClrFree

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

L_LTCLR_API L_INT L_ClrFree(ClrHandle)

L_HANDLE ClrHandle;

/* handle to the color conversion */

Frees the converter, releases any used resources, and invalidates the conversion handle.

Parameter | Description
ClrHandle | Handle to an existing color conversion. This handle is obtained by calling the L_ClrInit function.

Returns

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

Comments

A color conversion handle is initialized by calling the L_ClrInit function.

For each call to L_ClrInit there must be a call to L_ClrFree. This function should be the last function to be called in the toolkit. It will clean up and free memory allocated during the color conversion session for the specified handle.

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

See Also

Functions: | L_ClrInit
Topics: | Freeing the Color Conversion Handle
 | Color Conversion C DLL Function Groups

Example

For an example, refer to L_ClrInit.


L_ClrInit

L_ClrInit

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

L_LTCLR_API L_INT L_ClrInit(pClrHandle, nSrcFormat, nDstFormat, pParams)

L_HANDLE *pClrHandle; | /* pointer to a color conversion handle */
L_INT nSrcFormat; | /* format of the input data */
L_INT nDstFormat; | /* format of the output data */
LPCONVERSION_PARAMS pParams; | /* pointer to a structure */

Initializes the color conversion engine.

Parameter | Description
pClrHandle | Pointer to a color conversion handle. This handle is needed in the conversion process and for setting the process options.
nSrcFormat | Format of the source data. Possible values are:
 | Value | Meaning
 | CCS_RGB | [0x00] Color space is RGB.
 | CCS_YUV | [0x01] Color space is YUV.
 | CCS_CMYK | [0x02] Color space is CMYK.
 | CCS_HSV | [0x03] Color space is HSV.
 | CCS_HLS | [0x04] Color space is HLS.
 | CCS_YIQ | [0x05] Color space is YIQ.
 | CCS_CMY | [0x06] Color space is CMY.
 | CCS_LAB | [0x07] Color space is CIELAB.
 | CCS_XYZ | [0x08] Color space is CIEXYZ.
 | CCS_YCCK | [0x0B] Color space is YCCK.
 | CCS_YCCK | [0x0B] Color space is YCCK.
 | CCS_BGR | [0x0C] Color space is BGR.
 | CCS_UYVY | [0x0E] Color space is UYVY.
 | CCS_YUY2 | [0x09] Color space is YUY2.
 | CCS_YVU9 | [0x0A] Color space is YVU9.
 | CCS_YCC | [0x0F] Color space is YCC.
nDstFormat | Format of the output data. Possible values are:
 | Value | Meaning
 | CCS_RGB | [0x00] Color space is RGB.
 | CCS_YUV | [0x01] Color space is YUV.
 | CCS_CMYK | [0x02] Color space is CMYK.
 | CCS_HSV | [0x03] Color space is HSV.
 | CCS_HLS | [0x04] Color space is HLS.
 | CCS_YIQ | [0x05] Color space is YIQ.
 | CCS_CMY | [0x06] Color space is CMY.
 | CCS_LAB | [0x07] Color space is CIELAB.
 | CCS_XYZ | [0x08] Color space is CIEXYZ.
 | CCS_BGR | [0x0C] Color space is BGR.
 | CCS_UYVY | [0x0E] Color space is UYVY.
 | CCS_YUY2 | [0x09] Color space is YUY2.
 | CCS_YVU9 | [0x0A] Color space is YVU9.
 | CCS_YCC | [0x0F] Color space is YCC.
pParams | Pointer to a CONVERSION_PARAMS structure that contains the conversion properties used in the initialization.

Returns

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

Comments

L_ClrInit must be called before calling any other LEADTOOLS Color Space toolkit functions in case of indirect conversion.

When the handle to the color conversion is no longer needed, it should be freed by calling L_ClrFree. For every call to L_ClrInit there must be a call to L_ClrFree.

If pParams is NULL, the default built in conversion is assumed, and any subsequent calls to L_ClrSetConversionParams will only affect CMYK conversion parameters.

When you choose the conversion method, be sure not to combine the Profiles option (USE_ICC) with the Custom Profiles option (USE_CUSTOM_ICC), or the Emulation Tables method (USE_ET) with the custom Emulation Tables method (USE_CUSTOM_ET).

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

See Also

Functions: | L_ClrConvert, L_ClrFree
Topics: | Initializing a Color Conversion Handle
 | Color Conversion C DLL Function Groups

Example

L_INT ClrInitExample(
   L_UCHAR* pInput,
   L_INT nWidth,
   L_INT nHeight)
{
   L_INT nRet;

   /*Color Handle*/
   HANDLE ClrHandle;

   /*Simple conversion without any options(NULL).
     The conversion will be done with built-in options as the default option */

   /* initialize the color conversion */
   nRet = L_ClrInit(&ClrHandle,
      CCS_CMYK,
      CCS_RGB,
      NULL);
   if(nRet != SUCCESS)
      return nRet;

   /* convert the image buffer */
   nRet = L_ClrConvert(ClrHandle, /* conversion handle */
      pInput,     /* input buffer */
      pInput,     /* output buffer */
      nWidth,     /*pixels width*/
      nHeight,    /*pixels height*/
      0,          /* 0 bytes align*/
      0);         /*0 bytes align*/
   if(nRet != SUCCESS)
      return nRet;

   /* free the conversion */
   nRet = L_ClrFree(ClrHandle);

   return nRet;
}


L_ClrIsValid

L_ClrIsValid

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

L_LTCLR_API L_INT L_ClrIsValid(ClrHandle)

L_HANDLE ClrHandle;

/* handle to the color conversion */

Determines whether the color conversion is valid to the conversion process.

Parameter | Description
ClrHandle | Handle to an existing color conversion. This handle is obtained by calling the L_ClrInit function.

Returns

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

Comments

This function is useful for checking the validity of some conversion handle when using multiple converters.

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

See Also

Functions: | L_ClrConvert
Topics: | Conversion Process
 | Color Conversion C DLL Function Groups

Example

L_INT ClrIsValidExample(
   HANDLE ClrHandle,
   L_UCHAR* pInput,
   L_UCHAR* pOutput,
   L_INT nWidth,
   L_INT nHeight)
{
   L_INT nRet;

   /* Check first the handle*/
   nRet = L_ClrIsValid(ClrHandle);
   if(nRet != SUCCESS)
      return nRet;

   /* Convert the image buffer */
   nRet = L_ClrConvert(ClrHandle, /* conversion handle */
      pInput,     /* input buffer      */
      pOutput,    /* output buffer     */
      nWidth,     /* pixels width      */
      nHeight,    /* pixels height     */
      0,          /* 0 bytes align     */
      0);         /* 0 bytes align     */

   return nRet;
}


L_ClrSetConversionParams

L_ClrSetConversionParams

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

L_LTCLR_API L_INT L_ClrSetConversionParams(ClrHandle, pParams)

L_HANDLE ClrHandle; | /* handle to the color conversion */
LPCONVERSION_PARAMS pParams; | /* pointer to a structure */

Sets new conversion parameters.

Parameter | Description
ClrHandle | Handle to an existing color conversion. This handle is obtained by calling the L_ClrInit function.
pParams | Pointer to a CONVERSION_PARAMS structure, this structure will describe the conversion properties.

Returns

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

Comments

If pParams is NULL, this function will fail. A valid color conversion handle is needed. To check the handle validity, use L_ClrIsValid.

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

See Also

Functions: | L_ClrConvert, L_ClrFree, L_ClrInit
Topics: | Conversion Process
 | Color Conversion C DLL Function Groups

Example

L_INT ClrSetConversionParamsExample(
   L_UCHAR* pInput,
   L_UCHAR* pOutput,
   L_INT nWidth,
   L_INT nHeight)
{
   L_INT nRet;
   HANDLE ClrHandle;         /* color Handle       */
   CONVERSION_PARAMS convparams; /* conversion options */

   /* Conversion with options:
      The conversion will be done with the options specified in the convparams variable*/
   /* set the convparams size */
   convparams.uStructSize = sizeof(CONVERSION_PARAMS);

   /* we want to use the built in ICC conversion method and built in conversion */
   /* use built in conversion and LEAD ICC Engine*/
   convparams.nMethod = USE_BUILTIN | USE_ICC;

   /* set the active conversion method */
   convparams.nActiveMethod = USE_BUILTIN;

   /* allocate a D50 white point option */
   convparams.pWpoint = (LPWHITEPOINT)malloc(sizeof(WHITEPOINT));

   /* D50 white point */
   convparams.pWpoint->nWhitePoint = CIELAB_D50;

   /* allocate a cmyk option */
   convparams.pCmykParams = (LPCMYK_PARAMS)malloc(sizeof(CMYK_PARAMS));
   convparams.pCmykParams->uStructSize = sizeof(CMYK_PARAMS);
   convparams.pCmykParams->nMask = CMYK_GCR;

   /* 17.5 % GCR value */
   convparams.pCmykParams->nGcr_level = 175;

   /* initialize the color conversion */
   nRet = L_ClrInit(&ClrHandle, CCS_CMYK, CCS_RGB, &convparams);
   if(nRet != SUCCESS)
      return nRet;

   /* convert the image buffer */
   nRet = L_ClrConvert(ClrHandle, /* conversion handle */
      pInput,        /* input buffer      */
      pOutput,       /* output buffer     */
      nWidth,        /* pixels width      */
      nHeight,       /* pixels height     */
      0,             /* 0 bytes align     */
      0);            /* 0 bytes align     */
   if(nRet != SUCCESS)
      return nRet;

   /* change the active method for conversion */
   convparams.nMethod = CHANGE_ACTIVE_METHOD;

   /* switch to ICC conversion method */
   convparams.nActiveMethod = USE_ICC;

   /* update the conversion state */
   nRet = L_ClrSetConversionParams(ClrHandle, &convparams);
   if(nRet != SUCCESS)
      return nRet;

   /* convert the image buffer */
   nRet = L_ClrConvert(ClrHandle, /* conversion handle */
      pInput,        /* input buffer      */
      pOutput,       /* output buffer     */
      nWidth,        /* pixels width      */
      nHeight,       /* pixels height     */
      0,             /* 0 bytes align     */
      0);            /* 0 bytes align     */
   if(nRet != SUCCESS)
      return nRet;

   /* free the conversion */
   nRet = L_ClrFree (ClrHandle);

   /* save the image */
   /*...*/

   free(convparams.pWpoint);
   free(convparams.pCmykParams);

   return nRet;
}


L_ConvertCLUTToBuffer

L_ConvertCLUTToBuffer

#include "l_bitmap.h"

L_LTCLR_API L_INT L_ConvertCLUTToBuffer(pData, pIccCLUT, nPrecision, znDataSize)

L_UCHAR * pData; | /* pointer to a buffer */
L_VOID * pIccCLUT; | /* pointer to a structure */
L_INT nPrecision; | /* precision of the data */
L_SSIZE_T znDataSize; | /* size of the data */

Converts the information in an ICC_CLUT8 or ICC_CLUT16 structure into one buffer of sequential data.

Parameter | Description
pData | Pointer to a buffer to be updated with the converted information as one buffer of sequential bytes.
pIccCLUT | Pointer to an ICC_CLUT8 or ICC_CLUT16 structure that contains the information to be converted into one buffer of sequential data.
nPrecision | Value that represents the number of bytes for each element of the data pointed to by pData member of the pIccCLUT parameter. Possible values are:
 | Value | Meaning
 | 1 | Used if the pIccCLUT parameter is of type ICC_CLUT8 structure.
 | 2 | Used if the pIccCLUT parameter is of type ICC_CLUT16 structure.
znDataSize | Size in bytes, of the structure pointed to by pIccCLUT, for versioning. Use either sizeof(ICC_CLUT8) or sizeof(ICC_CLUT16).

Returns

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

Comments

The pData pointer must be allocated by the user. Its size must be equal to the size, in bytes, of the structure pointed to by the pIccCLUT parameter.

The size of pData buffer can be calculated as follows: 16 + 1 + 3 + znDataSize. For more information on how to calculate the znDataSize, refer to the ICC.1:2004-10 specification pages 48 or 51 in the (www.color.org) website.

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveICCProfile, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions ICC Profile Functions: Creating an ICC Profile

Example

/* This example fills an ICC_CLUT16 structure and then converts it into a buffer */
L_UCHAR* ConvertCLUTToBufferExample(L_INT* pnRet)
{
   L_UCHAR* dstBuffer;
   ICC_CLUT16 iccCLUT16;
   L_INT nCntr;
   L_SSIZE_T nDataSize;

   memset(&iccCLUT16, 0, sizeof(ICC_CLUT16));

   // the precision is 2 because we are using ICC_CLUT16
   // and 2 denotes to 2 bytes (i.e. each data element in
   // the pData pointer is 2 bytes in size
   iccCLUT16.uPrecision = 2;

   // the number of items in the grid points array is
   // the number of input channels, lets assume that
   // the number of channels is 2
   iccCLUT16.NumOfGridPoints[0] = 0;
   iccCLUT16.NumOfGridPoints[1] = 1;

   // the size of the data buffer is the multiplication of
   // all the data in the NumOfGridPoints array multiplied by
   // the number of output channels multiplied by the precision
   nDataSize = 1;
   for (nCntr = 0; nCntr < 2; nCntr++)
   nDataSize = iccCLUT16.NumOfGridPoints[nCntr];

   // lets assume we have 3 output channels
   nDataSize *= 3 * iccCLUT16.uPrecision;

   // allocate the data pointer
   iccCLUT16.pData = (L_IccUInt16Number*) calloc (nDataSize, sizeof(L_IccUInt16Number));
   if (iccCLUT16.pData == NULL)
   {
      *pnRet = ERROR_NO_MEMORY;
      return NULL;
   }

   // and fill it with the needed information, in this example I'll just clear it
   memset(iccCLUT16.pData, 0, nDataSize);

   // then add the byte count for the NumOfGridPoints and Precision and Pad bytes
   nDataSize += 16 + 1 + 3;

   // now allocate the distination buffer
   dstBuffer = (L_UCHAR*) calloc(nDataSize, sizeof(L_UCHAR));
   if (dstBuffer == NULL)
   {
      *pnRet = ERROR_NO_MEMORY;
      return NULL;
   }

   // after that call the conversion function
   *pnRet = L_ConvertCLUTToBuffer (dstBuffer, (L_VOID *) &iccCLUT16, iccCLUT16.uPrecision, nDataSize);
   if(*pnRet != SUCCESS)
      return NULL;

   return dstBuffer;
}


L_ConvertCurveTypeToBuffer

L_ConvertCurveTypeToBuffer

#include "l_bitmap.h"

L_LTCLR_API L_INT L_ConvertCurveTypeToBuffer(pData, pIccTagCurveType)

L_UCHAR * pData; | /* pointer to a buffer */
pICCTAG_CURVE_TYPE pIccTagCurveType; | /* pointer to a structure */

Converts the information of an ICCTAG_CURVE_TYPE structure into one buffer of sequential bytes.

Parameter | Description
pData | Pointer to a buffer to be updated with the converted information as one buffer of sequential bytes.
pIccTagCurveType | Pointer to an ICCTAG_CURVE_TYPE structure that contains the information to be converted into one buffer of sequential data.

Returns

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

Comments

The pData pointer must be allocated by the user. Its size must be equal to the size in bytes of the structure pointed to by the pIccTagCurveType parameter.

The size of the pData buffer can be calculated as follows: 4 + 4 + 4 + 2 * pIccTagCurveType.Curve.uCurveCount. For more information, refer to the ICC.1:2004-10 specification page 39 in the (www.color.org) website.

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveICCProfile, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions ICC Profile Functions: Creating an ICC Profile

Example

//This example converts a ICCTAG_CURVE_TYPE structure into a buffer

L_UCHAR* ConvertCurveTypeToBufferExample(pICCTAG_CURVE_TYPE pIccCurveType, L_INT* pnRet)
{
   L_UCHAR * pData;
   L_INT nDataSize;

   // calculate the data size
   nDataSize = 4 + 4 + 4 + 2 * pIccCurveType->Curve.uCurveCount;

   // then allocate the destination data pointer
   pData = (L_UCHAR *) calloc(nDataSize, sizeof(L_UCHAR));
   if (pData == NULL)
   {
      *pnRet = ERROR_NO_MEMORY;
      return NULL;
   }

   // now convert it into buffer
   *pnRet = L_ConvertCurveTypeToBuffer(pData, pIccCurveType);
   if(*pnRet != SUCCESS)
      return NULL;

    return pData;
}


L_ConvertParametricCurveTypeToBuffer

L_ConvertParametricCurveTypeToBuffer

#include "l_bitmap.h"

L_LTCLR_API L_INT L_ConvertParametricCurveTypeToBuffer(pData, pIccTagParametricCurveType)

L_UCHAR * pData; | /* pointer to a buffer */
pICCTAG_PARAMETRIC_CURVE_TYPE pIccTagParametricCurveType; | /* pointer to a structure */

Converts the information in an ICCTAG_PARAMETRIC_CURVE_TYPE structure into one buffer of sequential bytes.

Parameter | Description
pData | Pointer to a buffer to be updated with the converted information as one buffer of sequential bytes.
pIccTagParametricCurveType | Pointer to an ICCTAG_PARAMETRIC_CURVE_TYPE structure that contains the information to be converted into one buffer of sequential data.

Returns

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

Comments

The pData pointer must be allocated by the user. Its size must be equal to the size in bytes of the structure pointed to by pIccTagParametricCurveType parameter.

The size of pData buffer can be calculated as follows: 4 + 4 + 2 + 2 + 4 * number of parameters retrieved by calling the L_GetParametricCurveNumberOfParameters function. For more information, refer to the ICC.1:2004-10 specification page 56 in the (www.color.org) website.

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveICCProfile, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions ICC Profile Functions: Creating an ICC Profile

Example

//This example converts a ICCTAG_PARAMETRIC_CURVE_TYPE structure into a buffer

L_UCHAR* ConvertParametricCurveTypeToBufferExample(pICCTAG_PARAMETRIC_CURVE_TYPE pIccParametricCurveType, L_INT* pnRet)
{
   L_UCHAR* pData;
   L_INT nDataSize;

   // calculate the data size
   nDataSize = 4 + 4 + 2 + 2 + 4 * L_GetParametricCurveNumberOfParameters((ICCFUNCTIONTYPE) pIccParametricCurveType->ParametricCurve.uFunctionType);

   // then allocate the destination data pointer
   pData = (L_UCHAR*) calloc(nDataSize, sizeof(L_UCHAR));
   if (pData == NULL)
   {
      *pnRet = ERROR_NO_MEMORY;
      return NULL;
   }

   // now convert it into a buffer
   *pnRet = L_ConvertParametricCurveTypeToBuffer(pData, pIccParametricCurveType);
   if(*pnRet != SUCCESS)
      return NULL;

   return pData;
}


L_CreateICCTagData

L_CreateICCTagData

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

L_LTCLR_API L_INT L_CreateICCTagData(pDestTagData, pSrcTagData, uTagTypeSig)

L_UCHAR * pDestTagData; | /* pointer to a destination buffer */
L_UCHAR * pSrcTagData; | /* pointer to a source buffer */
L_UINT32 uTagTypeSig; | /* a value that indicates the tag type signature */

Creates an ICC tag.

Parameter | Description
pDestTagData | A pointer to a buffer to be updated with the newly created tag.
pSrcTagData | A pointer to a buffer that contains the original tag data.
uTagTypeSig | A value that indicates the signature of the tag type to be created. Possible values include private tag types and the values listed in ICCTAGTYPESIGNATURE.

Returns

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

Comments

This function does not insert a tag into the ICC profile. It only creates a tag and updates the pDestTagData parameter with a pointer to the newly created tag. This is cast to the desired tag type.

This function converts the original source data, which is in little Endian format, into the ICC profile format, which is in big Endian format.

Before exiting the program, call L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters to free the contents of the allocated pDestTagData. In addition, the user should free the pDestTagData pointer itself, since the user allocated it.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

This function creates an icc tag type (dateTimeType) and returns it.

L_INT CreateICCTagDataExample(pICCTAG_DATE_TIME_TYPE pIccDstDateTimeType)
{
   SYSTEMTIME systemTime;
   ICCTAG_DATE_TIME_TYPE iccSrcDateTimeType;

   // Preparing the structure
   GetSystemTime(&systemTime);
   iccSrcDateTimeType.DateTime.uYear = systemTime.wYear;
   iccSrcDateTimeType.DateTime.uMonth = systemTime.wMonth;
   iccSrcDateTimeType.DateTime.uDay = systemTime.wDay;
   iccSrcDateTimeType.DateTime.uHours = systemTime.wHour;
   iccSrcDateTimeType.DateTime.uMinutes = systemTime.wMinute;
   iccSrcDateTimeType.DateTime.uSeconds = systemTime.wSecond;

   // Creating tag type data
   return L_CreateICCTagData((L_UCHAR *) pIccDstDateTimeType, (L_UCHAR *) &iccSrcDateTimeType, DateTimeTypeSig);
}


L_DeleteICCTag

L_DeleteICCTag

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

L_LTCLR_API L_INT L_DeleteICCTag(pICCProfile, uTagSig, pTag)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UINT32 uTagSig; | /* a value that indicates the tag signature */
L_UCHAR * pTag; | /* pointer to a buffer of data */

Deletes a tag from the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that contains the tag to delete.
uTagSig | A value that indicates the signature of the tag to delete from the ICC profile. Possible values include private tag types and the values listed in ICCTAGSIGNATURE.
pTag | Pointer to a buffer to be updated with the deleted tag.

Returns

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

Comments

This function deletes the desired tag from the ICC profile. Before deleting it however, it makes a copy of the tag, and updates the pTag parameter with a pointer to the copy.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

This function deletes a tag from an ICC profile.

 L_INT DeleteICCTagExample(pICCPROFILEEXT pICCProfile,
                                          L_UINT32       uTagSig,
                                          L_UCHAR      * pTagData)
{
   L_INT nRet;
   nRet = L_DeleteICCTag(pICCProfile, uTagSig, pTagData);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}


L_DoubleTo2bFixed2bNumber

L_DoubleTo2bFixed2bNumber

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

L_LTCLR_API L_UINT32 L_DoubleTo2bFixed2bNumber(dNumber)

L_DOUBLE dNumber;

/* double value */

Converts a fraction number into a 2-bytes fixed, 2-bytes fraction format.

Parameter | Description
dNumber | A double fractional value to convert.

Returns

A 4-byte (2-bytes fixed, 2-bytes fraction) value that represents the value passed to the function.

Comments

This function is used for ICC profiles purposes. The returned value must be cast into one of the following types: L_IccS15Fixed16Number or L_IccU16Fixed16Number.

Each of these types is 4-bytes, divided into 2-bytes that contain the fixed part of the number, and 2-bytes that contain the fractional part of the number.

The (2b) found in the function name means (2-bytes).

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

This example takes a double fractional value, and converts it into 2-bytes fixed, 2-bytes fraction value.

 L_IccU16Fixed16Number DoubleTo2bFixed2bNumberExample(L_DOUBLE dNumber, L_INT* nRet)
{
   *nRet = SUCCESS;
   return ((L_IccU16Fixed16Number) L_DoubleTo2bFixed2bNumber(dNumber));
}


L_DoubleToU8Fixed8Number

L_DoubleToU8Fixed8Number

#include "l_bitmap.h"

L_LTCLR_API L_UINT16 L_DoubleToU8Fixed8Number(dNumber)

L_DOUBLE dNumber;

/* double value */

Converts a fractional value into a 1-byte fixed, 1-byte fraction format.

Parameter | Description
dNumber | A double fractional value to be converted.

Returns

A 2-bytes (1-byte fixed, 1-byte fraction) value that represents the value passed to the function.

Comments

This function is used for ICC profiles purposes. The returned value must be cast into an L_IccU8Fixed8Number type.

This value consists of 2-bytes: 1-byte contains the fixed part of the number, and 1-byte contains the fractional part of the number.

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveICCProfile, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions ICC Profile Functions: Tags

Example

L_IccU8Fixed8Number DoubleToU8Fixed8NumberExample(L_DOUBLE dNumber)
{
   return ((L_IccU8Fixed8Number) L_DoubleToU8Fixed8Number(dNumber));
}


L_FillICCProfileFromICCFile

L_FillICCProfileFromICCFile

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

L_LTCLR_API L_INT L_FillICCProfileFromICCFile(pszFileName, pICCProfile)

L_TCHAR * pszFileName; | /* name of the file to load */
pICCPROFILEEXT pICCProfile; | /* pointer to a structure */

Fills the ICCPROFILEEXT structure fields with the appropriate ICC data from the specified file.

Parameter | Description
pszFileName | Character string containing the name of the ICC file from which to get the ICC data.
pICCProfile | Pointer to an ICCPROFILEEXT structure to be filled with the data.

Returns

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

Comments

This function fills the ICCPROFILEEXT structure directly from an ICC file.

The ICCPROFILEEXT structure must be initialized, by calling L_InitICCProfile, before calling this function.

If the version of the ICC file is v4 or more (i.e. consistent with the ICC specification ICC.1:2004-10), the data inside the ICC file will be extracted into the structure. Otherwise, the ICC will be loaded into a buffer, and a pointer to that buffer will be stored in the pData field of the ICCPROFILEEXT structure, and its size will be in the uDataSize field of the same structure.

To save an ICC Profile to an ICC Profile file call L_GenerateICCFile.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Loading an ICC Profile

Example

This example fills the structure with ICC data directly from an ICC file.

pICCPROFILEEXT FillICCProfileFromICCFileExample(pICCPROFILEEXT pIccProfile, L_TCHAR* pszFileName, L_INT *nRet)
{
   *nRet = L_FillICCProfileFromICCFile(pszFileName, pIccProfile);

   return pIccProfile;
}


L_FillICCProfileStructure

L_FillICCProfileStructure

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

L_LTCLR_API L_INT L_FillICCProfileStructure(pICCProfile, pData, uDataSize)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UCHAR * pData; | /* data pointer */
L_SIZE_T uDataSize; | /* size of the data buffer */

Fills the ICCPROFILEEXT structure fields with the appropriate ICC data from a loaded ICC Profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure to be filled with the data.
pData | Pointer to a data buffer that contains the ICC profile as one piece.
uDataSize | Value that indicates the size of the data buffer that contains the ICC profile.

Returns

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

Comments

When loading the ICC profile from a file using the L_LoadICCProfile function, the ICC profile is stored into one pointer inside the structure. Calling L_FillICCProfileStructure extracts the information from that ICC profile pointer, and fills the ICCPROFILEEXT structure with the appropriate data for each field.

To fill an ICCPROFILEEXT structure directly from an ICC profile file, call L_FillICCProfileFromICCFile.

Note that the ICC Profile passed in pData must be of version 4 or more. (i.e. consistent with the specification ICC.1:2004-10).

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Loading an ICC Profile

Example

For an example, refer to L_InitICCProfile.


L_FreeICCProfile

L_FreeICCProfile

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

L_LTCLR_API L_VOID L_FreeICCProfile(pICCProfile);

pICCPROFILEEXT pICCProfile;

/* pointer to a structure */

Frees the memory allocated by L_InitICCProfile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure to be freed.

Returns

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

Comments

When the ICCPROFILEEXT structure initialized by L_InitICCProfile is no longer needed, the memory must be freed by calling L_FreeICCProfile.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Freeing an ICC Profile

Example

This example frees an Icc Profile.

 L_INT FreeICCProfileExample(pICCPROFILEEXT pIccProfile)
{
   L_FreeICCProfile(pIccProfile);
   return SUCCESS;
}


L_FreeICCProfileExt

L_FreeICCProfileExt

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

L_LTCLR_API L_VOID L_FreeICCProfileExt(pICCProfile);

pICCPROFILEEXT pICCProfile;

/* pointer to a structure */

Frees the memory allocated by L_InitICCProfileExt.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure to be freed.

Returns

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

Comments

When the ICCPROFILEEXT structure initialized by L_InitICCProfileExt is no longer needed, the memory must be freed by calling L_FreeICCProfileExt.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadICCProfile, L_InitICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Freeing an ICC Profile

Example

This example frees an Icc Profile.

L_VOID FreeICCProfileExtExample(pICCPROFILEEXT pIccProfile)
{
   L_FreeICCProfileExt(pIccProfile);
}


L_FreeICCTagType

L_FreeICCTagType

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

L_LTCLR_API L_VOID L_FreeICCTagType(pTagType, uTagTypeSig)

L_UCHAR * pTagType; | /* pointer to ICC tag type buffer */
L_UINT32 uTagTypeSig; | /* tag type signature */

Frees a tag type of the ICC profile.

Parameter | Description
pTagType | A pointer to a buffer that contains the ICC tag type to free.
uTagTypeSig | A value that indicates the signature of the tag type to free.

Returns

None.

Comments

This function frees a tag that was originally created by the function L_CreateICCTagData.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_FreeICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Freeing an ICC Profile

Example

This example frees an ICC tag type.

L_INT FreeICCTagTypeExample(L_UCHAR* pIccTagType, L_UINT32 uTagTypeSig)
{
   // Freeing the tag type
   L_FreeICCTagType(pIccTagType, uTagTypeSig);
   return SUCCESS;
}


L_GenerateICCFile

L_GenerateICCFile

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

L_LTCLR_API L_INT L_GenerateICCFile(pICCProfile, pszFileName)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_TCHAR * pszFileName; | /* name of the file to generate */

Generates an ICC profile file.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that will be used to generate the ICC profile file.
pszFileName | Character string containing the name of the file in which to save the ICC profile.

Returns

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

Comments

This function will generate an ICC profile file that can be used in other applications.

The pData member of the ICCPROFILEEXT structure points to one block of memory that contains the entire ICC profile. The uDataSize contains the size of the material pointed to by pData. As tags are added or deleted, these members are not automatically updated. Ordinarily, to update these members, you must call L_GenerateICCPointer.

And since L_GenerateICCFile depends on pData and uDataSize, unless they already have correct data, they must be updated by calling L_GenerateICCPointer.

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.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_FreeICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

This function will generate an ICC profile file.

 L_INT GenerateICCFileExample(pICCPROFILEEXT pICCProfile,
                                             L_TCHAR      * pszFilename)
{
   L_INT nRet;
   nRet = L_GenerateICCFile(pICCProfile, pszFilename);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}


L_GenerateICCPointer

L_GenerateICCPointer

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

L_LTCLR_API L_INT L_GenerateICCPointer(pICCProfile)

pICCPROFILEEXT pICCProfile;

/* pointer to a structure */

Generates a block of memory that contains all the ICC profile data in big Endian format.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that will be used to generate the pointer.

Returns

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

Comments

The block of memory generated by this function can be accessed through the pData field inside the ICCPROFILEEXT structure. Its size is stored in the uDataSize field of the same structure.

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.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

This function will generate an ICC profile pointer.

L_INT GenerateICCPointerExample(pICCPROFILEEXT pICCProfile)
{
   L_INT nRet;

   nRet = L_GenerateICCPointer(pICCProfile);
   if(nRet != SUCCESS)
      return nRet;

   return SUCCESS;
}


L_GetICCTagData

L_GetICCTagData

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

L_LTCLR_API L_INT L_GetICCTagData(pICCProfile, pTagData, uTagSignature)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UCHAR * pTagData; | /* pointer to a buffer */
L_UINT32 uTagSignature; | /* a value that indicates the tag signature */

Gets a tag from the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that contains the tag to get.
pTagData | Pointer to a buffer to be updated with the tag data.
uTagSignature | A value that indicates the signature of the tag to get from the ICC profile. Possible values include private tags and the values listed in ICCTAGSIGNATURE. Signatures of private tags 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 point to a structure of the same type as the tag type to be retrieved by this function. 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 pTagData parameter is updated correctly with the tag in the ICC profile.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

This example will load an ICC profile, get a tag, and then free the ICCPROFILEEXT structure.

 L_INT GetICCTagDataExample(pICCPROFILEEXT pIccProfile)
{
   L_INT nRet;
   ICCTAG_XYZ_TYPE iccXyzType;

   // Get Calibration Date and Time tag
   nRet = L_GetICCTagData(pIccProfile, (L_UCHAR*) &iccXyzType, MediaWhitePointTag);
   if(nRet != SUCCESS &&
      nRet != ERROR_ICC_UNKNOWN_TAG_AND_TYPE &&
      nRet != ERROR_ICC_UNKNOWN_TAG &&
      nRet != ERROR_ICC_UNKNOWN_TYPE)
      return nRet;

   L_FreeICCTagType((L_UCHAR*) &iccXyzType, XYZTypeSig);

   return SUCCESS;
}


L_GetICCTagTypeSig

L_GetICCTagTypeSig

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

L_LTCLR_API L_UINT32 L_GetICCTagTypeSig(pICCProfile, uTagSig)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UINT32 uTagSig; | /* value that indicates the tag signature */

Gets the ICC tag type signature of the tag in the ICC profile that has the specified tag signature.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that contains the tag for which to get the type tag signature.
uTagSig | A value that indicates the signature of the tag for which to get the tag type. Possible values include private tag signatures and the values listed in ICCTAGSIGNATURE.

Returns

> 0 | A value that indicates the signature of the tag type. This value must be one of the values listed in ICCTAGTYPESIGNATURE, or a private tag type signature.
< 1 | An error occurred. Refer to Return Codes.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

This function returns the tag type signature of an ICC tag.

 L_UINT32 GetICCTagTypeSigExample(pICCPROFILEEXT pICCProfile,L_UINT32 uTagSig)
{
   L_INT nRet = L_GetICCTagTypeSig(pICCProfile, uTagSig);
   if (nRet != 0)
      return SUCCESS;

   return nRet;
}


L_GetParametricCurveNumberOfParameters

L_GetParametricCurveNumberOfParameters

#include "l_bitmap.h"

L_LTCLR_API L_INT L_GetParametricCurveNumberOfParameters(enFunctionType)

ICCFUNCTIONTYPE enFunctionType;

/* parametric function type*/

Returns the number of parameters in a parametric curve type function.

Parameter | Description
enFunctionType | Value that represents the parametric curve type function type. For a list of possible values, refer to ICCFUNCTIONTYPE.

Returns

Number of parameters in the parametric curve type function.

Comments

According to ICC.1:2004-10 specification page 56, in the (www.color.org) website, the only possible number of parameters that can be retrieved by this function are: 1, 3, 4, 5, and 7.

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveICCProfile, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_ConvertParametricCurveTypeToBuffer.


L_InitICCHeader

L_InitICCHeader

#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.

Returns

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.

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

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;
}


L_InitICCProfile

L_InitICCProfile

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

L_LTCLR_API L_INT L_InitICCProfile(pICCProfile, uStructSize)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_SIZE_T uStructSize; | /* size of a structure */

Initializes an ICCPROFILEEXT structure.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure to initialize.
uStructSize | Value that indicates the size of the structure pointed to by pICCProfile. Pass sizeof(ICCPROFILEEXT).

Returns

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

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

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;
}


L_InitICCProfileExt

L_InitICCProfileExt

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

L_LTCLR_API L_INT L_InitICCProfileExt(pICCProfile, uStructSize)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_SIZE_T uStructSize; | /* size of a structure */

Initializes an ICCPROFILEEXT structure.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure to initialize.
uStructSize | Value that indicates the size of the structure pointed to by pICCProfile. Pass sizeof(ICCPROFILEEXT).

Returns

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_InitICCProfileExt 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_FreeICCProfileExt.

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_LoadICCProfile, L_FreeICCProfileExt, L_SaveICCProfile, L_LoadICCProfileExt, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

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_VOID InitICCProfileExtExample(pICCPROFILEEXT pIccProfile,
                                L_TCHAR      * pszImage1,
                                L_TCHAR      * pszImage2)
{
   // Load an ICC Profile that is embedded in an image
   L_LoadICCProfileExt(pszImage1, pIccProfile, NULL);
   // Fill the ICCPROFILEEXT structure with the ICC data loaded from the image
   L_FillICCProfileStructure(pIccProfile, pIccProfile->pData, pIccProfile->uDataSize);
   // Save the ICC Profile into another image
   L_SaveICCProfile(pszImage2, pIccProfile, NULL);
}


L_loadICCProfile

L_LoadICCProfile

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

L_LTCLR_API L_INT L_LoadICCProfile(pszFilename, pICCProfile, pLoadOptions)

L_TCHAR* pszFilename; | /* name of the file to load */
pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads an ICC profile saved/embedded in an image file.

Parameter | Description
pszFilename | Character string containing the name of the file from which to load the ICC profile.
pICCProfile | Pointer to an ICCPROFILEEXT structure to be updated with the loaded ICC Profile.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options, and the profile will be loaded from page 1.

Returns

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

Comments

ICC profiles can be loaded from JPEG, TIFF or EPS files. TIFF files are multipage, so a profile can be loaded from a particular page using the pLoadOptions parameter.

Initialize the structure pointed to by pICCProfile first by calling L_InitICCProfile. If L_LoadICCProfile succeeds, free the ICC profile by calling L_FreeICCProfile. In fact, when any ICCPROFILEEXT structure initialized by L_InitICCProfile is no longer needed, the memory must be freed by calling L_FreeICCProfile.

To save an ICC Profile to an image file, call L_SaveICCProfile.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Loading an ICC Profile

Example

For an example, refer to L_InitICCProfile.


L_LoadICCProfileExt

L_LoadICCProfileExt

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

L_LTFIL_API L_INT L_LoadICCProfileExt(pszFilename, pICCProfile, pLoadOptions)

L_TCHAR* pszFilename; | /* name of the file to load */
pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads an ICC profile saved/embedded in an image file.

Parameter | Description
pszFilename | Character string containing the name of the file from which to load the ICC profile.
pICCProfile | Pointer to an ICCPROFILEEXT structure to be updated with the loaded ICC Profile.
pLoadOptions | Pointer to optional extended load options. Pass NULL to use the default load options, and the profile will be loaded from page 1.

Returns

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

Comments

ICC profiles can be loaded from JPEG, TIFF or EPS files. TIFF files are multipage, so a profile can be loaded from a particular page using the pLoadOptions parameter.

Initialize the structure pointed to by pICCProfile first by calling L_InitICCProfileExt. If L_LoadICCProfileExt succeeds, free the ICC profile by calling L_FreeICCProfileExt. In fact, when any ICCPROFILEEXT structure initialized by L_InitICCProfileExt is no longer needed, the memory must be freed by calling L_FreeICCProfileExt.

To save an ICC Profile to an image file, call L_SaveICCProfile.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_LoadICCProfile, L_InitICCProfileExt, L_FreeICCProfileExt, L_SaveICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Loading an ICC Profile

Example

For an example, refer to L_InitICCProfileExt.


L_SaveICCProfile

L_SaveICCProfile

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

L_LTCLR_API L_INT L_SaveICCProfile(pszFilename, pICCProfile, pSaveOptions)

L_TCHAR* pszFilename; | /* name of a file */
pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves (embeds) an ICC profile in an image file.

Parameter | Description
pszFilename | Character string containing the name of the file in which to save/embed an ICC profile.
pICCProfile | Pointer to an ICCPROFILEEXT structure that contains the ICC profile to save/embed.
pSaveOptions | Pointer to optional extended save options. Pass NULL to use the default save options, and the profile will be saved on page 1.

Returns

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

Comments

ICC profiles can be saved into JPEG, TIFF or GIF files. TIFF files are multipage, so the profile can be saved to a particular page using the pSaveOptions parameter.

Initialize the structure pointed to by pICCProfile first by calling L_InitICCProfile. If L_SaveICCProfile succeeds, free the ICC profile by calling L_FreeICCProfile. In fact, when any ICCPROFILEEXT structure initialized by L_InitICCProfile is no longer needed, the memory must be freed by calling L_FreeICCProfile.

The pData member of the ICCPROFILEEXT structure points to one block of memory that contains the entire ICC profile. The uDataSize contains the size of the material pointed to by pData. As tags are added or deleted, these members are not automatically updated. Ordinarily, to update these members, you must call L_GenerateICCPointer.

And since L_SaveICCProfile depends on the values of pData and uDataSize, unless they already have correct data, they must be updated by calling L_GenerateICCPointer.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Saving an ICC Profile

Example

For an example, refer to L_InitICCProfile.


L_SetICCCMMType

L_SetICCCMMType

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

L_LTCLR_API L_INT L_SetICCCMMType(pICCProfile, nCMMType)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccInt32Number nCMMType; | /* CMM type value */

Sets the Color Management Module (CMM) type of the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the CMM type.
nCMMType | Integer value that represents the CMM type to set.

Returns

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

Comments

This function sets the preferred Color Management Module (CMM) type. If this field is used, it must match a CMM type signature registered in the ICC registry. The registration authority for these data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).

The CMM type is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the CMM type and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCColorSpace

L_SetICCColorSpace

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

L_LTCLR_API L_INT L_SetICCColorSpace(pICCProfile, uColorSpace)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCCOLORSPACE uColorSpace; | /* color space value */

Sets the color space signature of the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the color space.
uColorSpace | A value that represents the color space to set for the ICC profile. For a list of possible values, refer to ICCCOLORSPACE.

Returns

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

Comments

The color space signature is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the color space signature and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCConnectionSpace

L_SetICCConnectionSpace

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

L_LTCLR_API L_INT L_SetICCConnectionSpace(pICCProfile, uPCS)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCCOLORSPACE uPCS; | /* connection space value */

Sets the color space of the profile connection space for the ICC profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the profile connection space.
uPCS | A value that represents the color space to set for the profile connection space. For a list of possible values, refer to ICCCOLORSPACE.

Returns

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

Comments

For all profile classes, other than the device link profile, the profile connection space (PCS) is either xyz or lab color space, and the signature is defined in ICCCOLORSPACE. When the device class is a device link profile, the value of the PCS is the appropriate color space from ICCCOLORSPACE.

The color space of the profile connection space is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the color space of the profile connection space and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCCreator

L_SetICCCreator

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

L_LTCLR_API L_INT L_SetICCCreator(pICCProfile, nCreator)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccInt32Number nCreator; | /* profile creator value */

Sets the creator of the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the creator value.
nCreator | A value that identifies the creator of the ICC profile.

Returns

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

Comments

This function sets the creator field of the ICC profile. If this field is used, it must match the signature contained in the device manufacturer section of the ICC signature registry found at (www.color.org). If not used this field shall be set to zero.

The creator is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the creator and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDateTime

L_SetICCDateTime

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

L_LTCLR_API L_INT L_SetICCDateTime(pICCProfile, pTime)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
pICC_DATE_TIME_NUMBER pTime; | /* pointer to a structure */

Sets the date and time at which the ICC profile was created.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure that contains the creation date and time being set.
pTime | Pointer to an ICC_DATE_TIME_NUMBER structure that contains the date and time at which the ICC profile was created.

Returns

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

Comments

The date and time values are contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the date and time and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_2bFixed2bNumberToDouble, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDeviceAttributes

L_SetICCDeviceAttributes

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

L_LTCLR_API L_INT L_SetICCDeviceAttributes(pICCProfile, uAttributes)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccUInt64Number uAttributes; | /* profile attributes value */

Sets the device attributes for the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the device attributes.
uAttributes | Flags that identify attributes unique to a particular device. You can use a bitwise OR (|) to specify one flag from each group. The following flags indicate the transparency of the media:
 | Value | Meaning
 | ICC_REFLECTIVE | [0x0000000000000000] Reflective media
 | ICC_TRANSPARENCY | [0x0000000000000001] Transparent media
 | The following flags indicate if the media is glossy or matte:
 | Value | Meaning
 | ICC_GLOSSY | [0x0000000000000000] Glossy media
 | ICC_MATTE | [0x0000000000000002] Matte media

The following flags indicate media polarity:
Value | Meaning
ICC_MEDIA_POLARITY_POSITIVE | [0x0000000000000000] Positive media polarity
ICC_MEDIA_POLARITY_NEGATIVE | [0x0000000000000004] Negative media polarity
The following flags indicate if the media is colored:
Value | Meaning
ICC_COLOR_MEDIA | [0x0000000000000000] Color media
ICC_BLACK_AND_WHITE | [0x0000000000000008] Black and white media

Returns

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

Comments

The device attributes are unique to a particular device setup.

Note that these attributes describe the media itself, not the data in the ICC profile. For example, a profile for a color scanner that has been loaded with black and white film will have the attribute ICC_BLACK_AND_WHITE, regardless of the value in the data color space field.

The device attributes are contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the device attributes and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDeviceClass

L_SetICCDeviceClass

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

L_LTCLR_API L_INT L_SetICCDeviceClass(pICCProfile, uDevClassSig)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCPROFILECLASS uDevClassSig; | /* device class value */

Sets the device class of the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure for which to set the device class.
uDevClassSig | A value that represents the device class to set in the ICC profile. For a list of possible values, refer to ICCPROFILECLASS.

Returns

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

Comments

There are three basic classes of device profiles: Input, Display and Output profiles. In addition to the three basic device profile classes, four additional color processing profiles are defined. These profiles provide a standard implementation for use by the CMM in general color processing, or for the convenience of CMMs, which may use these types to store calculated transforms. These four additional profile classes are DeviceLink, ColorSpace Conversion, Abstract, and Named color profiles.

The Device class is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the Device class and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDevManufacturer

L_SetICCDevManufacturer

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

L_LTCLR_API L_INT L_SetICCDevManufacturer(pICCProfile, nDevManufacturer)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccInt32Number nDevManufacturer; | /* device manufacturer value */

Sets the device manufacturer value of the ICC profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the device manufacturer value.
nDevManufacturer | Integer value that represents the device manufacturer to set for the ICC profile.

Returns

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

Comments

This function sets the device manufacturer field of the ICC profile. If this field is used, it must match the signature contained in the appropriate section of the ICC signature registry found at (www.color.org). If not used this field is set to zero.

The registration authority for these data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).

The device manufacturer is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the device manufacturer and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCDevModel

L_SetICCDevModel

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

L_LTCLR_API L_INT L_SetICCDevModel(pICCProfile, uDevModel)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccUInt32Number uDevModel; | /* device model value */

Sets the device model for the ICC profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the device model value.
uDevModel | Value that represents the device model to set for the ICC profile.

Returns

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

Comments

This function sets the device model field of the ICC profile. If this field is used, it must match the signature contained in the appropriate section of the ICC signature registry found at (www.color.org). If not used this field is set to zero.

The registration authority for these data is the ICC Technical Secretary. For contact information, refer to the ICC web site (www.color.org).

The device model is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the device model and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCFlags

L_SetICCFlags

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

L_LTCLR_API L_INT L_SetICCFlags(pICCProfile, uFlags)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_IccUInt32Number uFlags; | /* flags value */

Sets the flags of the ICC profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the flags.
uFlags | Flags that indicate whether the ICC profile is embedded, and if it can be used independently from the embedded color data. You can use a bitwise OR (|) to specify one flag from each group. The following flags indicate whether the ICC profile is embedded:
 | Value | Meaning
 | ICC_EMBEDDED_PROFILE_FALSE | [0x00000000] ICC profile is not embedded
 | ICC_EMBEDDED_PROFILE_TRUE | [0x00000001] ICC profile is embedded
 | The following flags indicate whether the ICC profile can be used independently from the embedded color data:
 | Value | Meaning
 | ICC_USE_ANYWHERE | [0x00000000] ICC profile can be used independently
 | ICC_USE_WITH_EMBEDDED_DATA_ONLY | [0x00000002] ICC profile cannot be used independently

Returns

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

Comments

The profile flags also determine how the CMM handles other factors such as distributed processing and caching options.

The flags are contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the flags and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCPrimaryPlatform

L_SetICCPrimaryPlatform

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

L_LTCLR_API L_INT L_SetICCPrimaryPlatform(pICCProfile, uPrimPlatform)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCPLATFORMSIGNATURE uPrimPlatform; | /* primary platform value */

Sets the primary platform for the ICC Profile.

Parameter | Description
pICCProfile | Pointer to an ICCPROFILEEXT structure for which to set the primary platform.
uPrimPlatform | A value that represents the primary platform to set for the ICC profile. For a list of possible values, refer to ICCPLATFORMSIGNATURE.

Returns

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

Comments

This function sets the primary platform/operating system framework for which the profile was created. If there is no primary platform identified, this field is set to NoPlatformSignature (0x00000000).

The primary platform is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the primary platform and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCProfileId

L_SetICCProfileId

#include "l_bitmap.h"

L_LTCLR_API L_INT L_SetICCProfileId(pICCProfile)

pICCPROFILEEXT pICCProfile;

/* pointer to a structure */

Sets the Profile ID automatically in the header of an ICC Profile structure.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure to set its Profile ID.

Returns

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

Comments

This function sets the value of the pICCProfile.ICCHEADER.uProfileID member of an ICC Profile structure automatically, using an auto-generated ID.

To set the Profile File ID, the ICC profile must be complete (i.e. the Profile File ID must be the last thing to be set in the ICC profile).

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveICCProfile, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCRenderingIntent

L_SetICCRenderingIntent

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

L_LTCLR_API L_INT L_SetICCRenderingIntent(pICCProfile, uRenderingIntent)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
ICCRENDERINGINTENT uRenderingIntent; | /* rendering intent value */

Sets the rendering intent of an ICC profile.

Parameter | Description
pICCProfile | Pointer to ICCPROFILEEXT structure whose rendering intent value will be set.
uRenderingIntent | A value that indicates the rendering intent. For a list of possible values, refer to ICCRENDERINGINTENT.

Returns

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

Comments

The value set using this function specifies the rendering intent used when this profile combines with another profile. In a sequence of more than two profiles, it applies to the combination of this profile and the next profile in the sequence and not to the entire sequence. Typically, the user or application will set the rendering intent dynamically at runtime or embedding time. Therefore, this flag may not have any meaning until the profile is used in some context, e.g. in a device link or an embedded source profile.

The rendering intent is one of the values contained within the "header" information in the ICCPROFILEEXT structure. Calling L_InitICCHeader will reset the rendering intent and the other header information to the default values.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Creating an ICC Profile

Example

For an example, refer to L_InitICCHeader.


L_SetICCTagData

L_SetICCTagData

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

L_LTCLR_API L_INT L_SetICCTagData(pICCProfile, pTagData, uTagSig, uTagTypeSig)

pICCPROFILEEXT pICCProfile; | /* pointer to a structure */
L_UCHAR* pTagData; | /* pointer to a buffer containing data */
L_UINT uTagSig; | /* a value that indicates the tag signature */
L_UINT uTagTypeSig; | /* a value that indicates the tag type signature */

Sets a tag inside the ICC profile.

Parameter | Description
pICCProfile | Pointer to the ICCPROFILEEXT structure in which to set the tag.
pTagData | Pointer to a buffer that contains the tag data.
uTagSig | A value that indicates the signature of the tag to be created. Possible values include private tags and the values listed in ICCTAGSIGNATURE. Signatures of private tags must be registered with the ICC.
uTagTypeSig | A value that indicates the signature of the tag type used for creating the tag. Possible values include private tag type signatures and the values listed in 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 ICC profile structure.

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions: | L_InitICCProfile, L_FreeICCProfile, L_SaveICCProfile, L_LoadICCProfile, L_FillICCProfileStructure, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_U8Fixed8NumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions
 | ICC Profile Functions: Tags

Example

This example sets a tag into an ICC profile.

L_INT SetICCTagDataExample(pICCPROFILEEXT pIccProfile)
{
   L_INT nRet;
   SYSTEMTIME systemTime;
   ICCTAG_DATE_TIME_TYPE iccDateTimeType;

   // preparing the structure
   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 = L_SetICCTagData(pIccProfile, (L_UCHAR *) &iccDateTimeType, CalibrationDateTimeTag, DateTimeTypeSig);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}


L_U8Fixed8NumberToDouble

L_U8Fixed8NumberToDouble

#include "l_bitmap.h"

L_LTCLR_API L_DOUBLE L_U8Fixed8NumberToDouble(uNumber)

L_UINT16 uNumber;

/* integer value */

Converts a 1-byte fixed, 1-byte fraction number format into a double fractional value.

Parameter | Description
uNumber | Value that represents the 1-byte fixed, 1-byte fraction number value to be converted.

Returns

A double value that contains a fractional number that represents the value passed to the function.

Comments

This function is used for ICC profiles purposes. The number passed must be of type L_IccU8Fxed8Number.

This type consists of 2-bytes: 1-byte contains the fixed part of the number, and 1-byte contains the fractional part of the number.

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions: | L_SaveICCProfile, L_FillICCProfileFromICCFile, L_InitICCHeader, L_SetICCCMMType, L_SetICCDeviceClass, L_SetICCColorSpace, L_SetICCConnectionSpace, L_SetICCPrimaryPlatform, L_SetICCFlags, L_SetICCDevManufacturer, L_SetICCDevModel, L_SetICCDeviceAttributes, L_SetICCRenderingIntent, L_SetICCCreator, L_SetICCDateTime, L_SetICCProfileId, L_2bFixed2bNumberToDouble, L_DoubleToU8Fixed8Number, L_DoubleTo2bFixed2bNumber, L_SetICCTagData, L_GetICCTagData, L_CreateICCTagData, L_DeleteICCTag, L_GenerateICCFile, L_GenerateICCPointer, L_GetICCTagTypeSig, L_FreeICCTagType, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters, L_ConvertParametricCurveTypeToBuffer, L_ConvertCurveTypeToBuffer, L_ConvertCLUTToBuffer, L_GetParametricCurveNumberOfParameters
Topics: | Using ICC Profile Functions ICC Profile Functions: Tags

Example

// This example takes a 1-byte fixed, 1-byte fractional value, and then converts it into double fractional value.

L_DOUBLE U8Fixed8NumberToDoubleExample(L_IccU8Fixed8Number uNumber)
{
   return (L_U8Fixed8NumberToDouble(uNumber));
}


Color Conversion Tutorials

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials

See Also:

Introduction

Programming with Color Conversion


Visual C++ Tutorials

Built-in Conversion

Color Conversion to an Image

Conversion Given an ICM Profiles

Dialog Based Initialization

Emulation Tables

Generic YUV conversion

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Built-in Conversion

Built-in Conversion

The Color Conversion C DLL provides built-in conversion. To do a built-in conversion, follow the steps below:

1.

Define the following global variables:

HANDLE ClrHandle;
CONVERSION_PARAMS params;
WHITEPOINT WPoint;
L_UCHAR *pRGBData;
L_UCHAR *pLABData;
L_INT nWidth;
L_INT nHeight;
L_INT nInAlign;
L_INT nOutAlign;

2.

Set the conversion options by filling a CONVERSION_PARAMS structure:

ZeroMemory(&params, sizeof(CONVERSION_PARAMS));

params.pWpoint = &WPoint;
params.uStructSize = sizeof(CONVERSION_PARAMS);
params.pWpoint->nWhitePoint = CIELAB_D50;
params.nQuantization = 8;
params.nMethod = USE_BUILTIN;
params.nActiveMethod = USE_BUILTIN;
params.pWpoint->xWhite = 0.0;
params.pWpoint->yWhite = 0.0;

3.

Initialize the color conversion handle with L_ClrInit():

L_ClrInit(&ClrHandle, CCS_RGB, CCS_LAB, &params);

4.

Convert from RGB to CIELab:

L_ClrConvert(ClrHandle, pRGBData, pLABData, nWidth, nHeight, nInAlign, nOutAlign);

5.

At the end, free the color conversion handle:

L_ClrFree(ClrHandle);

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Color Conversion to an Image

Color Conversion to an Image

The Color Conversion C DLL provides direct color conversion to an image. To do a conversion, follow the steps below:

1.

Define the following global variables:

BITMAPHANDLE LeadBitmap;
L_UCHAR *pLABData;

2.

To convert 320x240 24 bit CIELab data to a LEAD bitmap with RGB24, do the following:

L_ClrConvertDirectToBitmap(CCS_LAB, CCS_RGB, pLABData, &LeadBitmap, sizeof(BITMAPHANDLE), 320, 240, 0, 0);

// You can use the Lead bitmap as you want

3.

At the end, free the bitmap handle:

L_FreeBitmap (&LeadBitmap);

See Also:

Introduction

Programming with Color Conversion

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Conversion Given an ICM Profile

Conversion Given an ICM Profile

1.

Define the following global variables:

HANDLE ClrHandle;
CONVERSION_PARAMS params;
BYTE RGBColor[3];
BYTE ColorSpace[4];

2.

Set the conversion options by filling a CONVERSION_PARAMS structure:

memset(&params, 0, sizeof(CONVERSION_PARAMS));

params.uStructSize = sizeof(CONVERSION_PARAMS);
params.nMethod = USE_CUSTOM_ICC;
params.nActiveMethod = USE_CUSTOM_ICC;
params.pWpoint = (LPWHITEPOINT)malloc(sizeof(WHITEPOINT));
params.pWpoint->nWhitePoint = CIELAB_D50;

params.pMemInputProfile = NULL;
params.pMemOutputProfile = NULL;

lstrcpy(params.sInputProfile, TEXT("C:\\MyCMYKProfile.ICM"));
lstrcpy(params.sOutputProfile, TEXT("C:\\MyRGBProfile.ICM"));

3.

Initialize the color conversion handle with L_ClrInit():

L_ClrInit(&ClrHandle, CCS_CMYK, CCS_RGB, &params);

4.

Now, do the conversion:

ColorSpace[0] = 100;
ColorSpace[1] = 100;
ColorSpace[2] = 100;
ColorSpace[3] = 100;

L_ClrConvert(ClrHandle, ColorSpace, RGBColor, 1, 1, 0, 0);

5.

At the end, free the color conversion handle:

L_ClrFree(ClrHandle);

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Dialog Based Initialization

Dialog Based Initialization

The Color Conversion C DLL provides a color space dialog that can be used to initialize a conversion. To do a dialog based initialization follow the steps below:

1.

Define the following global variables:

HANDLE ClrHandle;
L_UCHAR *pRGBData;
L_UCHAR *pLABData;
L_INT nWidth;
L_INT nHeight;
L_INT nInAlign;
L_INT nOutAlign;

2.

Display the color space dialog box to initialize as follows:

L_ClrDlg(DLG_LAB, NULL, &ClrHandle, NULL);

3.

Convert from RGB to CIELab as follows:

L_ClrConvert(ClrHandle, pRGBData, pLABData, nWidth, nHeight, nInAlign, nOutAlign);

4.

At the end, free the color conversion handle:

L_ClrFree(ClrHandle);

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Emulation Tables

Emulation Tables

The LEAD Color Conversion toolkit provides emulation tables as one of its conversion methods. This method however is provided only for the following conversions:

  • CMYK to RGB.

  • CIELab to RGB

  • and RGB to CIELab

The Emulation tables' method supports both built-in and custom options. For built-in emulation tables, use the USE_ET option. The custom emulation tables' option, USE_CUSTOM_ET, provides custom conversion using user-supplied images, converted from the source images distributed with the library, by any tool, as follows:

Conversion | Source | Convert to
CMYK to RGB | src_cmyk_image.tif | RGB image (i.e. dst_cmyk2rgb_image.tif)
RGB to Lab | src_rgb_image.tif | Lab image (i.e. dst_rgb2lab_image.tif)
Lab to RGB | src_lab_image.tif | RGB image (i.e. dst_lab2rgb_image.tif)

A set of images, already converted and ready for use (dst_cmyk2rgb_image.tif, dst_rgb2lab_image.tif, and dst_lab2rgb_image.tif), is provided. However, using the provided set of converted images will produce the same results as the built-in emulation tables.

The code below shows how a conversion can be done using the built-in tables:

L_VOID Tables_Convert_CMYKToRGB(L_UCHAR *pInput, L_UCHAR *pOutput, L_INT nWidth)
{
HANDLE ClrHandle /*Color Handle*/;
CONVERSION_PARAMS params /*Conversion options*/;

/* Zero initialize, this step is important*/
ZeroMemory (&params, sizeof (CONVERSION_PARAMS));

/*Conversion with options.
The conversion will be done with the options specified in the
params variable
*/

/* Set the params size */
params.uStructSize = sizeof (CONVERSION_PARAMS);

/* We want to use built-in emulation tables */
params.nMethod = USE_ET;

/* set the active conversion method */
params.nActiveMethod = USE_ET;

/* initialize the color conversion */
L_ClrInit (&ClrHandle, /*pointer to color handle to be returned*/
CCS_CMYK, /*input color space*/
CCS_RGB, /*output color space*/
&params /*pointer to the initialization options*/
);

/* Convert the image buffer */
L_ClrConvert (ClrHandle, /* conversion handle*/
pInput, /* input buffer*/
pOutput, /* output buffer*/
nWidth, /*pixel's width*/
nHeight, /*pixel's height*/
0, /* 0 bytes align*/
0); /*0 bytes align*/

/* free the conversion */
L_ClrFree (ClrHandle);
}

The code below shows how a conversion can be done using user-defined tables:

L_VOID Tables_Convert_CMYKToRGB(L_UCHAR *pInput, L_UCHAR *pOutput, L_INT nWidth)
{
HANDLE ClrHandle /*Color Handle*/;
CONVERSION_PARAMS params /*Conversion options*/;

ZeroMemory(&params, sizeof(CONVERSION_PARAMS));

/*Conversion with options.
The conversion will be done with the options specified in the
params variable
*/

/* set the params size */
params.uStructSize = sizeof(CONVERSION_PARAMS);

/* we want to use custom emulation tables */
params.nMethod = USE_CUSTOM_ET;

/* set the active conversion method */
params.nActiveMethod = USE_CUSTOM_ET;

/* set the emulation tables */
lstrcpy(params.sDstInputTable, TEXT("C:\\RGBImage.tif"));

/* initialize the color conversion */
L_ClrInit (&ClrHandle, /*pointer to color handle to be returned*/
CCS_CMYK, /*input color space*/
CCS_RGB, /*output color space*/
&params /*pointer to the initialization options*/
);

/* convert the image buffer */

L_ClrConvert (ClrHandle, /* conversion handle */
pInput, /* input buffer */
pOutput, /* output buffer */
nWidth, /*pixel's width*/
nHeight, /*pixel's height*/
0, /* 0 bytes align*/
0); /*0 bytes align*/

/* free the conversion */
L_ClrFree (ClrHandle);
}

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Generic YUV Conversion

Generic YUV Conversion

Generic YUV conversion provides the ability to convert any YUV format to any supported color space, using the YUV_PARAMS structure and adhering to the restrictions listed below. After defining the YUV format, you can proceed with the conversion normally, just like any other conversion. Use L_ClrConvert to perform the conversion and call L_ClrFree to free the conversion handle. Currently the conversion from any color space to Generic YUV is not supported.

Generic YUV conversion currently has the following restrictions:

1. | No sub-sampling of Y is supported
2. | The number of Y elements must be a multiple of both U, and V.
3. | With non-planar formats, vertical sub-sampling of Y, U, and V is not supported.
4. | No alignment supported in planar format; line width must not contain additional bytes.
5. | The horizontal sub-sampling periods of U, and V must be multiples of each other, and the vertical sub-sampling periods of U, and V must be multiples of each other.

Examples:

1.

Converting Y41P to RGB using Generic YUV Conversion:

L_VOID GenericY41PToRGB(L_UCHAR *pIn, L_UCHAR *pOut, L_INT nWidth, L_INT nHeight)
{
/*Declare a handle*/
HANDLE hClrHandle;

/*Declare a CONVERSION_PARAMS structure*/
CONVERSION_PARAMS cpParams;
/*Declare a YUV_PARAMS structure*/
YUV_PARAMS yuvParams;

/*Byte ordering of the format; for Y41P:
U0 Y0 V0 Y1 U4 Y2 V4 Y3 Y4 Y5 Y6 Y7
0 1 2 3 4 5 6 7 8 9 10 11
Put the Y component order first, then the U and V last as follows:
Y positions: 1,3,5,7,8,9,10,11
U positions: 0,4
V positions: 2,6 */

L_INT pOff[] = {1,3,5,7,8,9,10,11,0,4,2,6};

ZeroMemory (&cpParams, sizeof (CONVERSION_PARAMS));
/*Determine the size of the structure*/
yuvParams.uStructSize = sizeof(YUV_PARAMS);
/*Determine the horizontal sub-sampling of U */
yuvParams.nUh = 4;
/*Determine the vertical sub-sampling of U */
yuvParams.nUv = 1;
/*Determine the horizontal sub-sampling of V */
yuvParams.nVh = 4;
/*Determine the vertical sub-sampling of V */
yuvParams.nVv = 1;
/*Set the byte ordering*/
yuvParams.pOffsets = pOff;
/*The YUV values range*/
yuvParams.nRange = YUVRANGE_FULL;
/*This represents the macro pixels(smallest group of pixels allowed), which indicates how many actual pixels are in the macro pixel. This value is important only in non – planar format*/
yuvParams.nMacroPixel = 8;
/*This is a Boolean value that represents the type of the YUV format (Planar = TRUE, or non – Planar = FALSE.)*/
yuvParams.bPlanar =FALSE;

/*Fill the pYuvParams value with the address of the YUV_PARAMS structure*/
cpParams.pYuvParams = &yuvParams;
/*Determine the size of CONVERSION_PARAMS*/
cpParams.uStructSize = sizeof (CONVERSION_PARAMS);
/*Determine the type of conversion to be used in the conversion, for YUVGeneric, only use USE_BUILTIN*/
cpParams.nMethod = USE_BUILTIN;
/*Determine the type of conversion to be activated. For YUVGeneric,
only USE_BUILTIN*/
cpParams.nActiveMethod = USE_BUILTIN;

/*Initialize the conversion*/
L_ClrInit(&hClrHandle, CCS_YUV, CCS_RGB, &cpParams);

/*Convert the buffers pIn to pOut*/
L_ClrConvert(hClrHandle, pIn, pOut, nWidth, nHeight, 0, 0);

/*Free the handles*/
L_ClrFree(hClrHandle);
}

2.

Converting YVU9 (Planar) to RGB using Generic YUV Conversion:

L_VOID GenericYVU9ToRGB(L_UCHAR *pIn, L_UCHAR *pOut, L_INT nWidth, L_INT nHeight)
{
/*Declare a handle*/
HANDLE hClrHandle;

/*Declare a CONVERSION_PARAMS structure*/
CONVERSION_PARAMS cpParams;

/*Declare a YUV_PARAMS structure*/
YUV_PARAMS yuvParams;

/*This array of integers specifies the byte order of the yuv format. For planar formats it takes only a single value that represents the plane sequence in the buffer:
YUV, YVU, UYV, UVY, VYU, or VUY.*/
L_INT pOff[] = {PLANAR_YVU}; /*PLANAR_YVU means the Y plane comes first in the buffer, then the V plane, and the U plane is last*/

ZeroMemory (&cpParams, sizeof (CONVERSION_PARAMS));

/*Determine the size of the structure*/
yuvParams.uStructSize = sizeof(YUV_PARAMS);

/*Determine the horizontal sub-sampling of U*/
yuvParams.nUh = 4;

/*Determine the vertical sub-sampling of U*/
yuvParams.nUv = 4;

/*Determine the horizontal sub-sampling of V*/
yuvParams.nVh = 4;

/*Determine the vertical sub-sampling of V*/
yuvParams.nVv = 4;

/*This is a pointer to an integer. Pass the byte order array.*/
yuvParams.pOffsets = pOff;

/*The range value determines the YUV range values. */
yuvParams.nRange = YUVRANGE_FULL;

/*This represents the macro pixels(smallest group of pixels allowed) , which indicates how many actual pixels are in the macro pixel. This value is important only in non – planar format*/
yuvParams.nMacroPixel = 16;

/*This is a Boolean value that represents the type of the YUV format (Planar, or non – Planar.)*/
yuvParams.bPlanar = TRUE;

/*Pass the YUV_PARAMS structure address to the pYuvParams member of the CONVERSION_PARAMS structure.*/
cpParams.pYuvParams = &yuvParams;

/*Determine the size of the CONVERSION_PARAMS structure.*/
cpParams.uStructSize = sizeof (CONVERSION_PARAMS);

/*Determine the type of conversion to be used. For YUVGeneric, use only USE_BUILTIN*/
cpParams.nMethod = USE_BUILTIN;

/*Determine the type of conversion to be activated. For YUVGeneric, use only USE_BUILTIN.*/
cpParams.nActiveMethod = USE_BUILTIN;

/*Initialize the conversion*/
L_ClrInit(&hClrHandle, CCS_YUV, CCS_RGB, &cpParams);

/*Convert the buffers pIn to pOut*/
L_ClrConvert(hClrHandle, pIn, pOut, nWidth, nHeight, 0, 0);

/*Free the handles*/
L_ClrFree(hClrHandle);
}

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Delphi Tutorials

Built-in Conversion

Color Conversion to an Image

Conversion Given an ICM Profiles

Dialog Based Initialization

Emulation Tables

Generic YUV conversion

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Built-in Conversion (Delphi 4.0)

Built-in Conversion (Delphi 4.0)

The Color Conversion C DLL provides built-in conversion. To do a built-in conversion, follow the steps below:

1. | At the beginning of the Unit1 file, add LTDLLUNT, LTDLLTYP, and LTDLLDEF to the uses section.
2. | Use the following code to perform the built-in conversion:

function TForm1.Builtin_RGBToLAB({in}pSrcRGB, {out}pDstLAB: Pointer; {in}nWidth, {in}nHeight: Integer) : {ret}Integer;
var
ClrHandle : THandle; (* color handle *)
params : CONVERSION_PARAMS; (* conversion params *)
WPoint : WHITEPOINT ; (* white point definition *)
ret : Integer; (* return value *)
begin
(*
******************************************************************
* Simple conversion from RGB to CIELab using built-in conversion *
* Parameters : *
* pSrcRGB : 24 bit RGB data, this is the input image data *
* pDstLAB : 24 bit CIELab data, this is the output image data *
* nWidth : Width of the image *
* nHeight : Height of the image *
* Returns SUCCESS when successful or error code else *
******************************************************************
*)

(* initialize the conversion structure *)
ZeroMemory(Pointer(@params), SizeOf(CONVERSION_PARAMS));

(* set the whitepoint *)
params.pWpoint := @WPoint;

(* set up default conversion data *)
params.uStructSize := sizeof(CONVERSION_PARAMS);
params.pWpoint.nWhitePoint := CIELAB_D50;
params.nQuantization := 8;
params.nMethod := USE_BUILTIN;
params.nActiveMethod := USE_BUILTIN;
params.pWpoint.xWhite := 0.0;
params.pWpoint.yWhite := 0.0;

(* initialize the conversion engine *)
ret := L_ClrInit(@ClrHandle,
CCS_RGB,
CCS_LAB,
@params);

(* do we have a valid handle *)
if ret <> SUCCESS then
Result := ret
else
begin
(* do the conversion from RGB to CIELab *)
ret := L_ClrConvert (ClrHandle,
pSrcRGB,
pDstLAB,
nWidth,
nHeight,
0,
0);

if ret <> SUCCESS then
begin
(* free before leaving *)
L_ClrFree (ClrHandle);
Result := ret;
end
else
begin
(* do not forget to free every thing *)
ret := L_ClrFree (ClrHandle);
Result := ret;
end;
end;

end;

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Color Conversion to an Image (Delphi 4.0)

Color Conversion to an Image (Delphi 4.0)

The Color Conversion C DLL provides color conversion to an image. To do a conversion, follow the steps below:

1. | At the beginning of the Unit1 file, add LTDLLUNT, LTDLLTYP, and LTDLLDEF to the uses section.
2. | Use the following code to direct color conversion to an image:

function TForm1.LABToLEADBitmap({in}pSrcLAB: Pointer; {out}var pBitmap: BITMAPHANDLE; {in}nWidth, {in}nHeight: Integer) : {ret}Integer;
var
ret : Integer; (* return value *)
begin
(*
******************************************************************
* Simple conversion from CIELab to RGB24 LEAD bitmap *
* Parameters : *
* pSrcLAB : 24 bit CIELab data, this is the input image data *
* pBitmap : Handle to the resulting LEAD bitmap *
* nWidth : Width of the image *
* nHeight : Height of the image *
* Returns SUCCESS when successful or an error code otherwise *
******************************************************************
*)
ret := L_ClrConvertDirectToBitmap(CCS_LAB,
CCS_RGB,
pSrcLAB,
@pBitmap,
SizeOf(BITMAPHANDLE),
nWidth,
nHeight,
0,
0);

Result := ret;
end;

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Conversion Given an ICM Profiles (Delphi 4.0)

Conversion Given an ICM Profile (Delphi 4.0)

1.

Define the following global variables:

ClrHandle : THandle;
params : CONVERSION_PARAMS;
RGBColor : array[0..2] of UCHAR;
ColorSpace : array[0..3] of UCHAR;

2.

Set the conversion options by filling a CONVERSION_PARAMS structure:

ZeroMemory(Pointer(@params), SizeOf(CONVERSION_PARAMS));

params.uStructSize := SizeOf(CONVERSION_PARAMS);
params.nMethod := USE_CUSTOM_ICC;
params.nActiveMethod := USE_CUSTOM_ICC;
New(params.pWpoint);
params.pWpoint.nWhitePoint := CIELAB_D50;

StrCopy (params.sInputProfile, ‘C:\MyCMYKProfile.ICM’);
StrCopy (params.sOutputProfile, ‘C:\MyRGBProfile.ICM’);

params.pMemInputProfile := nil;
params.pMemOutputProfile := nil;

3.

Initialize the color conversion handle with L_ClrInit():

L_ClrInit(@ClrHandle, CCS_CMYK, CCS_RGB, @params);

4.

Now, do the conversion:

ColorSpace[0] := 100;
ColorSpace[1] := 100;
ColorSpace[2] := 100;
ColorSpace[3] := 100;

L_ClrConvert(ClrHandle, Pointer(ColorSpace), Pointer(RGBColor), 1, 1, 0, 0);

5.

At the end, free the color conversion handle:

L_ClrFree(ClrHandle);

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Dialog Based Initialization (Delphi 4.0)

Dialog Based Initialization (Delphi 4.0)

The Color Conversion C DLL provides a color space dialog that can be used to initialize a conversion. To do a dialog based initialization follow the steps below:

1. | At the beginning of the Unit1 file, add LTDLLUNT, LTDLLTYP, and LTDLLDEF to the uses section.
2. | Use the following code to implement using the color space dialog for initializing:

function TForm1.ColorDlg_RGBToLAB({in}pSrcRGB, {out}pDstLAB: Pointer; {in}nWidth, {out}nHeight: Integer) : {ret}Integer;
var
ClrHandle : THandle; (* color handle *)
ret: Integer; (* return value *)
begin
(*
******************************************************************
* Simple conversion from RGB to CIELab using the LEAD color dialog *
* Parameters : *
* pSrcRGB : 24 bit RGB data, this is the input image data *
* pDstLAB : 24 bit CIELab data, this is the output image data *
* nWidth : Width of the image *
* nHeight : Height of the image *
* Returns SUCCESS when successful or an error code otherwise *
******************************************************************
*)

(*
* when the dialog appears choose RGB to LAB conversion from
* the Miscellaneous options
*)
ret := L_ClrDlg(DLG_LAB, (* CIELAb color dialog *)
Handle, (* Handle to parent window *)
@ClrHandle, (* I need a color handle *)
nil (* no need for a CONVERSION_PARAMS data *)
);

(* do we have a valid handle *)
if ret <> SUCCESS then
Result := ret
else
begin
(* do the conversion from RGB to CIELab *)
ret := L_ClrConvert (ClrHandle,
pSrcRGB,
pDstLAB,
nWidth,
nHeight,
0,
0);

if ret <> SUCCESS then
begin
(* free before leaving *)
L_ClrFree (ClrHandle);
Result := ret;
end
else
begin
(* do not forget to free every thing *)
ret := L_ClrFree (ClrHandle);
Result := ret;
end;
end;

end;

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Emulation Tables (Delphi 4.0)

Emulation Tables (Delphi 4.0)

Note:

At the beginning of the Unit1 file, add LTDLLUNT, LTDLLTYP, and LTDLLDEF to the uses section.

The LEAD Color Conversion toolkit provides emulation tables as one of its conversion methods. This method however is provided only for the following conversions:

  • CMYK to RGB.

  • CIELab to RGB

  • and RGB to CIELab

The Emulation tables' method supports both built-in and custom options. For built-in emulation tables, use the USE_ET option. The custom emulation tables' option, USE_CUSTOM_ET, provides custom conversion using user-supplied images converted from the source images distributed with the library by any tool, as follows:

Conversion | Source | Convert to
CMYK to RGB | src_cmyk_image.tif | RGB image (i.e. dst_cmyk2rgb_image.tif)
RGB to Lab | src_rgb_image.tif | Lab image ( i.e. dst_rgb2lab_image.tif)
Lab to RGB | src_lab_image.tif | RGB image (i.e. dst_lab2rgb_image.tif)

A set of images, already converted and ready for use (dst_cmyk2rgb_image.tif, dst_rgb2lab_image.tif, and dst_lab2rgb_image.tif), is provided. However, using the provided set of converted images will produce the same results as the built-in emulation tables.

The code below shows how a conversion can be done using the built-in tables:

procedure Tables_Convert_CMYKToRGB({in}pInput: Pointer; {out}pOutput: Pointer; {in}nWidth: Integer; {in}nHeight: Integer);
var
ClrHandle : THandle (*Color Handle*);
params : CONVERSION_PARAMS (*Conversion options*);
begin

(* Zero initialize, this step is important*)
ZeroMemory (@params, SizeOf (CONVERSION_PARAMS));

(*
* Conversion with options.
* The conversion will be done with the options specified in the
* params variable.
*)

(* Set the params size *)
params.uStructSize := SizeOf (CONVERSION_PARAMS);

(* We want to use built-in emulation tables *)
params.nMethod := USE_ET;

(* set the active conversion method *)
params.nActiveMethod := USE_ET;

(* initialize the color conversion *)
L_ClrInitL_ClrInit (@ClrHandle, (* pointer to color handle to be returned*)
CCS_CMYK, (* input color space *)
CCS_RGB, (* output color space *)
@params (* pointer to the initialization options *)
);

(* Convert the image buffer *)
L_ClrConvert (ClrHandle, (* conversion handle *)
pInput, (* input buffer *)
pOutput, (* output buffer *)
nWidth, (* pixels width *)
nHeight, (* pixels height *)
0, (* 0 bytes align *)
0); (* 0 bytes align *)

(* free the conversion *)
L_ClrFree (ClrHandle);
end;

The code below shows how a conversion can be done using user-defined tables:

procedure Tables_Convert_CMYKToRGB({in}pInput: Pointer; {out}pOutput: Pointer; {in}nWidth: Integer; {in}nHeight: Integer);
var
ClrHandle : THandle (*Color Handle*);
params : CONVERSION_PARAMS (*Conversion options*);
begin

(* Zero initialize, this step is important*)
ZeroMemory (@params, SizeOf (CONVERSION_PARAMS));

(*
* Conversion with options.
* The conversion will be done with the options specified in the
* params variable.
*)

(* Set the params size *)
params.uStructSize := SizeOf (CONVERSION_PARAMS);

(* We want to use built-in emulation tables *)
params.nMethod := USE_CUSTOM_ET;

(* set the active conversion method *)
params.nActiveMethod := USE_CUSTOM_ET;

(* set the emulation tables *)
StrCopy(params.sInputProfile, 'C:\RGBImage.tif');

(* initialize the color conversion *)
L_ClrInit (@ClrHandle, (* pointer to color handle to be returned*)
CCS_CMYK, (* input color space *)
CCS_RGB, (* output color space *)
@params (* pointer to the initialization options *)
);

(* Convert the image buffer *)
L_ClrConvert (ClrHandle, (* conversion handle *)
pInput, (* input buffer *)
pOutput, (* output buffer *)
nWidth, (* pixels width *)
nHeight, (* pixels height *)
0, (* 0 bytes align *)
0); (* 0 bytes align *)

(* free the conversion *)
L_ClrFree (ClrHandle);
end;

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Generic YUV conversion (Delphi 4.0)

Generic YUV conversion (Delphi 4.0)

Note:

At the beginning of the Unit1 file, add LTDLLUNT, LTDLLTYP, and LTDLLDEF to the uses section.

Generic YUV conversion provides the ability to convert any YUV format to any supported color space, using the YUV_PARAMS structure and adhering to the restrictions listed below. After defining the YUV format, you can proceed with the conversion normally, just like any other conversion. Use L_ClrConvert to perform the conversion and call L_ClrFree to free the conversion handle. Currently the conversion from any color space to Generic YUV is not supported.

Generic YUV conversion currently has the following restrictions:

1. | No sub-sampling of Y is supported
2. | The number of Y elements must be a multiple of both U, and V.
3. | With non-planar formats, vertical sub-sampling of Y, U, and V is not supported.
4. | No alignment supported in planar format; line width must not contain additional bytes.
5. | The horizontal sub-sampling periods of U, and V must be multiples of each other, and the vertical sub-sampling periods of U, and V must be multiples of each other.

Examples:

1.

Converting Y41P to RGB using Generic YUV Conversion:

procedure GenericY41PToRGB({in}pIn: Pointer; {out}pOut: Pointer; {in}nWidth: Integer; {in}nHeight: Integer);
var
hClrHandle : THandle (* Color Handle *);
cpParams : CONVERSION_PARAMS (* Conversion options *);
yuvParams : YUV_PARAMS (* Declare YUV Params structure *);
pOff: array[0..11] of Integer (* Byte ordering of the YUV format *);
begin

(*
* Byte ordering of the format; for Y41P:
* U0 Y0 V0 Y1 U4 Y2 V4 Y3 Y4 Y5 Y6 Y7
* 0 1 2 3 4 5 6 7 8 9 10 11
* Put the Y component order first then the U and V last as follows:
* Y positions: 1,3,5,7,8,9,10,11
* U positions: 0,4
* V positions: 2,6
*)

pOff[0] := 1;
pOff[1] := 3;
pOff[2] := 5;
pOff[3] := 7;
pOff[4] := 8;
pOff[5] := 9;
pOff[6] := 10;
pOff[7] := 11;
pOff[8] := 0;
pOff[9] := 4;
pOff[10] := 2;
pOff[11] := 6;

ZeroMemory (@cpParams, sizeof (CONVERSION_PARAMS));
(* Determine the size of the structure *)
yuvParams.uStructSize := sizeof(YUV_PARAMS);
(* Determine the horizontal sub-sampling of U *)
yuvParams.nUh := 4;
(* Determine the vertical sub-sampling of U *)
yuvParams.nUv := 1;
(* Determine the horizontal sub-sampling of V *)
yuvParams.nVh := 4;
(* Determine the vertical sub-sampling of V */
yuvParams.nVv = 1;
(* Set the byte ordering *)
yuvParams.pOffsets := @pOff;
(* The YUV values range *)
yuvParams.nRange := YUVRANGE_FULL;
(*
* This represents the macro pixels(smallest group of pixels allowed) , which indicates
* how many actual pixels are in the macro pixel, this value is important only in non –
* planar format
*)

yuvParams.nMacroPixel := 8;
(*
* This is a Boolean value that represents the type of the YUV format (Planar = TRUE,
* or non – Planar = FALSE.)
*)
yuvParams.bPlanar := 0; (* Flase *)

(* Fill the pYuvParams value with the address of the YUV_PARAMS structure *)
cpParams.pYuvParams := @yuvParams;
(* Determine the size of CONVERSION_PARAMS *)
cpParams.uStructSize := SizeOf (CONVERSION_PARAMS);
(*
* Determine the type of conversion to be used in the conversion, for YUVGeneric, only use
* USE_BUILTIN
*)
cpParams.nMethod := USE_BUILTIN;
(*
* Determine the type of conversion to be activated. For YUVGeneric,
* only USE_BUILTIN
*)
cpParams.nActiveMethod := USE_BUILTIN;

(* Initialize the conversion *)
L_ClrInit(@hClrHandle, CCS_YUV, CCS_RGB, @cpParams);

(* Convert the buffers pIn to pOut *)
L_ClrConvert (hClrHandle, pIn, pOut, nWidth, nHeight, 0, 0);

(* Free the handles *)
L_ClrFree (hClrHandle);
end;

2.

Converting YVU9 (Planar) to RGB using Generic YUV Conversion:

procedure GenericYVU9ToRGB({in}pIn: Pointer; {out}pOut: Pointer; {in}nWidth: Integer; {in}nHeight: Integer);
var
hClrHandle : THandle (* Color Handle *);
cpParams : CONVERSION_PARAMS (* Conversion options *);
yuvParams : YUV_PARAMS (* Declare YUV Params structure *);
pOff: array[0..0] of Integer (* Byte ordering of the YUV format *);
begin

(*
* This array of integers specifies the byte order of the yuv format. For planar
* formats it takes only a single value that represents planes sequence in the buffer:
* YUV, YVU, UYV, UVY, VYU, or VUY.
*)
pOff[0] := PLANAR_YVU; (*
* PLANAR_YVU means the Y plane comes first in
* the buffer, then the V plane, and the U plane is last
*)

ZeroMemory (@cpParams, SizeOf (CONVERSION_PARAMS));

(* Determine the size of the structure *)
yuvParams.uStructSize := SizeOf(YUV_PARAMS);

(* Determine the horizontal sub-sampling of U *)
yuvParams.nUh := 4;

(* Determine the vertical sub-sampling of U *)
yuvParams.nUv := 4;

(* Determine the horizontal sub-sampling of V *)
yuvParams.nVh := 4;

(* Determine the vertical sub-sampling of V *)
yuvParams.nVv := 4;

(* This is a pointer to an integer. Pass the byte ordering array *)
yuvParams.pOffsets := @pOff;

(* The range value determines the YUV range values *)
yuvParams.nRange := YUVRANGE_FULL;

(*
* This represents the macro pixels(smallest group of pixels allowed) , which indicates
* how many actual pixels are in the macro pixel. This value is important only in non – p
* planar format
*)
yuvParams.nMacroPixel := 16;

(*
* This is a Boolean value that represents the type of the YUV format (Planar, or non
* - Planar.)
*)
yuvParams.bPlanar := 1; (* True *)

(*
* Pass the YUV_PARAMS structure address to the pYuvParams member of the
* CONVERSION_PARAMS structure
*)
cpParams.pYuvParams := @yuvParams;

(* Determine the size of the CONVERSION_PARAMS structure*)
cpParams.uStructSize := SizeOf (CONVERSION_PARAMS);

(*
* Determine the type of conversion to be used. For YUVGeneric, use
* only USE_BUILTIN
*)
cpParams.nMethod := USE_BUILTIN;

(*
* Determine the type of conversion to be activated. For
* YUVGeneric, use only USE_BUILTIN
*)
cpParams.nActiveMethod := USE_BUILTIN;

(* Initialize the conversion *)
L_ClrInit(@hClrHandle, CCS_YUV, CCS_RGB, @cpParams);

(* Convert the buffers pIn to pOut *)
L_ClrConvert (hClrHandle, pIn, pOut, nWidth, nHeight, 0, 0);

(* Free the handles *)
L_ClrFree (hClrHandle);
end;

;

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Visual Basic Tutorials

Built-in Conversion

Color Conversion to an Image

Conversion Given an ICM Profiles

Dialog Based Initialization

Emulation Tables

Generic YUV conversion

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Color Conversion Tutorials


Built-in Conversion (Visual Basic)

Built-in Conversion (Visual Basic)

The Color Conversion C DLL provides built-in conversion. To do a built-in conversion, follow the steps below:

1.

Define the following global variables:

Dim RGBData(100) As Byte
Dim LABData(100) As Byte
Dim nWidth As Integer
Dim nHeight As Integer
Dim nInAlign As Integer
Dim nOutAlign As Integer
Dim ClrHandle As Long 'color handle
Dim cnvParam As CONVERSION_PARAMS 'conversion params
Dim wtPoint As WHITEPOINT 'white point definition

2.

Set the conversion options by filling a CONVERSION_PARAMS structure:

'set the whitepoint
wtPoint.nWhitePoint = CIELAB_D50
wtPoint.xWhite = 0
wtPoint.yWhite = 0

'initialize the conversion structure
cnvParam.uStructSize = Len(cnvParam)
cnvParam.nQuantization = 8
cnvParam.nMethod = USE_BUILTIN
cnvParam.nActiveMethod = USE_BUILTIN
cnvParam.pCmykParams = 0
cnvParam.pLabParams = 0
cnvParam.pYuvParams = 0
cnvParam.sDstInputTable(0) = 0
cnvParam.sInputProfile(0) = 0
cnvParam.sOutputProfile(0) = 0
cnvParam.pWpoint = VarPtr(wtPoint)

3.

Initialize the color conversion handle with L_ClrInit ():

L_ClrInit ClrHandle, CCS_RGB, CCS_LAB, cnvParam

4.

Convert from RGB to CIELab:

L_ClrConvert ClrHandle, RGBData(0), LABData(0), nWidth, nHeight, nInAlign, nOutAlign

5.

At the end, free the color conversion handle:

L_ClrFree ClrHandle

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Color Conversion to an Image (Visual Basic)

Color Conversion to an Image (Visual Basic)

The color conversion C DLL provides direct color conversion to an image. To do a conversion, follow the steps below:

1.

Define the following global variables:

Dim LABData(100) As Byte
Dim LBitmap As LEADBitmapHandle
Dim nWidth As Integer
Dim nHeight As Integer
Dim nInAlign As Integer
Dim nOutAlign As Integer

2.

To convert 320x240 24 bit CIELab data to a LEAD bitmap with RGB24 do the following:

L_ClrConvertDirectToBitmap CCS_LAB, CCS_BGR, LABData(0), LBitmap, Len(Lbitmap), nWidth, nHeight, nInAlign, nOutAlign

' You can use the Lead bitmap as you want

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Conversion Given an ICM Profile (Visual Basic)

Conversion Given an ICM Profile (Visual Basic)

1.

Define the following global variables:

Dim ClrHandle As Long
Dim cnvParam As CONVERSION_PARAMS
Dim wtPoint As WHITEPOINT 'this needs to be defined in VB, because its member in CONVERSION_PARAMS can't be accessed since it is a pointer and not a structure
Dim RGBColor(3) As Byte
Dim ColorSpace(4) As Byte

2.

Set the conversion options by filling a CONVERSION_PARAMS structure:

wtPoint.nWhitePoint = CIELAB_D50
wtPoint.xWhite = 0
wtPoint.yWhite = 0
cnvParam.uStructSize = Len(cnvParam)
cnvParam.nQuantization = 8
cnvParam.nMethod = USE_CUSTOM_ICC
cnvParam.nActiveMethod = USE_CUSTOM_ICC
cnvParam.pCmykParams = 0
cnvParam.pLabParams = 0
cnvParam.pYuvParams = 0
cnvParam.sDstInputTable(0) = 0
cnvParam.pWpoint = VarPtr(wtPoint)

cnvParam.pMemInputProfile = 0
cnvParam.pMemOutputProfile = 0

Dim str1 As String
str1 = "C:\\MyRGBProfile.ICM"
Dim i As Integer
For i = 0 To Len(str1) – 1
cnvParam.sInputProfile(i) = Asc(Right(str1, Len(str1) - i))
Next i

str1 = "C:\\MyRGBProfile.ICM"
For i = 0 To Len(str1) – 1
cnvParam.sOutputProfile(i) = Asc(Right(str1, Len(str1) - i))
Next i

3.

Initialize the color conversion handle with L_ClrInit ():

L_ClrInit ClrHandle, CCS_CMYK, CCS_RGB, cnvParam

4.

Now, do the conversion:

ColorSpace(0) = 100
ColorSpace(1) = 100
ColorSpace(2) = 100
ColorSpace(3) = 100
L_ClrConvert ClrHandle, ColorSpace(0), RGBColor(0), 1, 1, 0, 0

5.

At the end, free the color conversion handle:

L_ClrFree ClrHandle

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Dialog Based Initialization (Visual Basic)

Dialog Based Initialization (Visual Basic)

The Color Conversion C DLL provides a color space dialog that can be used to initialize a conversion. To do a dialog based initialization follow the steps below:

1.

Define the following global variables:

Dim RGBData(100) As Byte
Dim LABData(100) As Byte
Dim nWidth As Integer
Dim nHeight As Integer
Dim nInAlign As Integer
Dim nOutAlign As Integer
Dim ClrHandle As Long 'color handle
Dim cnvParam As CONVERSION_PARAMS

2.

Display the color space dialog box to initialize as follows:

L_ClrDlg DLG_LAB, Form1.hWnd, ClrHandle, cnvParam

3.

Convert from RGB to CIELab as follows:

L_ClrConvert ClrHandle, RGBData(0), LABData(0), nWidth, nHeight, nInAlign, nOutAlign

4.

At the end, free the color conversion handle:

L_ClrFree ClrHandle

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Emulation Tables (Visual Basic)

Emulation Tables (Visual Basic)

The LEAD Color Conversion toolkit provides emulation tables as one of its conversion methods. This method however is provided only for the following conversions:

  • CMYK to RGB.

  • CIELab to RGB

  • and RGB to CIELab

The Emulation tables' method supports both built-in and custom options. For built-in emulation tables, use the USE_ET option. The custom emulation tables' option, USE_CUSTOM_ET, provides custom conversion using user-supplied images, converted from the source images distributed with the library by any tool, as follows:

Conversion | Source | Convert to
CMYK to RGB | src_cmyk_image.tif | RGB image (i.e. dst_cmyk2rgb_image.tif)
RGB to Lab | src_rgb_image.tif | Lab image ( i.e. dst_rgb2lab_image.tif)
Lab to RGB | src_lab_image.tif | RGB image (i.e. dst_lab2rgb_image.tif)

A set of images, already converted and ready for use (dst_cmyk2rgb_image.tif, dst_rgb2lab_image.tif, and dst_lab2rgb_image.tif), is provided. However, using the provided set of converted images will produce the same results as the built-in emulation tables.

The code below shows how a conversion can be done using the built-in tables:

Function Tables_Convert_CMYKToRGB(RGBData() As Byte, LABData() As Byte, nWidth As Integer, nHeight As Integer, nInAlign As Integer, nOutAlign As Integer) As Integer
'This function converts an RGB24 image to LAB using built-in emulation tables.
'-RGBData: pointer to the input RGB data.
'-LABData: pointer to the output LAB beffer
'-nWidth: width of the passed image.
'-nHeight: height of the passed image.
'-nInAlign: input buffer alignment.
'-nOutAlign: output buffer alignment.

Dim ClrHandle As Long 'color handle
Dim cnvParam As CONVERSION_PARAMS 'conversion params
Dim ret As Integer 'return value

'initialize the conversion structure
cnvParam.uStructSize = Len(cnvParam)
cnvParam.nQuantization = 8
cnvParam.nMethod = USE_ET
cnvParam.nActiveMethod = USE_ET
cnvParam.pCmykParams = 0
cnvParam.pLabParams = 0
cnvParam.pYuvParams = 0
cnvParam.sDstInputTable(0) = 0
cnvParam.sInputProfile(0) = 0
cnvParam.sOutputProfile(0) = 0

'initialize the conversion engine
ret = L_ClrInit (ClrHandle, CCS_RGB, CCS_LAB, cnvParam)

'do we have a valid handle
If (ret = SUCCESS) Then
'do the conversion from RGB to CIELab
ret = L_ClrConvert (ClrHandle, RGBData(0), LABData(0), nWidth, nHeight, nInAlign, nOutAlign)
If (ret <> SUCCESS) Then
MsgBox "Failed to convert from RGB to LAB"
Tables_Convert_CMYKToRGB = ret
End If

'do not forget to free every thing
L_ClrFree (ClrHandle)
Else
MsgBox "Failed to initialize LTCLR"
Tables_Convert_CMYKToRGB = ret
End If

End Function

The code below shows how a conversion can be done using user-defined tables:

Function Tables_Convert_CMYKToRGB(RGBData() As Byte, LABData() As Byte, nWidth As Integer, nHeight As Integer, nInAlign As Integer, nOutAlign As Integer, strDst As String) As Integer
'This function converts an RGB24 image to LAB using built-in emulation tables.
'-RGBData: pointer to the input RGB data.
'-LABData: pointer to the output LAB beffer
'-nWidth: width of the passed image.
'-nHeight: height of the passed image.
'-nInAlign: input buffer alignment.
'-nOutAlign: output buffer alignment.
'-strDst: destination custom table.

Dim ClrHandle As Long 'color handle
Dim cnvParam As CONVERSION_PARAMS 'conversion params
Dim ret As Integer 'return value
Dim i As Integer

'initialize the conversion structure
cnvParam.uStructSize = Len(cnvParam)
cnvParam.nQuantization = 8
cnvParam.nMethod = USE_CUSTOM_ET
cnvParam.nActiveMethod = USE_CUSTOM_ET
cnvParam.pCmykParams = 0
cnvParam.pLabParams = 0
cnvParam.pYuvParams = 0
cnvParam.sDstInputTable(0) = 0
cnvParam.sInputProfile(0) = 0
cnvParam.sOutputProfile(0) = 0

For i = 0 To Len(strDst) – 1
cnvParam.sDstInputTable(i) = Asc(Right(strDst, Len(strDst) - i))
Next i

'initialize the conversion engine
ret = L_ClrInit (ClrHandle, CCS_RGB, CCS_LAB, cnvParam)

'do we have a valid handle
If (ret = SUCCESS) Then
'do the conversion from RGB to CIELab
ret = L_ClrConvert (ClrHandle, RGBData(0), LABData(0), nWidth, nHeight, nInAlign, nOutAlign)
If (ret <> SUCCESS) Then
MsgBox "Failed to convert from RGB to LAB"
Tables_Convert_CMYKToRGB = ret
End If

'do not forget to free every thing
L_ClrFree (ClrHandle)
Else
MsgBox "Failed to initialize LTCLR"
Tables_Convert_CMYKToRGB = ret
End If

End Function

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Generic YUV conversion (Visual Basic)

Generic YUV conversion (Visual Basic)

Generic YUV conversion provides the ability to convert any YUV format to any supported color space, using the YUV_PARAMS structure and adhering to the restrictions listed below. After defining the YUV format, you can proceed with the conversion normally, just like any other conversion. Use L_ClrConvert to perform the conversion and call L_ClrFree to free the conversion handle. Currently the conversion from any color space to Generic YUV is not supported.

Generic YUV conversion currently has the following restrictions:

1. | No sub-sampling of Y is supported
2. | The number of Y elements must be a multiple of both U, and V.
3. | With non-planar formats, vertical sub-sampling of Y, U, and V is not supported.
4. | No alignment supported in planar format; line width must not contain additional bytes.
5. | The horizontal subsampling periods of U, and V must be multiples of each other, and the vertical subsampling periods of U, and V must be multiples of each other.

Examples:

1.

Converting Y41P to RGB using Generic YUV Conversion:

Function GenericY41PToRGB(YUVData() As Byte, RGBData() As Byte, nWidth As Integer, nHeight As Integer) As Integer
Dim ret As Integer
Dim ClrHandle As Long
Dim cnvParam As CONVERSION_PARAMS
Dim pOff(12) As Long

pOff(0) = 1
pOff(1) = 3
pOff(2) = 5
pOff(3) = 7
pOff(4) = 8
pOff(5) = 9
pOff(6) = 10
pOff(7) = 11
pOff(8) = 0
pOff(9) = 4
pOff(10) = 2
pOff(11) = 6
'(1,3,5,7,8,9,10,11,0,4,2,6)

Dim YUVParamas As LPYUV_PARAMS
With YUVParamas
.uStructSize = Len(YUVParamas)
.nMask = 0
.nUh = 4
.nUv = 1
.nVh = 4
.nVv = 1
.pOffsets = VarPtr(pOff(0))
.nMacroPixel = 8
.nRange = YUVRANGE_FULL
.bPlanar = 0
End With

cnvParam.uStructSize = Len(cnvParam)
cnvParam.nQuantization = 0
cnvParam.nMethod = USE_BUILTIN
cnvParam.nActiveMethod = USE_BUILTIN
cnvParam.pCmykParams = 0
cnvParam.pLabParams = 0
cnvParam.pYuvParams = VarPtr(YUVParamas)
cnvParam.sInputProfile(0) = 0
cnvParam.sOutputProfile(0) = 0

ret = L_ClrInit (ClrHandle, CCS_YUV, CCS_RGB, cnvParam)
ret = L_ClrConvert (ClrHandle, YUVData(0), RGBData(0), nWidth, nHeight, 0, 0)
ret = L_ClrFree (ClrHandle)

GenericY41PToRGB = ret

End Function

2.

Converting YVU9 (Planar) to RGB using Generic YUV Conversion:

Function GenericYVU9ToRGB(YUVData() As Byte, RGBData() As Byte, nWidth As Integer, nHeight As Integer) As Integer
Dim ret As Integer
Dim ClrHandle As Long
Dim cnvParam As CONVERSION_PARAMS
Dim pOff(0) As Long

pOff(0) = PLANAR_YVU

Dim YUVParamas As LPYUV_PARAMS
With YUVParamas
.uStructSize = Len(YUVParamas)
.nMask = 0
.nUh = 4
.nUv = 1
.nVh = 4
.nVv = 1
.pOffsets = VarPtr(pOff(0))
.nMacroPixel = 8
.nRange = YUVRANGE_FULL
.bPlanar = 1
End With

cnvParam.uStructSize = Len(cnvParam)
cnvParam.nQuantization = 0
cnvParam.nMethod = USE_BUILTIN
cnvParam.nActiveMethod = USE_BUILTIN
cnvParam.pCmykParams = 0
cnvParam.pLabParams = 0
cnvParam.pYuvParams = VarPtr(YUVParamas)
cnvParam.sInputProfile(0) = 0
cnvParam.sOutputProfile(0) = 0

ret = L_ClrInit (ClrHandle, CCS_YUV, CCS_RGB, cnvParam)
ret = L_ClrConvert (ClrHandle, YUVData(0), RGBData(0), nWidth, nHeight, 0, 0)
ret = L_ClrFree (ClrHandle)

GenericYVU9ToRGB = ret

End Function

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials


Color Conversion C DLL Function Groups

Color Conversion C DLL Function Groups

Color Conversion C DLL Functions:

L_ClrConvert

L_ClrConvertDirect

L_ClrConvertDirectToBitmap

L_ClrConvertToBitmap

L_ClrDlg

L_ClrFree

L_ClrInit

L_ClrIsValid

L_ClrSetConversionParams


ICC Profile Functions

ICC Profile Functions

Creating an ICC Profile

Tags

Loading an ICC Profile

Saving an ICC Profile

Freeing an ICC Profile