BalanceColors method (ILEADRasterProcess)

Visual Basic example

Visual C++ 5.0 example

 

Syntax

short BalanceColors(ILEADRaster *pRaster, float fRedToRed, float fRedToGreen, float fRedToBlue, float fGreenToRed, float fGreenToGreen, float fGreenToBlue, float fBlueToRed, float fBlueToGreen, float fBlueToBlue);

Overview

Refer to Correcting Colors.

Remarks

Redistributes the RGB values of the specified bitmap, using the values stored in the specified structures.

For each pixel in the bitmap, the red value is modified using the values of the fRedToXXX parameters. This generates an intermediate red value, an intermediate green value and an intermediate blue value.

For each pixel in the bitmap the green value is modified using the values of the fGreenToXXX parameters. This generates an intermediate red value, an intermediate green value and an intermediate blue value.

For each pixel in the bitmap the blue value is modified using the values of the fBlueToXXX parameters. This generates an intermediate red value, an intermediate green value and an intermediate blue value.

The intermediate red values are added to generate the new red value for the pixel. The intermediate green values are added to generate the new green value for the pixel and the intermediate blue values are added to generate the new blue value for the pixel. This triplet forms the new RGB value for the pixel.

For example, if a the following parameter values are used to redistribute the red value of a pixel:

fRedToRed = 0.50

fRedToGreen = 0.50

fRedToBlue = 0.0

then 50% of the current red value of the pixel will be added to the new red value for the pixel and 50% of the current red value of the pixel will be added to the new green value for the pixel.

This method can process the whole image or a region of the image.

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

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:

ConvertToColoredGray method, GrayScale method, GrayscaleExt method, IsGrayscale property

Topics:

Raster Images: Modifying Intensity Values