org.jscience.media.pictures.filters
Class TwirlFilter

java.lang.Object
  extended by java.awt.image.ImageFilter
      extended by org.jscience.media.pictures.filters.WholeImageFilter
          extended by org.jscience.media.pictures.filters.TransformFilter
              extended by org.jscience.media.pictures.filters.TwirlFilter
All Implemented Interfaces:
java.awt.image.ImageConsumer, java.io.Serializable, java.lang.Cloneable

public class TwirlFilter
extends TransformFilter

A Filter which distorts an image by twisting it from the centre out. The twisting is centred at the centre of the image and extends out to the smallest of the width and height. Pixels outside this radius are unaffected.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jscience.media.pictures.filters.TransformFilter
CLAMP, edgeAction, WRAP, ZERO
 
Fields inherited from class org.jscience.media.pictures.filters.WholeImageFilter
canFilterIndexColorModel, defaultRGBModel, inBytePixels, inPixels, originalSpace, transformedSpace
 
Fields inherited from class java.awt.image.ImageFilter
consumer
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Constructor Summary
TwirlFilter()
          Construct a TwirlFilter with no distortion.
 
Method Summary
 float getAngle()
          Get the angle of twist.
 void setAngle(float angle)
          Set the angle of twirl in radians. 0 means no distortion.
 void setDimensions(int width, int height)
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
protected  void transformInverse(int x, int y, float[] out)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.media.pictures.filters.TransformFilter
getEdgeAction, imageComplete, setEdgeAction, transformSpace
 
Methods inherited from class org.jscience.media.pictures.filters.WholeImageFilter
setColorModel, setPixels, setPixels
 
Methods inherited from class java.awt.image.ImageFilter
clone, getFilterInstance, resendTopDownLeftRight, setHints, setProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TwirlFilter

public TwirlFilter()
Construct a TwirlFilter with no distortion.

Method Detail

setAngle

public void setAngle(float angle)
Set the angle of twirl in radians. 0 means no distortion.

Parameters:
angle - the angle of twirl. This is the angle by which pixels at the nearest edge of the image will move.

getAngle

public float getAngle()
Get the angle of twist.

Returns:
the angle in radians.

setDimensions

public void setDimensions(int width,
                          int height)
DOCUMENT ME!

Specified by:
setDimensions in interface java.awt.image.ImageConsumer
Overrides:
setDimensions in class WholeImageFilter
Parameters:
width - DOCUMENT ME!
height - DOCUMENT ME!

transformInverse

protected void transformInverse(int x,
                                int y,
                                float[] out)
DOCUMENT ME!

Specified by:
transformInverse in class TransformFilter
Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
out - DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!