OpenGL.arrays.lists
Lists/tuples as data-format for storage
Note:
This implementation is *far* less efficient than using Numpy
to support lists/tuples, as the code here is all available in
C-level code there. This implementation is required to allow
for usage without numpy installed.
Functions
Classes
class ListHandler(
FormatHandler
):
Storage of array data in Python lists/arrays
This mechanism, unlike multi-dimensional arrays, is not necessarily
uniform in type or dimension, so we have to do a lot of extra checks
to make sure that we get a correctly-structured array. That, as
well as the need to copy the arrays in Python code, makes this a far
less efficient implementation than the numpy implementation, which
does all the same things, but does them all in C code.
Note: as an *output* format, this format handler produces ctypes
arrays, not Python lists, this is done for convenience in coding
the implementation, mostly.
arrayByteCount(
cls
,
value
,
typeCode
= None
)
Given a data-value, calculate number of bytes required to represent
asArray(
cls
,
value
,
typeCode
= None
)
Convert given value to a ctypes array value of given typeCode
This does a *lot* of work just to get the data into the correct
format. It's not going to be anywhere near as fast as a numpy
or similar approach!
dataPointer(
)
addressof(C instance) -> integer
Return the address of the C instance internal buffer
dimensions(
cls
,
value
,
typeCode
= None
)
Determine dimensions of the passed array value (if possible)