LBitmap::RemoveRedEye

#include "ltwrappr.h"

virtual L_INT LBitmap::RemoveRedEye (rcNewColor, uThreshold, nLightness, uFlags = 0)

COLORREF rcNewColor;

/* new eye color */

L_UINT uThreshold;

/* threshold value */

L_INT nLightness;

/* lightening or darkening value */

L_UINT32 uFlags;

/* flags */

Removes the "red eye" effect in the class object's bitmap by converting the red color in the eye to the new specified color.

Parameter

Description

rcNewColor

COLORREF variable that contains the new color value used to replace the red color in the eyes.

uThreshold

Threshold value that indicates which pixels will be changed by this function. All pixels with a red component value greater than this value will be changed. Pixels with a red component value less than this value will not be changed. This value is between 0 and 255.

nLightness

"Percentage" value that indicates whether the pixels that are replaced are lightened or darkened. If this value is greater than 100, the replaced pixels will be lightened. If this value is less than 100, the replaced pixels will be darkened. This function preserves the lightness of the original pixels and substitutes the red color with the new color.

uFlags

Reserved for future use. Must be 0.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function has no effect on grayscale images, since there is no "red eye" problem in grayscale images.

To use this function the user should select a small region around the eye. Otherwise, the function will change all the red color in the image. This function also allows the user to replace the red color with a new color for the eyes that is nearest to the original color.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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

This function 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 function.

This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.

Required DLLs and Libraries

LTDIS
LTFIL
LTIMGCLR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBase::EnableStatusCallback, Class Members

Topics:

Applying Artistic Effects

 

Correcting Colors

 

Raster Image Functions: Modifying Intensity Values

 

Raster Image Functions: Getting and Setting Pixel Values

 

Using Color Values in LEADTOOLS

 

Raster Image Functions: Correcting Colors

Example

L_INT LBitmap__RemoveRedEyeExample(LBitmap & Bitmap, L_TCHAR * szFile)
{
   L_INT nRet;
   nRet =Bitmap.Load(szFile);
   if(nRet !=SUCCESS)
      return nRet;
   
   return Bitmap.RemoveRedEye(RGB(5, 20, 10), 128, 100);
}