com.jhlabs.image

Class KeyFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class KeyFilter
extends AbstractBufferedImageOp

An experimental filter which can be used for keying against a clean shot. Given a source image, a clean image and a destination image, the filter replaces all pixels in the source which nearly equal the equivalent clean pixel by destination pixels.

Constructor Summary

KeyFilter()
Construct a KeyFilter.

Method Summary

BufferedImage
filter(BufferedImage src, BufferedImage dst)
float
getBTolerance()
Get the brightness tolerance.
BufferedImage
getCleanImage()
Get the clean image.
BufferedImage
getDestination()
Get the destination image.
float
getHTolerance()
Get the hue tolerance.
float
getSTolerance()
Get the saturation tolerance.
void
setBTolerance(float bTolerance)
Set the brightness tolerance of the image in the range 0..1.
void
setCleanImage(BufferedImage cleanImage)
Get the clean image.
void
setDestination(BufferedImage destination)
Set the destination image.
void
setHTolerance(float hTolerance)
Set the hue tolerance of the image in the range 0..1.
void
setSTolerance(float sTolerance)
Set the saturation tolerance of the image in the range 0..1.
String
toString()

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Constructor Details

KeyFilter

public KeyFilter()
Construct a KeyFilter.

Method Details

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)

getBTolerance

public float getBTolerance()
Get the brightness tolerance.
Returns:
the tolerance

getCleanImage

public BufferedImage getCleanImage()
Get the clean image.
Returns:
the clean image

getDestination

public BufferedImage getDestination()
Get the destination image.
Returns:
the destination image

getHTolerance

public float getHTolerance()
Get the hue tolerance.
Returns:
the tolerance

getSTolerance

public float getSTolerance()
Get the saturation tolerance.
Returns:
the tolerance

setBTolerance

public void setBTolerance(float bTolerance)
Set the brightness tolerance of the image in the range 0..1.
Parameters:
bTolerance - the tolerance

setCleanImage

public void setCleanImage(BufferedImage cleanImage)
Get the clean image.
Parameters:
cleanImage - the clean image

setDestination

public void setDestination(BufferedImage destination)
Set the destination image.
Parameters:
destination - the destination image

setHTolerance

public void setHTolerance(float hTolerance)
Set the hue tolerance of the image in the range 0..1.
Parameters:
hTolerance - the tolerance

setSTolerance

public void setSTolerance(float sTolerance)
Set the saturation tolerance of the image in the range 0..1.
Parameters:
sTolerance - the tolerance

toString

public String toString()