AutoColorLevel method (ILEADRasterProcess)

Visual Basic example

Visual C++ example

 

Syntax

short AutoColorLevel (ILEADRaster * pRaster, long lBlackClip, long lWhiteClip, long lFlags);

Overview

Refer to Correcting Colors

Remarks

(Raster Pro and above toolkits) Applies one of several types of automatic color leveling to an image.

This method makes the dark values darker and the light values lighter, which automatically enhances shadows and brightens the image. It also maximizes the tonal range of the image. It enhances the contrast and intensity using the image's histogram and a color distribution-based algorithm.

If you set the AUTO_NOPROCESS flag in lFlags, the ColorLevel properties, listed below, will be updated with the color leveling information used by the AutoColorLevel method.

MasterMinInput

MasterMaxInput

MasterMinOutput

MasterMaxOutput

MasterGamma

RedMinInput

RedMaxInput

RedMinOutput

RedMaxOutput

RedGamma

GreenMinInput

GreenMaxInput

GreenMinOutput

GreenMaxOutput

GreenGamma

BlueMinInput

BlueMaxInput

BlueMinOutput

BlueMaxOutput

BlueGamma

If you then call the ColorLevel method with the same values set in the Color Level properties, you will obtain the same result that you would have obtained if you had called the AutoColorLevel method with the leveling flag by itself.

If the image is a grayscale image, then AUTO_LEVEL, AUTO_CONTRAST and AUTO_INTENSITY give identical results. The properties listed above will have the same values.

This function 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 bitmap has a region, the effect will be applied on the region only.

As an example, the following figure shows an image before any automatic color leveling has been performed:

image\OriginalAutoLevel.gif

The following figure shows what would happen if you start with the original image and apply the AutoColorLevel method using the AUTO_LEVEL flag.

image\AUTO_LEVEL.gif

The following figure shows what would happen if you start with the original image and apply the AutoColorLevel method using the AUTO_INTENSITY flag.

image\AUTO_INTENSITY.gif

The following figure shows what would happen if you start with the original image and apply the AutoColorLevel method using the AUTO_CONTRAST flag.

image\AUTO_CONTRAST.gif

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:

MasterMinInput property MasterMaxInput property, MasterMinOutput property, MasterMaxOutput property, MasterGamma property, RedMinInput property, RedMaxInput property, RedMinOutput property, RedMaxOutput property, RedGamma property, GreenMinInput property, GreenMaxInput property, GreenMinOutput property, GreenMaxOutput property, GreenGamma property, BlueMinInput property, BlueMaxInput property, BlueMinOutput property, BlueMaxOutput property, BlueGamma property, ColorLevel method

Topics:

Raster Image Functions: Modifying Intensity Values