Class: QgsTextureAtlas

Encapsulates a texture atlas.

QgsTextureAtlas contains the packed regions for aggregated texture atlases, and optionally the packed texture map.

See QgsTextureAtlasGenerator for a class which automatically creates texture atlases.

Added in version 4.0.

Methods

atlasSize

Returns the total size required for the atlas, i.e. the total size for the packed images and rectangles.

count

Returns the number of textures in the atlas.

isValid

Returns True if the atlas is valid.

rect

Returns the packed rectangle for the texture with the specified index.

renderAtlasTexture

Renders the combined texture atlas, containing all source images.

renderDebugTexture

Renders a debug texture.

class qgis._3d.QgsTextureAtlas[source]

Bases: object

atlasSize(self) QSize[source]

Returns the total size required for the atlas, i.e. the total size for the packed images and rectangles.

Return type:

QSize

count(self) int[source]

Returns the number of textures in the atlas.

Return type:

int

isValid(self) bool[source]

Returns True if the atlas is valid.

Return type:

bool

rect(self, index: int) QRect[source]

Returns the packed rectangle for the texture with the specified index.

Raises:

IndexError – if no texture with the specified index exists.

Parameters:

index (int)

Return type:

QRect

renderAtlasTexture(self) QImage[source]

Renders the combined texture atlas, containing all source images.

Note

This may be a null image if the atlas was created with rectangles alone.

Return type:

QImage

renderDebugTexture(self) QImage[source]

Renders a debug texture.

The debug texture renders all packed rectangles with a unique color, and can be used to visualize the solution.

Return type:

QImage