OpenGL.arrays.strings
index
/var/pylive/OpenGL-ctypes/OpenGL/arrays/strings.py

String-array-handling code for PyOpenGL

 
Modules
       
OpenGL.constants
ctypes
OpenGL.arrays.formathandler

 
Classes
       
FormatHandler(object)
StringHandler

 
class StringHandler(FormatHandler)
    String-specific data-type handler for OpenGL
 
 
Method resolution order:
StringHandler
FormatHandler
object

Methods defined here:
arrayByteCount(self, value, typeCode=None)
Given a data-value, calculate number of bytes required to represent
arraySize(self, value, typeCode=None)
Given a data-value, calculate ravelled size for the array
arrayToGLType(self, value)
Given a value, guess OpenGL type of the corresponding pointer
asArray(self, value, typecode=None)
Convert given value to an array value of given typecode
dimensions(self, value, typeCode=None)
Determine dimensions of the passed array value (if possible)
ones(self, dims, typeCode=None)
Currently don't allow strings as output types!
zeros(self, dims, typeCode=None)
Currently don't allow strings as output types!

Static methods defined here:
dataPointer(data)
Return the data-pointer from the array using calculated offset
 
data -- a Python string
 
Returns the raw data-pointer to the internal buffer of the passed string
from_param = dataPointer(data)
Return the data-pointer from the array using calculated offset
 
data -- a Python string
 
Returns the raw data-pointer to the internal buffer of the passed string

Data and other attributes defined here:
HANDLED_TYPES = (<type 'str'>,)

Methods inherited from FormatHandler:
register(self, types=None)
Register this class as handler for given set of types
registerEquivalent(self, typ, base)
Register a sub-class for handling as the base-type
registerReturn(self)
Register this handler as the default return-type handler
unitSize(self, value, typeCode=None)
Determine unit size of an array (if possible)

Class methods inherited from FormatHandler:
chooseOutput(cls, preferred=None) from type
Choose our output-capable plugin
loadAll(cls) from type
Load all setuptools-registered FormatHandler classes
 
register a new datatype with code similar to this in your
package's setup.py for setuptools:
 
entry_points = {
        'OpenGL.arrays.formathandler':[
                'numpy = OpenGL.arrays.numpymodule.NumpyHandler',
        ],
}

Data and other attributes inherited from FormatHandler:
ALL_OUTPUT_HANDLERS = []
GENERIC_OUTPUT_PREFERENCES = ['numpy', 'numeric', 'ctypesarrays']
HANDLER_REGISTRY = {}
TYPE_REGISTRY = {}
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'FormatHandler' objects>
list of weak references to the object (if defined)
baseType = None
preferredOutput = None
typeConstant = None

 
Data
        BYTE_SIZES = {GL_BYTE: 1, GL_UNSIGNED_BYTE: 1, GL_SHORT: 2, GL_UNSIGNED_SHORT: 2, GL_INT: 4, GL_UNSIGNED_INT: 4, GL_FLOAT: 4, GL_DOUBLE: 8}