Class ConvolveWithEdgeOp

  • All Implemented Interfaces:
    java.awt.image.BufferedImageOp, java.awt.image.RasterOp

    public class ConvolveWithEdgeOp
    extends java.lang.Object
    implements java.awt.image.BufferedImageOp, java.awt.image.RasterOp
    This class implements a convolution from the source to the destination.
    Version:
    $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/ConvolveWithEdgeOp.java#1 $
    See Also:
    ConvolveOp
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.image.ConvolveOp convolve  
      static int EDGE_NO_OP
      Alias for ConvolveOp.EDGE_NO_OP.
      static int EDGE_REFLECT
      Adds a border to the image while convolving.
      static int EDGE_WRAP
      Adds a border to the image while convolving.
      static int EDGE_ZERO_FILL
      Alias for ConvolveOp.EDGE_ZERO_FILL.
      private int edgeCondition  
      private java.awt.image.Kernel kernel  
    • Constructor Summary

      Constructors 
      Constructor Description
      ConvolveWithEdgeOp​(java.awt.image.Kernel pKernel)  
      ConvolveWithEdgeOp​(java.awt.image.Kernel pKernel, int pEdgeCondition, java.awt.RenderingHints pHints)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.awt.image.BufferedImage addBorder​(java.awt.image.BufferedImage pOriginal, int pBorderX, int pBorderY)  
      java.awt.image.BufferedImage createCompatibleDestImage​(java.awt.image.BufferedImage pSource, java.awt.image.ColorModel pDesinationColorModel)  
      java.awt.image.WritableRaster createCompatibleDestRaster​(java.awt.image.Raster pSource)  
      java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage pSource, java.awt.image.BufferedImage pDestination)  
      java.awt.image.WritableRaster filter​(java.awt.image.Raster pSource, java.awt.image.WritableRaster pDestination)  
      java.awt.geom.Rectangle2D getBounds2D​(java.awt.image.BufferedImage pSource)  
      java.awt.geom.Rectangle2D getBounds2D​(java.awt.image.Raster pSource)  
      int getEdgeCondition()
      Returns the edge condition.
      java.awt.image.Kernel getKernel()  
      java.awt.geom.Point2D getPoint2D​(java.awt.geom.Point2D pSourcePoint, java.awt.geom.Point2D pDestinationPoint)  
      java.awt.RenderingHints getRenderingHints()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EDGE_REFLECT

        public static final int EDGE_REFLECT
        Adds a border to the image while convolving. The border will reflect the edges of the original image. This is usually a good default. Note that while this mode typically provides better quality than the standard modes EDGE_ZERO_FILL and EDGE_NO_OP, it does so at the expense of higher memory consumption and considerable more computation.
        See Also:
        Constant Field Values
      • EDGE_WRAP

        public static final int EDGE_WRAP
        Adds a border to the image while convolving. The border will wrap the edges of the original image. This is usually the best choice for tiles. Note that while this mode typically provides better quality than the standard modes EDGE_ZERO_FILL and EDGE_NO_OP, it does so at the expense of higher memory consumption and considerable more computation.
        See Also:
        EDGE_REFLECT, Constant Field Values
      • kernel

        private final java.awt.image.Kernel kernel
      • edgeCondition

        private final int edgeCondition
      • convolve

        private final java.awt.image.ConvolveOp convolve
    • Constructor Detail

      • ConvolveWithEdgeOp

        public ConvolveWithEdgeOp​(java.awt.image.Kernel pKernel,
                                  int pEdgeCondition,
                                  java.awt.RenderingHints pHints)
      • ConvolveWithEdgeOp

        public ConvolveWithEdgeOp​(java.awt.image.Kernel pKernel)
    • Method Detail

      • filter

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage pSource,
                                                   java.awt.image.BufferedImage pDestination)
        Specified by:
        filter in interface java.awt.image.BufferedImageOp
      • addBorder

        private java.awt.image.BufferedImage addBorder​(java.awt.image.BufferedImage pOriginal,
                                                       int pBorderX,
                                                       int pBorderY)
      • filter

        public java.awt.image.WritableRaster filter​(java.awt.image.Raster pSource,
                                                    java.awt.image.WritableRaster pDestination)
        Specified by:
        filter in interface java.awt.image.RasterOp
      • createCompatibleDestImage

        public java.awt.image.BufferedImage createCompatibleDestImage​(java.awt.image.BufferedImage pSource,
                                                                      java.awt.image.ColorModel pDesinationColorModel)
        Specified by:
        createCompatibleDestImage in interface java.awt.image.BufferedImageOp
      • createCompatibleDestRaster

        public java.awt.image.WritableRaster createCompatibleDestRaster​(java.awt.image.Raster pSource)
        Specified by:
        createCompatibleDestRaster in interface java.awt.image.RasterOp
      • getBounds2D

        public java.awt.geom.Rectangle2D getBounds2D​(java.awt.image.BufferedImage pSource)
        Specified by:
        getBounds2D in interface java.awt.image.BufferedImageOp
      • getBounds2D

        public java.awt.geom.Rectangle2D getBounds2D​(java.awt.image.Raster pSource)
        Specified by:
        getBounds2D in interface java.awt.image.RasterOp
      • getPoint2D

        public java.awt.geom.Point2D getPoint2D​(java.awt.geom.Point2D pSourcePoint,
                                                java.awt.geom.Point2D pDestinationPoint)
        Specified by:
        getPoint2D in interface java.awt.image.BufferedImageOp
        Specified by:
        getPoint2D in interface java.awt.image.RasterOp
      • getRenderingHints

        public java.awt.RenderingHints getRenderingHints()
        Specified by:
        getRenderingHints in interface java.awt.image.BufferedImageOp
        Specified by:
        getRenderingHints in interface java.awt.image.RasterOp
      • getKernel

        public java.awt.image.Kernel getKernel()