Package com.jhlabs.image
Class KeyFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.KeyFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
,java.lang.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
Constructors Constructor Description KeyFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImage
filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
float
getBTolerance()
Get the brightness tolerance.java.awt.image.BufferedImage
getCleanImage()
Get the clean image.java.awt.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(java.awt.image.BufferedImage cleanImage)
Get the clean image.void
setDestination(java.awt.image.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.java.lang.String
toString()
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
-
-
-
-
Method Detail
-
setHTolerance
public void setHTolerance(float hTolerance)
Set the hue tolerance of the image in the range 0..1.- Parameters:
hTolerance
- the tolerance- See Also:
getHTolerance()
-
getHTolerance
public float getHTolerance()
Get the hue tolerance.- Returns:
- the tolerance
- See Also:
setHTolerance(float)
-
setSTolerance
public void setSTolerance(float sTolerance)
Set the saturation tolerance of the image in the range 0..1.- Parameters:
sTolerance
- the tolerance- See Also:
getSTolerance()
-
getSTolerance
public float getSTolerance()
Get the saturation tolerance.- Returns:
- the tolerance
- See Also:
setSTolerance(float)
-
setBTolerance
public void setBTolerance(float bTolerance)
Set the brightness tolerance of the image in the range 0..1.- Parameters:
bTolerance
- the tolerance- See Also:
getBTolerance()
-
getBTolerance
public float getBTolerance()
Get the brightness tolerance.- Returns:
- the tolerance
- See Also:
setBTolerance(float)
-
setDestination
public void setDestination(java.awt.image.BufferedImage destination)
Set the destination image.- Parameters:
destination
- the destination image- See Also:
getDestination()
-
getDestination
public java.awt.image.BufferedImage getDestination()
Get the destination image.- Returns:
- the destination image
- See Also:
setDestination(java.awt.image.BufferedImage)
-
setCleanImage
public void setCleanImage(java.awt.image.BufferedImage cleanImage)
Get the clean image.- Parameters:
cleanImage
- the clean image- See Also:
getCleanImage()
-
getCleanImage
public java.awt.image.BufferedImage getCleanImage()
Get the clean image.- Returns:
- the clean image
- See Also:
setCleanImage(java.awt.image.BufferedImage)
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-