Package com.jhlabs.image
Class RotateFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.TransformFilter
-
- com.jhlabs.image.RotateFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
,java.lang.Cloneable
public class RotateFilter extends TransformFilter
A filter which rotates an image. These days this is easier done with Java2D, but this filter remains.
-
-
Field Summary
-
Fields inherited from class com.jhlabs.image.TransformFilter
BILINEAR, CLAMP, edgeAction, interpolation, NEAREST_NEIGHBOUR, originalSpace, RGB_CLAMP, transformedSpace, WRAP, ZERO
-
-
Constructor Summary
Constructors Constructor Description RotateFilter()
Construct a RotateFilter.RotateFilter(float angle)
Construct a RotateFilter.RotateFilter(float angle, boolean resize)
Construct a RotateFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getAngle()
Returns the angle of rotation.void
setAngle(float angle)
Specifies the angle of rotation.java.lang.String
toString()
protected void
transformInverse(int x, int y, float[] out)
Inverse transform a point.protected void
transformSpace(java.awt.Rectangle rect)
Forward transform a rectangle.-
Methods inherited from class com.jhlabs.image.TransformFilter
filter, filterPixelsNN, getEdgeAction, getInterpolation, setEdgeAction, setInterpolation
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
-
-
-
-
Constructor Detail
-
RotateFilter
public RotateFilter()
Construct a RotateFilter.
-
RotateFilter
public RotateFilter(float angle)
Construct a RotateFilter.- Parameters:
angle
- the angle to rotate
-
RotateFilter
public RotateFilter(float angle, boolean resize)
Construct a RotateFilter.- Parameters:
angle
- the angle to rotateresize
- true if the output image should be resized
-
-
Method Detail
-
setAngle
public void setAngle(float angle)
Specifies the angle of rotation.- Parameters:
angle
- the angle of rotation.- See Also:
getAngle()
-
getAngle
public float getAngle()
Returns the angle of rotation.- Returns:
- the angle of rotation.
- See Also:
setAngle(float)
-
transformSpace
protected void transformSpace(java.awt.Rectangle rect)
Description copied from class:TransformFilter
Forward transform a rectangle. Used to determine the size of the output image.- Overrides:
transformSpace
in classTransformFilter
- Parameters:
rect
- the rectangle to transform
-
transformInverse
protected void transformInverse(int x, int y, float[] out)
Description copied from class:TransformFilter
Inverse transform a point. This method needs to be overriden by all subclasses.- Specified by:
transformInverse
in classTransformFilter
- Parameters:
x
- the X position of the pixel in the output imagey
- the Y position of the pixel in the output imageout
- the position of the pixel in the input image
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-