Package com.jhlabs.image
Class CropFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.CropFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
,java.lang.Cloneable
public class CropFilter extends AbstractBufferedImageOp
A filter which crops an image to a given rectangle.
-
-
Constructor Summary
Constructors Constructor Description CropFilter()
Construct a CropFilter.CropFilter(int x, int y, int width, int height)
Construct a CropFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImage
filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
int
getHeight()
Get the height of the crop rectangle.int
getWidth()
Get the width of the crop rectangle.int
getX()
Get the left edge of the crop rectangle.int
getY()
Get the top edge of the crop rectangle.void
setHeight(int height)
Set the height of the crop rectangle.void
setWidth(int width)
Set the width of the crop rectangle.void
setX(int x)
Set the left edge of the crop rectangle.void
setY(int y)
Set the top edge of the crop rectangle.java.lang.String
toString()
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
-
-
-
-
Constructor Detail
-
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 rectangley
- the top edge of the crop rectanglewidth
- the width of the crop rectangleheight
- the height of the crop rectangle
-
-
Method Detail
-
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()
-
getX
public int getX()
Get the left edge of the crop rectangle.- Returns:
- the left edge of the crop rectangle
- See Also:
setX(int)
-
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()
-
getY
public int getY()
Get the top edge of the crop rectangle.- Returns:
- the top edge of the crop rectangle
- See Also:
setY(int)
-
setWidth
public void setWidth(int width)
Set the width of the crop rectangle.- Parameters:
width
- the width of the crop rectangle- See Also:
getWidth()
-
getWidth
public int getWidth()
Get the width of the crop rectangle.- Returns:
- the width of the crop rectangle
- See Also:
setWidth(int)
-
setHeight
public void setHeight(int height)
Set the height of the crop rectangle.- Parameters:
height
- the height of the crop rectangle- See Also:
getHeight()
-
getHeight
public int getHeight()
Get the height of the crop rectangle.- Returns:
- the height of the crop rectangle
- See Also:
setHeight(int)
-
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 classjava.lang.Object
-
-