Class CropFilter

All Implemented Interfaces:
BufferedImageOp, Cloneable

public class CropFilter extends AbstractBufferedImageOp
A filter which crops an image to a given rectangle.
  • Constructor Details

    • CropFilter

      public CropFilter()
      Construct a CropFilter.
    • CropFilter

      public CropFilter(int x, int y, int width, int height)
      Construct a CropFilter.
      Parameters:
      x - the left edge of the crop rectangle
      y - the top edge of the crop rectangle
      width - the width of the crop rectangle
      height - the height of the crop rectangle
  • Method Details

    • setX

      public void setX(int x)
      Set the left edge of the crop rectangle.
      Parameters:
      x - the left edge of the crop rectangle
      See Also:
    • getX

      public int getX()
      Get the left edge of the crop rectangle.
      Returns:
      the left edge of the crop rectangle
      See Also:
    • setY

      public void setY(int y)
      Set the top edge of the crop rectangle.
      Parameters:
      y - the top edge of the crop rectangle
      See Also:
    • getY

      public int getY()
      Get the top edge of the crop rectangle.
      Returns:
      the top edge of the crop rectangle
      See Also:
    • setWidth

      public void setWidth(int width)
      Set the width of the crop rectangle.
      Parameters:
      width - the width of the crop rectangle
      See Also:
    • getWidth

      public int getWidth()
      Get the width of the crop rectangle.
      Returns:
      the width of the crop rectangle
      See Also:
    • setHeight

      public void setHeight(int height)
      Set the height of the crop rectangle.
      Parameters:
      height - the height of the crop rectangle
      See Also:
    • getHeight

      public int getHeight()
      Get the height of the crop rectangle.
      Returns:
      the height of the crop rectangle
      See Also:
    • filter

      public BufferedImage filter(BufferedImage src, BufferedImage dst)
    • toString

      public String toString()
      Overrides:
      toString in class Object