QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsTextureAtlas Class Reference

Encapsulates a texture atlas. More...

#include <qgstextureatlasgenerator.h>

Public Member Functions

 QgsTextureAtlas ()
 QgsTextureAtlas (const QgsTextureAtlas &other)
 ~QgsTextureAtlas ()
QSize atlasSize () const
 Returns the total size required for the atlas, i.e.
int count () const
 Returns the number of textures in the atlas.
bool isValid () const
 Returns true if the atlas is valid.
QgsTextureAtlasoperator= (const QgsTextureAtlas &other)
QRect rect (int index) const
 Returns the packed rectangle for the texture with the specified index.
QImage renderAtlasTexture () const
 Renders the combined texture atlas, containing all source images.
QImage renderDebugTexture () const
 Renders a debug texture.

Friends

class QgsTextureAtlasGenerator

Detailed Description

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.

Since
QGIS 4.0

Definition at line 42 of file qgstextureatlasgenerator.h.

Constructor & Destructor Documentation

◆ QgsTextureAtlas() [1/2]

QgsTextureAtlas::QgsTextureAtlas ( )
default

◆ ~QgsTextureAtlas()

QgsTextureAtlas::~QgsTextureAtlas ( )
default

◆ QgsTextureAtlas() [2/2]

QgsTextureAtlas::QgsTextureAtlas ( const QgsTextureAtlas & other)
default

Member Function Documentation

◆ atlasSize()

QSize QgsTextureAtlas::atlasSize ( ) const
inline

Returns the total size required for the atlas, i.e.

the total size for the packed images and rectangles.

Definition at line 60 of file qgstextureatlasgenerator.h.

◆ count()

int QgsTextureAtlas::count ( ) const

Returns the number of textures in the atlas.

Definition at line 65 of file qgstextureatlasgenerator.cpp.

◆ isValid()

bool QgsTextureAtlas::isValid ( ) const
inline

Returns true if the atlas is valid.

Definition at line 54 of file qgstextureatlasgenerator.h.

◆ operator=()

QgsTextureAtlas & QgsTextureAtlas::operator= ( const QgsTextureAtlas & other)
default

◆ rect()

QRect QgsTextureAtlas::rect ( int index) const

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

Definition at line 70 of file qgstextureatlasgenerator.cpp.

◆ renderAtlasTexture()

QImage QgsTextureAtlas::renderAtlasTexture ( ) const

Renders the combined texture atlas, containing all source images.

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

Definition at line 75 of file qgstextureatlasgenerator.cpp.

◆ renderDebugTexture()

QImage QgsTextureAtlas::renderDebugTexture ( ) const

Renders a debug texture.

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

Definition at line 96 of file qgstextureatlasgenerator.cpp.

◆ QgsTextureAtlasGenerator

friend class QgsTextureAtlasGenerator
friend

Definition at line 125 of file qgstextureatlasgenerator.h.


The documentation for this class was generated from the following files: