Class 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 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 image
        destination - 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()
      • setMaskImage

        public void setMaskImage​(java.awt.image.BufferedImage maskImage)
        Set the mask image.
        Parameters:
        maskImage - the mask image
        See Also:
        getMaskImage()
      • 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 raster
        dst - the destination raster
        sel - 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 class java.lang.Object