public class

CanvasPixelArray

extends JavaScriptObject
java.lang.Object
   ↳ com.google.gwt.core.client.JavaScriptObject
     ↳ com.google.gwt.canvas.dom.client.CanvasPixelArray

Class Overview

Array-like object holding the actual image data for an ImageData object. For each pixel, this object contains a red, green, blue and alpha value between 0 and 255 (in this order). Note that we use ints here to represent the data to avoid complexities stemming from bytes being signed in Java.

Experimental API: This API is still under development and is subject to change.

Summary

Protected Constructors
CanvasPixelArray()
Public Methods
final int get(int i)
Returns the data value at index i.
final int getLength()
Returns the length of the array.
final void set(int i, int value)
Sets the data value at position i to the given value.
[Expand]
Inherited Methods
From class com.google.gwt.core.client.JavaScriptObject
From class java.lang.Object

Protected Constructors

protected CanvasPixelArray ()

Public Methods

public final int get (int i)

Returns the data value at index i.

Parameters
i the data index
Returns
  • the data value

public final int getLength ()

Returns the length of the array.

Returns
  • the array length

public final void set (int i, int value)

Sets the data value at position i to the given value. Most browsers will clamp this value to the range 0...255, but that is not enforced in this implementation.

Parameters
i index to set.
value value to set (use values from 0 to 255)