OpenGL.arrays.formathandler
index
/build/buildd/pyopengl-3.0.0~b6/OpenGL/arrays/formathandler.py

Base class for the various Python data-format storage type APIs
 
Data-type handlers are specified using OpenGL.plugins module

 
Modules
       
ctypes
OpenGL.plugins

 
Classes
       
object
FormatHandler

 
class FormatHandler(object)
    Abstract class describing the handler interface
 
Each data-type handler is responsible for providing a number of methods
which allow it to manipulate (and create) instances of the data-type 
it represents.
 
  Methods defined here:
arraySize(self, value, typeCode=None)
Given a data-value, calculate dimensions for the array
arrayToGLType(self, value)
Given a value, guess OpenGL type of the corresponding pointer
asArray(self, value, typeCode=None)
Given a value, convert to array representation
dataPointer(self, value)
return long for pointer value
dimensions(self, value, typeCode=None)
Determine dimensions of the passed array value (if possible)
from_param(self, value)
Convert to a ctypes pointer value
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 defined here:
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',
        ],
}
loadPlugin(cls, entrypoint) from type
Load a single entry-point via plugins module
typeLookup(cls, type) from type
Lookup handler by data-type

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
ALL_OUTPUT_HANDLERS = [<OpenGL.arrays.nones.NoneHandler object at 0x8ee5e8c>, <OpenGL.arrays.strings.StringHandler object at 0x8ee5eac>, <OpenGL.arrays.lists.ListHandler object at 0x8ee5ecc>, <OpenGL.arrays.numbers.NumberHandler object at 0x8ee5eec>, <OpenGL.arrays.ctypesarrays.CtypesArrayHandler object at 0x8ee5f0c>, <OpenGL.arrays.ctypesparameters.CtypesParameterHandler object at 0x8ee5f2c>, <OpenGL.arrays.ctypespointers.CtypesPointerHandler object at 0x8ee5f4c>, <OpenGL.arrays.nones.NoneHandler object at 0x8ee5f6c>, <OpenGL.arrays.strings.StringHandler object at 0x8ee5f8c>, <OpenGL.arrays.lists.ListHandler object at 0x8ee5fcc>, <OpenGL.arrays.numbers.NumberHandler object at 0x85271cc>, <OpenGL.arrays.ctypesarrays.CtypesArrayHandler object at 0x852714c>, <OpenGL.arrays.ctypesparameters.CtypesParameterHandler object at 0x852702c>, <OpenGL.arrays.ctypespointers.CtypesPointerHandler object at 0x852704c>]
GENERIC_OUTPUT_PREFERENCES = ['numpy', 'numeric', 'ctypesarrays']
HANDLED_TYPES = ()
HANDLER_REGISTRY = {'ctypesarray': <OpenGL.arrays.ctypesarrays.CtypesArrayHandler object at 0x852714c>, 'ctypesparameter': <OpenGL.arrays.ctypesparameters.CtypesParameterHandler object at 0x852702c>, 'ctypespointer': <OpenGL.arrays.ctypespointers.CtypesPointerHandler object at 0x852704c>, 'list': <OpenGL.arrays.lists.ListHandler object at 0x8ee5fcc>, 'none': <OpenGL.arrays.nones.NoneHandler object at 0x8ee5f6c>, 'numbers': <OpenGL.arrays.numbers.NumberHandler object at 0x85271cc>, 'str': <OpenGL.arrays.strings.StringHandler object at 0x8ee5f8c>}
LAZY_TYPE_REGISTRY = {}
TYPE_REGISTRY = {<type 'float'>: <OpenGL.arrays.numbers.NumberHandler object at 0x85271cc>, <type 'int'>: <OpenGL.arrays.numbers.NumberHandler object at 0x85271cc>, <type 'list'>: <OpenGL.arrays.lists.ListHandler object at 0x8ee5fcc>, <type 'long'>: <OpenGL.arrays.numbers.NumberHandler object at 0x85271cc>, <type 'NoneType'>: <OpenGL.arrays.nones.NoneHandler object at 0x8ee5f6c>, <type 'str'>: <OpenGL.arrays.strings.StringHandler object at 0x8ee5f8c>, <type 'tuple'>: <OpenGL.arrays.lists.ListHandler object at 0x8ee5fcc>, <class 'ctypes.c_long'>: <OpenGL.arrays.numbers.NumberHandler object at 0x85271cc>, <class 'ctypes.c_ulong'>: <OpenGL.arrays.numbers.NumberHandler object at 0x85271cc>, <class 'ctypes.c_float'>: <OpenGL.arrays.numbers.NumberHandler object at 0x85271cc>, ...}
baseType = None
preferredOutput = None
typeConstant = None

 
Data
        __file__ = '/build/buildd/pyopengl-3.0.0~b6/OpenGL/arrays/formathandler.py'
__name__ = 'OpenGL.arrays.formathandler'