Classes


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

Class Summary
Constructor Attributes Constructor Name and Description
 
ImageData(sketchimage)
ImageData.
Field Summary
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 Summary
Method Attributes Method Name and Description
void 
set(index, value)
calls this.source.setpixel().
Class Detail

ImageData

(sketchimage)
ImageData.

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
 

©2012-2013
Max MSP Documentation copied to JsDoc by Tim Schenk SEO Frelancer Berlin. Some examples are by him. Some descriptions of classes, interfaces, properties, methods or events are by him. Until now, most of it is a copy. Published with permission of Cycling '74. This document might be wrong or incomplete. All informations without any warranty. All trademarks are the property of their respective owners. Documentation generated by JsDoc Toolkit on 2013-3-2