Class MarginFilter

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

    public final class MarginFilter
    extends AbstractImageFilter
    This filter adds or removes space around the outside of an image. The pixel values of added space depend on the EdgeHandling mode.

    In-place filtering: This class does not support in-place filtering (the source and destination images must be different).

    Since:
    3.0
    Author:
    Chris Jennings
    • Constructor Detail

      • MarginFilter

        public MarginFilter()
      • MarginFilter

        public MarginFilter​(int top,
                            int left,
                            int bottom,
                            int right)
    • Method Detail

      • setMargin

        public void setMargin​(java.awt.Insets i)
      • getMargin

        public java.awt.Insets getMargin()
      • getBottomMargin

        public int getBottomMargin()
      • setBottomMargin

        public void setBottomMargin​(int bottom)
      • getLeftMargin

        public int getLeftMargin()
      • setLeftMargin

        public void setLeftMargin​(int left)
      • getRightMargin

        public int getRightMargin()
      • setRightMargin

        public void setRightMargin​(int right)
      • getTopMargin

        public int getTopMargin()
      • setTopMargin

        public void setTopMargin​(int top)
      • setEdgeHandling

        public void setEdgeHandling​(EdgeHandling edgeMode)
        Sets the edge handling mode to one of REPEAT, WRAP, or ZERO. The edge handling mode is used to create stand-in pixel values for pixels at the edge of the image, where part of the kernel would lie outside of the image.
        Parameters:
        edgeMode - the edge handling mode
        Throws:
        java.lang.NullPointerException - if the edge handling mode is null
      • getEdgeHandling

        public EdgeHandling getEdgeHandling()
        Returns the current edge handling mode.
        Returns:
        the edge handling mode
      • filter

        public java.awt.image.BufferedImage filter​(java.awt.image.BufferedImage src,
                                                   java.awt.image.BufferedImage dest)