Packagecom.hook.imageprocessing.siox.canvas
Classpublic class Canvas
InheritanceCanvas Inheritance flash.display.Sprite
Implements ICanvas

Implementation of a canvas which displays a canvas based on a confidence matrix and imagedata vector.



Public Properties
 PropertyDefined By
  confidenceMatrix : Vector.<Number>
Returns the confidence matrix vector that contains the confidence of the pixels.
Canvas
  imageData : Vector.<Number>
Returns the image data vector that contains the pixel data.
Canvas
  imageHeight : Number
Returns the image height.
Canvas
  imageWidth : Number
Returns the image width.
Canvas
  renderBitmapData : BitmapData
[read-only] Returns the bitmap data that is used to display the image.
Canvas
Protected Properties
 PropertyDefined By
  bufferBitmap : Bitmap
The Bitmap that contains the BitmapData.
Canvas
  _confidenceMatrix : Vector.<Number>
Vector containing the confidence of those pixels.
Canvas
  currentImageBitmapData : BitmapData
The BitmapData used to display the pixel data.
Canvas
  imageBuffer : Vector.<Number>
An buffer vector that contains the rgb pixel data with alpha put in.
Canvas
  _imageData : Vector.<Number>
Vector containing the pixel data.
Canvas
Public Methods
 MethodDefined By
  
Constructor
Canvas
  
initFromBitmapData(data:BitmapData):void
Initializes a canvas object from a BitmapData object.
Canvas
  
initFromData(imageData:Vector.<Number>, imageWidth:Number, imageHeight:Number):void
Initializes a canvas object from a pre-defined image data vector.
Canvas
  
refresh():void
Deprecated helper method that will render the canvas.
Canvas
  
render():void
Renders the entire canvas from the confidence matrix vector and image data vector.
Canvas
  
reset():void
Clears the image back to default.
Canvas
  
update(changed:Vector.<Number>):void
Updated the canvas based on a vector of updated pixels.
Canvas
Property Detail
_confidenceMatrixproperty
protected var _confidenceMatrix:Vector.<Number>

Vector containing the confidence of those pixels.

_imageDataproperty 
protected var _imageData:Vector.<Number>

Vector containing the pixel data.

bufferBitmapproperty 
protected var bufferBitmap:Bitmap

The Bitmap that contains the BitmapData.

confidenceMatrixproperty 
confidenceMatrix:Vector.<Number>

Returns the confidence matrix vector that contains the confidence of the pixels.


Implementation
    public function get confidenceMatrix():Vector.<Number>
    public function set confidenceMatrix(value:Vector.<Number>):void
currentImageBitmapDataproperty 
protected var currentImageBitmapData:BitmapData

The BitmapData used to display the pixel data.

imageBufferproperty 
protected var imageBuffer:Vector.<Number>

An buffer vector that contains the rgb pixel data with alpha put in.

imageDataproperty 
imageData:Vector.<Number>

Returns the image data vector that contains the pixel data.


Implementation
    public function get imageData():Vector.<Number>
    public function set imageData(value:Vector.<Number>):void
imageHeightproperty 
imageHeight:Number

Returns the image height.


Implementation
    public function get imageHeight():Number
    public function set imageHeight(value:Number):void
imageWidthproperty 
imageWidth:Number

Returns the image width.


Implementation
    public function get imageWidth():Number
    public function set imageWidth(value:Number):void
renderBitmapDataproperty 
renderBitmapData:BitmapData  [read-only]

Returns the bitmap data that is used to display the image.


Implementation
    public function get renderBitmapData():BitmapData
Constructor Detail
Canvas()Constructor
public function Canvas()

Constructor

Method Detail
initFromBitmapData()method
public function initFromBitmapData(data:BitmapData):void

Initializes a canvas object from a BitmapData object. Creates a image data vector and confidence matrix vector from the BitmapData.

Parameters

data:BitmapData — The bitmap data to load into the canvas.

initFromData()method 
public function initFromData(imageData:Vector.<Number>, imageWidth:Number, imageHeight:Number):void

Initializes a canvas object from a pre-defined image data vector.

Parameters

imageData:Vector.<Number> — The image data to load into the canvas.
 
imageWidth:Number — The image width.
 
imageHeight:Number — The image height.

refresh()method 
public function refresh():void

Deprecated helper method that will render the canvas.

render()method 
public function render():void

Renders the entire canvas from the confidence matrix vector and image data vector.

reset()method 
public function reset():void

Clears the image back to default.

update()method 
public function update(changed:Vector.<Number>):void

Updated the canvas based on a vector of updated pixels. This greatly helps with performances if only a small amount of pixels were modified.

Parameters

changed:Vector.<Number> — Vector containing changed pixels.