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

The FractalPlasma class is a filter that generates a plasma using fractal subdivision. In general this filter is setting the four edges of the image to random values. After that the middle point between thoose edges will be set based on their value. And also the middle points between two edges. After this step is complete it will take the next four smaller rectangles and do the same procedure again. This filter will created not good looking results on images that are not in a rectangular dimension.

Attention! This is a very CPU intensive filter.

This shows the influence of the roughness factor on a grayscale image.

Roughness 0.000:

Roughness 0.075:

Roughness 0.190:

Supported formats:


Example
  
  var filter: FractalPlasma = new FractalPlasma( 0xabcdef );
  
  var image: Image = new Image( 120, 120, ImageFormat.RGB );
  
  filter.apply( image );
  

See also

Plasma Fraktale (German article)


Public Methods
 MethodDefined by
  
FractalPlasma(randomSeed:int = -1, roughness:Number = 0.075, bias:int = 0x40, amplitude:Number = 1)
Creates a new FractalPlasma object.
FractalPlasma
  
apply(image:Image):void
Applies the filter to the given Image object.
FractalPlasma
  
toString():String
Builds and returns a string containing the name of the class.
FractalPlasma
Constructor detail
FractalPlasma()constructor
public function FractalPlasma(randomSeed:int = -1, roughness:Number = 0.075, bias:int = 0x40, amplitude:Number = 1)

Creates a new FractalPlasma object.

Parameters
randomSeed:int (default = -1) — 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 FractalPlasma 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.
 
roughness:Number (default = 0.075) — The roughness factor of the plasma (should be a small value).
 
bias:int (default = 0x40) — The bias of the colors from 0x00 to 0xff.
 
amplitude:Number (default = 1) — Amplitude of the plasma from 0 to 1.
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.