Package pyjsdl :: Module pyjsarray :: Class CanvasPixelArray

Class CanvasPixelArray

object --+    
         |    
TypedArray --+
             |
            CanvasPixelArray

Create a TypedArray interface to CanvasPixelArray.
Instance Methods
 
__init__(self, data=None, offset=None, length=None)
The TypedArray object is instantiated with either the array size, an array of TypedArray or Python type, or an existing ArrayBuffer to view, which creates a new TypedArray of size and included data as the specified type. Optional arguments include offset index at which ArrayBuffer data is inserted and length of an ArrayBuffer.
 
__iter__(self)
 
__getitem__(self, index)
 
__setitem__(self, index, value)
 
set(self, data, offset=0)
Set data to the array. Arguments: data is a list of either the TypedArray or Python type, offset is the start index where data will be set (defaults to 0).
 
subarray(self, begin=0, end=None)
Retrieve a subarray of the array. The subarray is a is a view of the derived array. Optional arguments begin and end (default to begin/end of the array) are the index spanning the subarray.

Inherited from TypedArray: __len__, __str__, filter, getArray, getBuffer, getByteLength, getByteOffset, getBytesPerElement, getLength, map, reduce, setArray, slice

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, data=None, offset=None, length=None)
(Constructor)

 
The TypedArray object is instantiated with either the array size, an array of TypedArray or Python type, or an existing ArrayBuffer to view, which creates a new TypedArray of size and included data as the specified type. Optional arguments include offset index at which ArrayBuffer data is inserted and length of an ArrayBuffer.
Overrides: object.__init__
(inherited documentation)

__iter__(self)

 
Overrides: TypedArray.__iter__

__getitem__(self, index)
(Indexing operator)

 
Overrides: TypedArray.__getitem__

__setitem__(self, index, value)
(Index assignment operator)

 
Overrides: TypedArray.__setitem__

set(self, data, offset=0)

 
Set data to the array. Arguments: data is a list of either the TypedArray or Python type, offset is the start index where data will be set (defaults to 0).
Overrides: TypedArray.set

subarray(self, begin=0, end=None)

 
Retrieve a subarray of the array. The subarray is a is a view of the derived array. Optional arguments begin and end (default to begin/end of the array) are the index spanning the subarray.
Overrides: TypedArray.subarray