| Method Summary |
| |
__init__(self,
dimensions)
|
| |
__del__(self)
|
| |
put_new_framebuffer(self,
buffer,
mipmap_level,
border,
framebuffer_lowerleft,
size,
internal_format,
cube_side)
Replace texture object with the framebuffer contents. |
| |
put_new_image(self,
texel_data,
mipmap_level,
border,
check_opengl_errors,
internal_format,
data_format,
data_type,
cube_side,
image_data)
Put Numeric array or PIL Image into OpenGL as texture data. |
| |
put_sub_image(self,
texel_data,
mipmap_level,
offset_tuple,
data_format,
data_type,
cube_side,
image_data)
Replace all or part of a texture object. |
| |
set_border_color(self,
border_color)
Set to a sequence of 4 floats in the range 0.0 to 1.0... |
| |
set_mag_filter(self,
filter)
|
| |
set_min_filter(self,
filter)
|
| |
set_wrap_mode_r(self,
wrap_mode)
Set to GL_CLAMP, GL_CLAMP_TO_EDGE, GL_REPEAT, or GL_CLAMP_TO_BORDER... |
| |
set_wrap_mode_s(self,
wrap_mode)
Set to GL_CLAMP, GL_CLAMP_TO_EDGE, GL_REPEAT, or GL_CLAMP_TO_BORDER... |
| |
set_wrap_mode_t(self,
wrap_mode)
Set to GL_CLAMP, GL_CLAMP_TO_EDGE, GL_REPEAT, or GL_CLAMP_TO_BORDER... |
| Inherited from object |
| |
__delattr__(...)
x.__delattr__('name') <==> del x.name... |
| |
__getattribute__(...)
x.__getattribute__('name') <==> x.name... |
| |
__hash__(x)
x.__hash__() <==> hash(x)... |
| |
__reduce__(...)
helper for pickle... |
| |
__reduce_ex__(...)
helper for pickle... |
| |
__repr__(x)
x.__repr__() <==> repr(x)... |
| |
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value... |
| |
__str__(x)
x.__str__() <==> str(x)... |
| Inherited from type |
| |
__new__(T,
S,
...)
T.__new__(S, ...) -> a new object with type S, a subtype of T... |
| Class Variable Summary |
member_descriptor |
__gl_module__ = <member '__gl_module__' of 'TextureObjec...
|
tuple |
__slots__ = ('min_filter', 'mag_filter', 'wrap_mode_r', ...
|
member_descriptor |
border_color = <member 'border_color' of 'TextureObject'...
|
member_descriptor |
cube_mipmap_arrays = <member 'cube_mipmap_arrays' of 'Te...
|
member_descriptor |
dimensions = <member 'dimensions' of 'TextureObject' obj...
|
member_descriptor |
gl_id = <member 'gl_id' of 'TextureObject' objects>
|
member_descriptor |
mag_filter = <member 'mag_filter' of 'TextureObject' obj...
|
member_descriptor |
min_filter = <member 'min_filter' of 'TextureObject' obj...
|
member_descriptor |
mipmap_arrays = <member 'mipmap_arrays' of 'TextureObjec...
|
member_descriptor |
target = <member 'target' of 'TextureObject' objects>
|
member_descriptor |
wrap_mode_r = <member 'wrap_mode_r' of 'TextureObject' o...
|
member_descriptor |
wrap_mode_s = <member 'wrap_mode_s' of 'TextureObject' o...
|
member_descriptor |
wrap_mode_t = <member 'wrap_mode_t' of 'TextureObject' o...
|
put_new_image(self,
texel_data,
mipmap_level=0,
border=0,
check_opengl_errors=True,
internal_format=6407,
data_format=None,
data_type=None,
cube_side=None,
image_data=None)
Put Numeric array or PIL Image into OpenGL as texture data.
The texel_data parameter contains the texture data. If it is
a Numeric array, it must be 1D, 2D, or 3D data in grayscale or
color (RGB or RGBA). Remember that OpenGL begins its textures
from the lower left corner, so texel_data[0,:] = 1.0 would set
the bottom line of the texture to white, while texel_data[:,0]
= 1.0 would set the left line of the texture to white.
The mipmap_level parameter specifies which of the texture
object's mipmap arrays you are filling.
The border parameter specifies the width of the border.
The check_opengl_errors parameter turns on (more
comprehensible) error messages when something goes wrong. It
also slows down performance a little bit.
The internal_format parameter specifies the format in which
the image data is stored on the video card. See the OpenGL
specification for all possible values.
If the data_format parameter is None (the default), an attempt
is made to guess data_format according to the following
description. For Numeric arrays: If texel_data.shape is equal
to the dimensions of the texture object, texel_data is assumed
to contain luminance (grayscale) information and data_format
is set to GL_LUMINANCE. If texel_data.shape is equal to one
plus the dimensions of the texture object, texel_data is
assumed to contain color information. If texel_data.shape[-1]
is 3, this is assumed to be RGB data and data_format is set to
GL_RGB. If, texel_data.shape[-1] is 4, this is assumed to be
RGBA data and data_format is set to GL_RGBA. For PIL images:
the "mode" attribute is queried.
If the data_type parameter is None (the default), it is set to
GL_UNSIGNED_BYTE. For Numeric arrays: texel_data is (re)cast
as UnsignedInt8 and, if it is a floating point type, values
are assumed to be in the range 0.0-1.0 and are scaled to the
range 0-255. If the data_type parameter is not None, the
texel_data is not rescaled or recast. Currently only
GL_UNSIGNED_BYTE is supported. For PIL images: texel_data is
used as unsigned bytes. This is the usual format for common
computer graphics files.
-
|