com.jhlabs.image

Class ApplyMaskFilter

Implemented Interfaces:
BufferedImageOp, 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

ApplyMaskFilter()
Construct an ApplyMaskFIlter.
ApplyMaskFilter(BufferedImage maskImage, BufferedImage destination)
Construct an ApplyMaskFIlter.

Method Summary

static void
composeThroughMask(Raster src, WritableRaster dst, Raster sel)
Interpolates between two rasters according to the alpha level of a mask raster.
BufferedImage
filter(BufferedImage src, BufferedImage dst)
BufferedImage
getDestination()
Get the destination image.
BufferedImage
getMaskImage()
Get the mask image.
void
setDestination(BufferedImage destination)
Set the destination image.
void
setMaskImage(BufferedImage maskImage)
Set the mask image.
String
toString()

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

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

Constructor Details

ApplyMaskFilter

public ApplyMaskFilter()
Construct an ApplyMaskFIlter.

ApplyMaskFilter

public ApplyMaskFilter(BufferedImage maskImage,
                       BufferedImage destination)
Construct an ApplyMaskFIlter.
Parameters:
maskImage - the mask image
destination - the destination image

Method Details

composeThroughMask

public static void composeThroughMask(Raster src,
                                      WritableRaster dst,
                                      Raster sel)
Interpolates between two rasters according to the alpha level of a mask raster.
Parameters:
src - the source raster
dst - the destination raster
sel - the mask raster

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)

getDestination

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

getMaskImage

public BufferedImage getMaskImage()
Get the mask image.
Returns:
the mask image

setDestination

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

setMaskImage

public void setMaskImage(BufferedImage maskImage)
Set the mask image.
Parameters:
maskImage - the mask image

toString

public String toString()