# Path: glitter/utils/dtypes.py
# class Datatype(object):
#     def __init__(self, integer, signed, nptype, _gltype=None, charcode=None):
#     def from_numpy(cls, nptype):
#     def _from_gl(cls, _gltype):
#     def as_numpy(self):
#     def _as_gl(self):
#     def as_signed(self):
#     def as_unsigned(self):
#     def as_nbytes(self, nbytes):
#     def is_signed(self):
#     def is_unsigned(self):
#     def is_integer(self):
#     def is_float(self):
#     def is_boolean(self):
#     def charcode(self):
#     def nbytes(self):
#     def __str__(self):
#     def __repr__(self):
#     def coerced(self, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# def coerce_array(data, dtype=None, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):


import numpy as _np
import glitter.raw as _gl
from glitter.utils.dtypes import Datatype, bool8, int32, uint32, float32, float64
"""Datatypes for use with L{ShaderProgram}s.

@author: Stephan Wenger
@date: 2012-02-29
"""



class ShaderDatatype(object):
    _gltype_db = {}
    _db = {}

    def __init__(self, name, _gltype, dtype=int32, shape=1, texture=False, atomic=True):
        self._name = name
        self._gltype = _gltype
        self._dtype = dtype
        self._shape = (shape,) if not hasattr(shape, "__iter__") and not isinstance(shape, str) else tuple(shape)
        self._texture = texture
        self._atomic = atomic

        Datatype._gltype_db[self._gltype] = self

# Path: glitter/utils/dtypes.py
# class Datatype(object):
#     def __init__(self, integer, signed, nptype, _gltype=None, charcode=None):
#     def from_numpy(cls, nptype):
#     def _from_gl(cls, _gltype):
#     def as_numpy(self):
#     def _as_gl(self):
#     def as_signed(self):
#     def as_unsigned(self):
#     def as_nbytes(self, nbytes):
#     def is_signed(self):
#     def is_unsigned(self):
#     def is_integer(self):
#     def is_float(self):
#     def is_boolean(self):
#     def charcode(self):
#     def nbytes(self):
#     def __str__(self):
#     def __repr__(self):
#     def coerced(self, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):
# def coerce_array(data, dtype=None, force_integer=False, force_unsigned=False, force_float=False, force_gl=True):


# Path: glitter/utils/shaderdtypes.py
import numpy as _np
import glitter.raw as _gl
from glitter.utils.dtypes import Datatype, bool8, int32, uint32, float32, float64

"""Datatypes for use with L{ShaderProgram}s.

@author: Stephan Wenger
@date: 2012-02-29
"""



class ShaderDatatype(object):
    _gltype_db = {}
    _db = {}

    def __init__(self, name, _gltype, dtype=int32, shape=1, texture=False, atomic=True):
        self._name = name
        self._gltype = _gltype
        self._dtype = dtype
        self._shape = (shape,) if not hasattr(shape, "__iter__") and not isinstance(shape, str) else tuple(shape)
        self._texture = texture
        self._atomic = atomic

        Datatype._gltype_db[self._gltype] = self

        Datatype._db[self._dtype, self._shape, self._texture, self._atomic] = self