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 categories of conversion functions:
This process does not 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
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. In the case of CMYK conversions, this approach is not suitable as it uses built-in formulas and optimal conversion is not possible.
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. Call L_ClrInit to initialize a handle of type L_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 by calling the L_ClrFree function. 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
To correct the colors, the source image is converted using an ICC profile with this method. The output can be stored either on the source image or another destination image. The ICC profile used for conversion is allowed to originate from the following sources:
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms