typedef struct _CONVERSION_PARAMS
{
L_UINT uStructSize ;
L_INT nActiveMethod;
LPWHITEPOINT pWpoint;
L_TCHAR sInputProfile[L_MAXPATH];
pMEMICCPROFILE pMemInputProfile;
L_TCHAR sOutputProfile[L_MAXPATH];
pMEMICCPROFILE pMemOutputProfile;
L_TCHAR sDstInputTable[L_MAXPATH];
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 LColor::Initialize 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 LColor::SetConversionParams to switch between conversions by specifying CHANGE_ACTIVE_METHOD for this member. When the conversion method is used with the LColor::SetConversionParams 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. |
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.