LightControl method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int LightControl(L_PUINT puLowerAvr, L_PUINT puAverage, L_PUINT puUpperAvr, unsigned uFlags);

Delphi Syntax

Function LightControl (puLowerAvr: L_PUINT; puAverage: L_PUINT; puUpperAvr: L_PUINT; uFlags: L_UINT): L_INT;

Overview

Refer to Changing Brightness and Contrast

Remarks

Lightens or darkens all or part of a bitmap by remapping the pixel values.

This method remaps the pixel values of the bitmap across the full range of available pixel values, in order to achieve the values passed in puLowerAvr, puAverage and puUpperAvr.

For example, call this method for a grayscale bitmap, with puAverage containing 150, puLowerAvr containing 100 and puUpperAvr containing 190. The pixels of the bitmap will be remapped so that the new average pixel value for the entire bitmap will be 150, the new average value for those pixels with a value between 0 and the average value for the entire bitmap will be 100, and the new average value for those pixels with a value between the average value for the entire bitmap and the maximum pixel value in the bitmap will be 190.

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.

For an example, see the following figure:

image\LightControl_before.gif

The following figure shows the same bitmap, after the effect has been applied:

image\LightControl_after.gif

To obtain this effect, the following settings were used with the method:

uLowerAvr = 100

uAverage = 255

uUpperAvr = 255

uFlag = YUV_SPACE

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:

Sharpen method, Posterize method, Emboss method, Average method, Median method, AddNoise method, IntensityDetect method, SpatialFilter method, BinaryFilter method, MaxFilter method, MinFilter method, Oilify method, Solarize method, WindowLevel method, Mosaic method, Pixelate method

Topics:

Raster Images: Modifying Intensity Values