Class PolarFilter

All Implemented Interfaces:
BufferedImageOp, Cloneable

public class PolarFilter extends TransformFilter
A filter which distorts and image by performing coordinate conversions between rectangular and polar coordinates.
  • Field Details

    • RECT_TO_POLAR

      public static final int RECT_TO_POLAR
      Convert from rectangular to polar coordinates.
      See Also:
    • POLAR_TO_RECT

      public static final int POLAR_TO_RECT
      Convert from polar to rectangular coordinates.
      See Also:
    • INVERT_IN_CIRCLE

      public static final int INVERT_IN_CIRCLE
      Invert 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

      public BufferedImage filter(BufferedImage src, BufferedImage dst)
      Specified by:
      filter in interface BufferedImageOp
      Overrides:
      filter in class TransformFilter
    • 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: TransformFilter
      Inverse transform a point. This method needs to be overriden by all subclasses.
      Specified by:
      transformInverse in class TransformFilter
      Parameters:
      x - the X position of the pixel in the output image
      y - the Y position of the pixel in the output image
      out - 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

      public String toString()
      Overrides:
      toString in class Object