ColorLevel method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int ColorLevel(const LEVELCOLORINFO &Master, const LEVELCOLORINFO &Red, const LEVELCOLORINFO &Green, const LEVELCOLORINFO &Blue, unsigned uFlags);

Delphi Syntax

Function ColorLevel (Master: LEVELCOLORINFO; Red: LEVELCOLORINFO; Green: LEVELCOLORINFO; Blue: LEVELCOLORINFO; uFlags: L_UINT): L_INT;

Overview

Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Applies color leveling to an image. It changes the image shadows, midtones and highlights.

The Master, Red, Green and Blue parameters tell the ColorLevel method what constitutes shadows, midtones, and highlights and how to remap the shadows, midtones and highlights.

Control the amount of image balance and leveling by controlling the values of the uMinInput, uMaxInput, uMinOutput, uMaxOutput, and uGamma members of the LEVELCOLORINFO record (structure).

image\sqrblit.gif The uMinInput member of an LEVELCOLORINFO record (structure) defines what the method interprets as shadows for that color channel. Any value less than or equal to uMinInput is considered a shadow.

image\sqrblit.gif The uMaxInput member of an LEVELCOLORINFO record (structure) defines what the method interprets as highlights for that color channel. Any value greater than or equal to uMaxInput is considered a highlight.

image\sqrblit.gif The value of the uMaxInput member must be greater than the value of the uMinInput member by at least 2.

image\sqrblit.gif Midtones are those values between uMinInput and uMaxInput.

image\sqrblit.gif The uMinOutput member is the value to which the shadows will be mapped.

image\sqrblit.gif The uMaxOutput member is the value to which the highlights will be mapped.

image\sqrblit.gif The uGamma member is used to modify the midtone values.

If only LEVEL_MASTER is set in uFlags then the rest of the channels will still be affected.

If the image is a grayscale image, then you must set LEVEL_MASTER in uFlags, otherwise the method will not have any effect.

If uMinOutput > uMaxOutput then the bitmap’s shadows and highlights will be inverted.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.

If the image has a region, the effect will be applied on the region only.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Elements:

Auto ColorLevel method, Sharpen method, Posterize method, Mosaic method, Emboss method, ShowAverageDlg method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method, BinaryFilter method, ColorLevel method, SelectiveColor method.

Topics:

Raster Images: Modifying Intensity Values