Packagede.popforge.imageprocessing.filters.render
Classpublic final class InterpolatedPlasma
ImplementsIFilter

The InterpolatedPlasma class is a filter that generates a plasma based on cosine interpolation. First of all the filter creates a set of points based on the random seed and the other given parameters like the distance. After this step the cosine interpolation is going through all the empty space and interpolates the color between the pixels that have been set before.

This filter is based on a technique from toxie^ainc. and the C++ implementation from Hopper.

Supported formats:


Example
  
  var filter: InterpolatedPlasma = new InterpolatedPlasma( 0xABCDEF, 1, 40 );
  
  var image: Image = new Image( 160, 120, ImageFormat.RGB );
  
  filter.apply( image );
  

See also

apocalypse inc.


Public Methods
 MethodDefined by
  
InterpolatedPlasma(randomSeed:int = 0xffff, amplitude:Number = 1, distance:int = 48, monochrom:Boolean = false)
Creates a new InterpolatedPlasma object.
InterpolatedPlasma
  
apply(image:Image):void
Applies the filter to the given Image object.
InterpolatedPlasma
  
toString():String
Builds and returns a string containing the name of the class.
InterpolatedPlasma
Constructor detail
InterpolatedPlasma()constructor
public function InterpolatedPlasma(randomSeed:int = 0xffff, amplitude:Number = 1, distance:int = 48, monochrom:Boolean = false)

Creates a new InterpolatedPlasma object.

Parameters
randomSeed:int (default = 0xffff) — The random seed number to use. If you keep all other parameters the same, you can generate different pseudo-random results by varying the random seed value. The InterpolatedPlasma function is a mapping function, not a true random-number generation function, so it creates the same results each time from the same random seed.
 
amplitude:Number (default = 1) — Amplitude of the sine waves.
 
distance:int (default = 48) — Distance between waves.
 
monochrom:Boolean (default = false)true if you want to use the same color for all channels.
Method detail
apply()method
public function apply(image:Image):void

Applies the filter to the given Image object.

Parameters
image:Image — The image that will be manipulated.
toString()method 
public function toString():String

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

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