com.google.gwt.canvas.dom.client
Class CanvasPixelArray
java.lang.Object
com.google.gwt.core.client.JavaScriptObject
com.google.gwt.canvas.dom.client.CanvasPixelArray
public class CanvasPixelArray
- extends JavaScriptObject
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.
- See Also:
- HTML Canvas
2D CanvasPixelArray
Method Summary |
int |
get(int i)
Returns the data value at index i. |
int |
getLength()
Returns the length of the array. |
void |
set(int i,
int value)
Sets the data value at position i to the given value. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
CanvasPixelArray
protected CanvasPixelArray()
get
public final int get(int i)
- Returns the data value at index i.
- Parameters:
i
- the data index
- Returns:
- the data value
getLength
public final int getLength()
- Returns the length of the array.
- Returns:
- the array length
set
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)