OpenGL.arrays.numpymodule
Numpy (new version) module implementation of the OpenGL-ctypes array interfaces
XXX Need to register handlers for all of the scalar types that numpy returns,
would like to have all return values be int/float if they are of compatible
type as well.
Functions
Classes
class NumpyHandler(
FormatHandler
):
Numpy-specific data-type handler for OpenGL
Attributes:
- ERROR_ON_COPY
- if True, will raise errors if we have to copy an array object in order to produce a contiguous array of the correct type.
arrayByteCount(
cls
,
value
,
typeCode
= None
)
Given a data-value, calculate number of bytes required to represent
contiguous(
cls
,
source
,
typeCode
= None
)
Get contiguous array from source
- source
- numpy Python array (or compatible object) for use as the data source. If this is not a contiguous array of the given typeCode, a copy will be made, otherwise will just be returned unchanged.
- typeCode
- optional 1-character typeCode specifier for the numpy.array function.
All gl*Pointer calls should use contiguous arrays, as non-
contiguous arrays will be re-copied on every rendering pass.
Although this doesn't raise an error, it does tend to slow
down rendering.