PictureEffects Xojo and Real Studio Plugin

RedEyeReduction Method

To fix red eye problem in pictures then use the RedEyeReduction function.

RedEyeReduction(
   p as Picture,
   threshold as Integer,
   mask as Picture,
   progress as IProgressHandler) as Picture

Parameters

p
The source picture to work with (can be 24 or 32 bits).
threshold
The threshold. The default value is 0, the minimum is -255 and the maximum is 255.
mask
Use the mask parameter to limit the red eye reduction to the eyes. This parameter is mandatory. If nil is passed to this parameter then nil will be returned from the RedEyeReduction function.

The mask picture must be a 24 or 32 bit picture and must be the same size as the source picture. If the mask picture is deeper than 1 bit or smaller than the source picture then the function will fail and leave the result picture unchanged.

(Take a note of the 24 or 32 bit, as normally masks in this plugin are 1 bit. This mask though only represents on or off, there is no fading in it, the reason for switching to 24 and 32 bit masks is that 1 bit masks were proven to be unstable on Windows and the 1 bit mask internally on Linux is always 32 bits anyhow)
progress
Use this parameter to use a progress class to get progress feedback from this function. This class must be a class that Implements the IProgressHandler Interface which is defined in this plugin.

Pass nil to this parameter if you don't need progress feedback.

Progress feedback will slow the filter down.

Returns

Picture
If the filter was successful: A reference to the modified picture.

If the src picture was not 1 bit, 24 or 32 bits or if the mask parameter was nil then a nil will be returned.

Remarks

Supported Platforms:

  • MacOS X Carbon
  • MacOS X Cocoa
  • Win32 - Windows
  • Linux x86

    Unsupported Platforms:

  • MacOS X Carbon

    See Also

    GlobalMethods Global