Package com.jhlabs.image
Class ApplyMaskFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.ApplyMaskFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
,java.lang.Cloneable
public class ApplyMaskFilter extends AbstractBufferedImageOp
A filter which uses the alpha channel of a "mask" image to interpolate between a source and destination image.
-
-
Constructor Summary
Constructors Constructor Description ApplyMaskFilter()
Construct an ApplyMaskFIlter.ApplyMaskFilter(java.awt.image.BufferedImage maskImage, java.awt.image.BufferedImage destination)
Construct an ApplyMaskFIlter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
composeThroughMask(java.awt.image.Raster src, java.awt.image.WritableRaster dst, java.awt.image.Raster sel)
Interpolates between two rasters according to the alpha level of a mask raster.java.awt.image.BufferedImage
filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
java.awt.image.BufferedImage
getDestination()
Get the destination image.java.awt.image.BufferedImage
getMaskImage()
Get the mask image.void
setDestination(java.awt.image.BufferedImage destination)
Set the destination image.void
setMaskImage(java.awt.image.BufferedImage maskImage)
Set the mask image.java.lang.String
toString()
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
-
-
-
-
Constructor Detail
-
ApplyMaskFilter
public ApplyMaskFilter()
Construct an ApplyMaskFIlter.
-
ApplyMaskFilter
public ApplyMaskFilter(java.awt.image.BufferedImage maskImage, java.awt.image.BufferedImage destination)
Construct an ApplyMaskFIlter.- Parameters:
maskImage
- the mask imagedestination
- the destination image
-
-
Method Detail
-
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)
-
setMaskImage
public void setMaskImage(java.awt.image.BufferedImage maskImage)
Set the mask image.- Parameters:
maskImage
- the mask image- See Also:
getMaskImage()
-
getMaskImage
public java.awt.image.BufferedImage getMaskImage()
Get the mask image.- Returns:
- the mask image
- See Also:
setMaskImage(java.awt.image.BufferedImage)
-
composeThroughMask
public static void composeThroughMask(java.awt.image.Raster src, java.awt.image.WritableRaster dst, java.awt.image.Raster sel)
Interpolates between two rasters according to the alpha level of a mask raster.- Parameters:
src
- the source rasterdst
- the destination rastersel
- the mask raster
-
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
-
-