Packageardisia.bitmapAdjustments
Classpublic class BitmapAdjustments
InheritanceBitmapAdjustments Inheritance Object

Assorted adjustments and effects for BitmapData.

Purely static class.



Public Methods
 MethodDefined By
  
autoLevels(source:BitmapData):BitmapData
[static] Adds an auto color levelling effect to the returned bitmap data by stretching out the colors to use the max color range.
BitmapAdjustments
  
kuwahara(source:BitmapData, size:Number):BitmapData
[static] Adds a Kuwahara effect to the returned bitmap data.
BitmapAdjustments
  
oilPainting(source:BitmapData, levels:int = 24, size:int = 5):BitmapData
[static] Adds a oil painting effect to the returned bitmap data.
BitmapAdjustments
  
pixelate(source:BitmapData, yOffset:int = 0, linesToScan:int = -1, type:String = rectangle, size:Number = 10, spacing:int = 0, noise:Number = 0, backgroundColor:Number):BitmapData
[static] Adds a pixelation (pointillize) effect to the returned bitmap data.
BitmapAdjustments
  
posterize(source:BitmapData, levels:int):BitmapData
[static] Adds a posterize effect to the returned bitmap data.
BitmapAdjustments
  
solarize(source:BitmapData):BitmapData
[static] Adds a solarize effect to the returned bitmap data.
BitmapAdjustments
  
thresholds(source:BitmapData, data:Vector.<ThresholdData>, useGradients:Boolean = false):BitmapData
[static] Returns bitmap data with changes to the colors along color intensity thresholds as defined by passed ThresholdData objects.
BitmapAdjustments
  
vignette(source:BitmapData, size:Number = 0.8):BitmapData
[static] Adds a vignette effect to the returned bitmap data.
BitmapAdjustments
Method Detail
autoLevels()method
public static function autoLevels(source:BitmapData):BitmapData

Adds an auto color levelling effect to the returned bitmap data by stretching out the colors to use the max color range.

Parameters

source:BitmapData — BitmapData

Returns
BitmapData — BitmapData
kuwahara()method 
public static function kuwahara(source:BitmapData, size:Number):BitmapData

Adds a Kuwahara effect to the returned bitmap data.

See http://en.wikipedia.org/wiki/Kuwahara_filter.

Drops alpha channel.

Parameters

source:BitmapData — BitmapData
 
size:Number — Number

Returns
BitmapData — BitmapData
oilPainting()method 
public static function oilPainting(source:BitmapData, levels:int = 24, size:int = 5):BitmapData

Adds a oil painting effect to the returned bitmap data.

Parameters

source:BitmapData — BitmapData
 
levels:int (default = 24) — int The number of intensity levels
 
size:int (default = 5) — int (higher is slower)

Returns
BitmapData — BitmapData
pixelate()method 
public static function pixelate(source:BitmapData, yOffset:int = 0, linesToScan:int = -1, type:String = rectangle, size:Number = 10, spacing:int = 0, noise:Number = 0, backgroundColor:Number):BitmapData

Adds a pixelation (pointillize) effect to the returned bitmap data.

Supports returning slivers of the source to process line by line.

Parameters

source:BitmapData — BitmapData
 
yOffset:int (default = 0) — int Offset from the top to start processing
 
linesToScan:int (default = -1) — int Number of lines to process. Use -1 to process the entire source bitmap
 
type:String (default = rectangle) — String shape to use, see PixelateTypes
 
size:Number (default = 10) — Number Distance from the top to start processing
 
spacing:int (default = 0) — int Spacing between shapes
 
noise:Number (default = 0) — Number Number percent of size to randomize
 
backgroundColor:Number (default = NaN) — Number NaN to use a transparent background

Returns
BitmapData — BitmapData
posterize()method 
public static function posterize(source:BitmapData, levels:int):BitmapData

Adds a posterize effect to the returned bitmap data.

See http://en.wikipedia.org/wiki/Posterization

Parameters

source:BitmapData — BitmapData
 
levels:int — int number of color levels

Returns
BitmapData — BitmapData
solarize()method 
public static function solarize(source:BitmapData):BitmapData

Adds a solarize effect to the returned bitmap data.

See http://en.wikipedia.org/wiki/Solarisation

Parameters

source:BitmapData — BitmapData

Returns
BitmapData — BitmapData
thresholds()method 
public static function thresholds(source:BitmapData, data:Vector.<ThresholdData>, useGradients:Boolean = false):BitmapData

Returns bitmap data with changes to the colors along color intensity thresholds as defined by passed ThresholdData objects.

Each call must pass at least 2 ThresholdData objects to the "data" parameter.

If "useGradients" is true, function expects a ThresholdData object that defines a color at a ratio of 0.

Parameters

source:BitmapData — BitmapData
 
data:Vector.<ThresholdData> — Vector.ThresholdData min length of 2
 
useGradients:Boolean (default = false) — Boolean true to calculate color based on colors defined at the ends of thresholds.

Returns
BitmapData — BitmapData
vignette()method 
public static function vignette(source:BitmapData, size:Number = 0.8):BitmapData

Adds a vignette effect to the returned bitmap data.

See http://en.wikipedia.org/wiki/Vignette_(graphic_design)

Parameters

source:BitmapData — BitmapData
 
size:Number (default = 0.8) — Number percentage of maximum effect (0 to 1)

Returns
BitmapData — BitmapData