TextureData class

TextureData class

This class contains the raw data and format definition of a texture.

Inheritance: TextureDataA3DObject

The TextureData type exposes the following members:

Constructors

ConstructorDescription
__init__(self, width, height, stride, bytes_per_pixel, pixel_format, data)Constructor of TextureData
__init__(self, width, height, pixel_format)Constructs a new TextureData and allocate pixel data.
__init__(self)Constructor of TextureData

Properties

PropertyDescription
nameGets or sets the name.
propertiesGets the collection of all properties.
dataRaw bytes of pixel data
widthNumber of horizontal pixels
heightNumber of vertical pixels
strideNumber of bytes of a scanline.
bytes_per_pixelNumber of bytes of a pixel
pixel_formatThe pixel’s format

Methods

MethodDescription
remove_property(self, property)Removes a dynamic property.
remove_property(self, property)Remove the specified property identified by name
save(self, stream, format)Save texture data into specified image format
save(self, file_name)Save texture data into image file
save(self, file_name, format)Save texture data into image file
map_pixels(self, map_mode)Map all pixels for read/write
map_pixels(self, map_mode, format)Map all pixels for read/write in given pixel format
map_pixels(self, rect, map_mode, format)Map pixels addressed by rect for reading/writing in given pixel format
get_property(self, property)Get the value of specified property
set_property(self, property, value)Sets the value of specified property
find_property(self, property_name)Finds the property.
It can be a dynamic property (Created by CreateDynamicProperty/SetProperty)
or native property(Identified by its name)
from_stream(, stream)Load a texture from stream
from_file(, file_name)Load a texture from file
transform_pixel_format(self, pixel_format)Transform pixel’s layout to new pixel format.

See Also