Packagede.popforge.imageprocessing.geom.maps
Classpublic final class TwirlMap
InheritanceTwirlMap Inheritance GeometricMap

The TwirlMap class is a displacement map that uses a twirl function to displace given points. Since the twirl has a center and radius it is possible to decide if a point will be displaced or not. The rest is quiet simple. The nearer a point gets into the center of the twirl the more it will be displaced by the given angle.



Public Methods
 MethodDefined by
  
TwirlMap(centerX:Number, centerY:Number, angle:Number, radius:Number)
Creates a new TwirlMap object.
TwirlMap
  
displace(point:Point):Boolean
Displaces a Point with the given displace function.
TwirlMap
  
toString():String
Builds and returns a string containing the name of the class.
TwirlMap
Constructor detail
TwirlMap()constructor
public function TwirlMap(centerX:Number, centerY:Number, angle:Number, radius:Number)

Creates a new TwirlMap object.

Parameters
centerX:Number — The x position of the twirl´s center.
 
centerY:Number — The y position of the twirl´s center.
 
angle:Number — The radius of the twirl.
 
radius:Number — The angle of the twirl in radians.
Method detail
displace()method
public override function displace(point:Point):Boolean

Displaces a Point with the given displace function. This function modifies the original point and checks if it has been modified or not. A sphere map can check first if the point is inside of its radius. If this is not the case the displace function should return false.

Parameters
point:Point — The point that will be displaced.

Returns
Booleantrue if the x or y value of the Point has been changed.
toString()method 
public override function toString():String

Builds and returns a string containing the name of the class.

Returns
String — A string containing the name of the class.