Packagede.popforge.imageprocessing.filters.noise
Classpublic final class Pixelate
ImplementsIFilter

The Pixelate class is a filter that replaces neighbour pixels with the same color.

This filter smooths an image down using a BitmapData and then scales it up. This is done native because of BitmapData.draw().

Supported formats:


Example
  
  var filter: Pixelate = new Pixelate();
  
  var video: WebCam = new WebCam( 160, 120 );
  var image: Image = new Image( 160, 120, ImageFormat.GRAYSCALE );
  
  image.loadBitmapData( video.getCurrentFrame(), true );
  
  filter.apply( image );
  



Public Methods
 MethodDefined by
  
Pixelate(size:int = 2)
Creates a new Pixelate object.
Pixelate
  
apply(image:Image):void
Applies the filter to the given Image object.
Pixelate
  
toString():String
Builds and returns a string containing the name of the class.
Pixelate
Constructor detail
Pixelate()constructor
public function Pixelate(size:int = 2)

Creates a new Pixelate object. The scale indicates how the pixels will be scaled up. A scale of 2 doubles each pixel.

Parameters
size:int (default = 2) — The scale of the pixelate effect. Must be greater than zero.
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.