Last modified: 2013-3-2
Class ImageData
Canvas-Api for Max (can be found in MAX_PATH/Cycling '74/jsextensions/)
interface ImageData.
Defined in: CanvasExtension.js
Constructor Attributes | Constructor Name and Description |
---|---|
ImageData(sketchimage)
ImageData.
|
Field Attributes | Field Name and Description |
---|---|
Array |
One dimensional Array of RGBA pixel values.
|
Integer |
Height of the image.
|
Image |
The Image object.
|
Integer |
Width of the image
|
Method Attributes | Method Name and Description |
---|---|
void |
set(index, value)
calls this.source.setpixel().
|
Class Detail
ImageData
(sketchimage)
ImageData.
Defined in: CanvasExtension.js
Defined in: CanvasExtension.js
- Example:
function getImageData(filename){ var sketchimage = new Image(filename); return new ImageData(sketchimage); }
- Parameters:
- {Image} sketchimage
Field Detail
{Array}
data
One dimensional Array of RGBA pixel values. Integer values 0-255
- Example:
//pseudocode to illustrate the structure of this array var r,g,b,alpha; for(var i = 0; i < imageDataInstance.data.length; i+=4){ r = imageDataInstance.data[i]; g = imageDataInstance.data[i+1]; b = imageDataInstance.data[i+2]; alpha = imageDataInstance.data[i+3]; }
{Integer}
height
Height of the image.
{Image}
source
The Image object.
{Integer}
width
Width of the image
Method Detail
{void}
set
(index, value)
calls this.source.setpixel(). See Image.setpixel()
- Parameters:
- {Integer} index
- {Integer} value