typedef struct _LVLCLR
{
L_UINT uStructSize;
LVLCLRINF master;
LVLCLRINF red;
LVLCLRINF green;
LVLCLRINF blue;
} LVLCLR, * pLVLCLR;
The LVLCLR structure is used to set color-leveling information (when used in LBitmap::ColorLevel) or to retrieve color-leveling information (when used in LBitmap::AutoColorLevel).
Size of this structure, in bytes. Use the sizeof operator to calculate this value.
A LVLCLRINF structure that sets the color-leveling information for the master channel when used in LBitmap::ColorLevel.When used in LBitmap::AutoColorLevel with the flag AUTO_CONTRAST or AUTO_INTENSITY, it retrieves the color-leveling information of the master channel*.
A LVLCLRINF structure that sets the color-leveling information for the red channel when used in LBitmap::ColorLevel. When used in LBitmap::AutoColorLevel with the flag AUTO_LEVEL, it retrieves the color-leveling information of the red channel.
A LVLCLRINF structure that sets the color-leveling information for the green channel when used in LBitmap::ColorLevel. When used in LBitmap::AutoColorLevel with the flag AUTO_LEVEL, it retrieves the color-leveling information of the green channel.
A LVLCLRINF structure that sets the color-leveling information for the blue channel when used in LBitmap::ColorLevel. When used in LBitmap::AutoColorLevel with the flag AUTO_LEVEL, it retrieves the color-leveling information of the blue channel.
When used in the LBitmap::ColorLevel function, the structure contains information about the shadows (uMinInput), highlights (nMaxInput), and mapping (nMaxOutput, nMaxOutput, uGamma) values for the specified channel(s) when applying leveling to an image.
When used in the LBitmap::AutoColorLevel function, the structure retrieves the settings for the shadows (uMinInput), highlights (nMaxInput), and mapping values (nMaxOutput, nMaxOutput and uGamma) of the channels that are used in order to apply one of the leveling effects to an image. If these settings are then used with the LBitmap::ColorLevel function, the effect produced will be the same as if the LBitmap::AutoColorLevel function had been used with the appropriate AUTO_LEVEL, AUTO_CONTRAST, or AUTO_INTENSITY processing flag.
If uFlags in LBitmap::AutoColorLevel is set to AUTO_LEVEL, then the master channel is unchanged. For example, if the bitmap is 8 bits per component then uMinInput, nMaxInput, uMinOutput, nMaxOutput and uGamma will have the values 0, 255, 0, 255 and DEFAULT_GAMMA respectively.
If uFlags in LBitmap::AutoColorLevel is set to AUTO_CONTRAST or AUTO_INTENSITY, then the red, green and blue channels are unchanged. For example, if the bitmap is 8 bits per component then uMinInput, nMaxInput, uMinOutput, nMaxOutput and uGamma for the R, G and B channels will have the value 0, 255, 0, 255 and DEFAULT_GAMMA respectively.
In order to speed up widely used image processing filters in LEADTOOLS, the grayscale value (master channel) of a colored image is calculated using the following formulas:
#define CalcGrayValue(r, g, b) ((L_UCHAR)(((L_UCHAR) (((2 * (L_UINT) (r)) + (5 * (L_UINT) (g)) + (L_UINT) (b) + 4) / 8))))
#define CalcGrayValue16(r, g, b) ((L_UINT16) (((2 * (L_UINT32) (r)) + (5 * (L_UINT32) (g)) + (L_UINT32) (b) + 4) / 8))
#define CalcGrayValue32(r, g, b) ((L_UINT32) (((2 * (L_UINT32) (r)) + (5 * (L_UINT32) (g)) + (L_UINT32) (b) + 4) / 8))
The structure is used by:
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document