Package com.jhlabs.image
Class PolarFilter
java.lang.Object
com.jhlabs.image.AbstractBufferedImageOp
com.jhlabs.image.TransformFilter
com.jhlabs.image.PolarFilter
- All Implemented Interfaces:
BufferedImageOp,Cloneable
A filter which distorts and image by performing coordinate conversions between rectangular and polar coordinates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intInvert the image in a circle.static final intConvert from polar to rectangular coordinates.static final intConvert from rectangular to polar coordinates.Fields inherited from class com.jhlabs.image.TransformFilter
BILINEAR, CLAMP, edgeAction, interpolation, NEAREST_NEIGHBOUR, originalSpace, RGB_CLAMP, transformedSpace, WRAP, ZERO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilter(BufferedImage src, BufferedImage dst) floatfloatintgetType()Get the distortion type.voidsetRelativeCentreX(float relativeCentreX) voidsetRelativeCentreY(float relativeCentreY) voidsetType(int type) Set the distortion type.toString()protected voidtransformInverse(int x, int y, float[] out) Inverse transform a point.Methods inherited from class com.jhlabs.image.TransformFilter
filterPixelsNN, getEdgeAction, getInterpolation, setEdgeAction, setInterpolation, transformSpaceMethods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
-
Field Details
-
RECT_TO_POLAR
public static final int RECT_TO_POLARConvert from rectangular to polar coordinates.- See Also:
-
POLAR_TO_RECT
public static final int POLAR_TO_RECTConvert from polar to rectangular coordinates.- See Also:
-
INVERT_IN_CIRCLE
public static final int INVERT_IN_CIRCLEInvert the image in a circle.- See Also:
-
-
Constructor Details
-
PolarFilter
public PolarFilter()Construct a PolarFilter. -
PolarFilter
public PolarFilter(int type) Construct a PolarFilter.- Parameters:
type- the distortion type
-
-
Method Details
-
filter
- Specified by:
filterin interfaceBufferedImageOp- Overrides:
filterin classTransformFilter
-
setType
public void setType(int type) Set the distortion type.- Parameters:
type- the distortion type- See Also:
-
getType
public int getType()Get the distortion type.- Returns:
- the distortion type
- See Also:
-
transformInverse
protected void transformInverse(int x, int y, float[] out) Description copied from class:TransformFilterInverse transform a point. This method needs to be overriden by all subclasses.- Specified by:
transformInversein 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
-
setRelativeCentreX
public void setRelativeCentreX(float relativeCentreX) -
setRelativeCentreY
public void setRelativeCentreY(float relativeCentreY) -
getRelativeCentreX
public float getRelativeCentreX() -
getRelativeCentreY
public float getRelativeCentreY() -
toString
-