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

Generates texture atlases by efficient packing of multiple input rectangles/images. More...

#include <qgstextureatlasgenerator.h>

Static Public Member Functions

static QgsTextureAtlas createFromImages (const QVector< QImage > &images, int maxSide=1000)
 Creates a texture atlas for a set of images.
static QgsTextureAtlas createFromRects (const QVector< QRect > &rectangles, int maxSide=1000)
 Creates a texture atlas for a set of rectangles.

Detailed Description

Generates texture atlases by efficient packing of multiple input rectangles/images.

QgsTextureAtlasGenerator can be used to pack either images or raw rectangles. The static createFromRects() or createFromImages() methods should be called with the source images or rectangles, which will return a QgsTextureAtlas containing the results.

Since
QGIS 4.0

Definition at line 138 of file qgstextureatlasgenerator.h.

Member Function Documentation

◆ createFromImages()

QgsTextureAtlas QgsTextureAtlasGenerator::createFromImages ( const QVector< QImage > & images,
int maxSide = 1000 )
static

Creates a texture atlas for a set of images.

The maxSide argument specifies the maximum permitted side size for the atlas. The calculated solution can only be less than or equal to this size - if it cannot fit, then algorithm will gracefully fail and return an invalid QgsTextureAtlas.

See also
createFromRects()

Definition at line 138 of file qgstextureatlasgenerator.cpp.

◆ createFromRects()

QgsTextureAtlas QgsTextureAtlasGenerator::createFromRects ( const QVector< QRect > & rectangles,
int maxSide = 1000 )
static

Creates a texture atlas for a set of rectangles.

This method should be used when the generator is used to pack rectangle shapes only. No image will be associated with the rectangle.

The maxSide argument specifies the maximum permitted side size for the atlas. The calculated solution can only be less than or equal to this size - if it cannot fit, then algorithm will gracefully fail and return an invalid QgsTextureAtlas.

See also
createFromImages()

Definition at line 126 of file qgstextureatlasgenerator.cpp.


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