Trees | Indices | Toggle frames |
---|
__init__(self,
ptr,
count,
ctype)
Construct an array at memory location
ptr with count elements
of type ctype . |
|
SDL_array |
as_bytes(self)
Access the array as raw bytes, regardless of the underlying
data type.
|
SDL_array |
as_int16(self)
Access the array as 16-bit integers, regardless of the underlying
data type.
|
SDL_array |
as_int32(self)
Access the array as 32-bit integers, regardless of the underlying
data type.
|
ctypes.Array |
as_ctypes(self)
Access the array as a ctypes array.
|
bool |
have_numpy(cls)
Determine if the numpy array module is available.
|
numpy.ndarray |
as_numpy(self,
shape=None)
Access the array as a numpy array.
|
string |
to_string(self)
Return a string with the contents of this array.
|
from_string(self,
data)
Copy string data into this array.
|
|
__repr__(self) | |
__len__(self) | |
__getitem__(self, key) | |
__setitem__(self, key, value) |
ptr
with count
elements
of type ctype
.
ptr
is None, the array
will be created (filled with random data).Access the array as raw bytes, regardless of the underlying data type.
This can be useful, for example, in accessing a 32-bit colour buffer by individual components rather than the encoded pixel.
Access the array as a numpy array.
The numpy array shares the same underlying memory buffer, so changes are immediate, and you can use the numpy array as you would normally. To set the entire contents of the array at once, use a [:] slice.
If numpy is not installed, an ImportError will be raised.
Copy string data into this array.
The string must have exactly the same length of this array (in bytes). No size checking is performed.
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Wed Oct 26 10:00:13 2011 | http://epydoc.sourceforge.net |