Packagede.popforge.imageprocessing.geom.maps
Classpublic final class SphereMap
InheritanceSphereMap Inheritance GeometricMap

The SphereMap class is a displacement map that uses a three dimensional sphere to displace given points. The sphere has a center and a radius. So only points that are inside this radius will be displaced. Since the sphere has three dimensions it will result in the effect that points look like they come out of the picture.



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

Creates a new SphereMap object.

Parameters
centerX:Number — The x position of the sphere´s center.
 
centerY:Number — The y position of the sphere´s center.
 
radius:Number — The radius of the sphere.
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.