![]() |
Rendering Engine 0.2.9
Modular Graphics Rendering Engine | v0.2.9
|
Builds texture atlases from collections of images. More...
#include <texture_atlas_maker.hpp>
Public Member Functions | |
| TextureAtlasMaker (std::map< char, ImageData > images) | |
| Constructs an atlas maker from a collection of images. More... | |
| ~TextureAtlasMaker ()=default | |
| bool | CreateTextureAtlas (std::map< char, std::pair< unsigned int, unsigned int > > &texAtlasData, ImageData &texAtlasImage) |
| Creates a texture atlas from the stored image collection. More... | |
Static Public Member Functions | |
| static ImageData | CreateTextureAtlas (std::unordered_map< std::uint32_t, std::pair< GlyphMetrics, ImageData > > &ioFontAtlas) |
| Creates a texture atlas from glyph images and updates glyph metrics. More... | |
Protected Member Functions | |
| void | FindCellDimensions (unsigned int &outputWidth, unsigned int &outputHeight) |
| Computes maximum cell dimensions for the stored images. More... | |
| void | CalculateGridDimensions (unsigned int &outputNumberOfColumns, unsigned int &outputNumberOfRows) |
| Calculates grid dimensions for the stored images. More... | |
Static Protected Member Functions | |
| static void | FindCellDimensions (unsigned int &outputWidth, unsigned int &outputHeight, std::unordered_map< std::uint32_t, std::pair< GlyphMetrics, ImageData > > &fontAtlas) |
| Computes maximum cell dimensions for glyph images. More... | |
| static void | CalculateGridDimensions (unsigned int &outputNumberOfColumns, unsigned int &outputNumberOfRows, std::unordered_map< std::uint32_t, std::pair< GlyphMetrics, ImageData > > &fontAtlas) |
| Calculates grid dimensions for glyph images. More... | |
Protected Attributes | |
| std::map< char, ImageData > | mImageCollection |
Static Protected Attributes | |
| static const Color | sDefaultPaletteBackgroundColor |
Builds texture atlases from collections of images.
Arranges input images into a grid-based atlas, aiming for a compact, near-square layout. Supports generic image atlases and font glyph atlases.
Definition at line 28 of file texture_atlas_maker.hpp.
| rendering_engine::TextureAtlasMaker::TextureAtlasMaker | ( | std::map< char, ImageData > | images | ) |
Constructs an atlas maker from a collection of images.
| images | Map of identifiers to image data. |
Definition at line 10 of file texture_atlas_maker.cpp.
|
default |
|
protected |
Calculates grid dimensions for the stored images.
| outputNumberOfColumns | Output number of columns. |
| outputNumberOfRows | Output number of rows. |
Definition at line 144 of file texture_atlas_maker.cpp.
|
staticprotected |
Calculates grid dimensions for glyph images.
| outputNumberOfColumns | Output number of columns. |
| outputNumberOfRows | Output number of rows. |
| fontAtlas | Glyph image collection. |
Definition at line 158 of file texture_atlas_maker.cpp.
| bool rendering_engine::TextureAtlasMaker::CreateTextureAtlas | ( | std::map< char, std::pair< unsigned int, unsigned int > > & | texAtlasData, |
| ImageData & | texAtlasImage | ||
| ) |
Creates a texture atlas from the stored image collection.
| texAtlasData | Output map of image identifiers to atlas positions. |
| texAtlasImage | Output atlas image. |
Definition at line 15 of file texture_atlas_maker.cpp.
|
static |
Creates a texture atlas from glyph images and updates glyph metrics.
Modifies glyph metrics in-place to include atlas coordinates.
| ioFontAtlas | Map of glyph identifiers to glyph metrics and images. |
Definition at line 60 of file texture_atlas_maker.cpp.
|
protected |
Computes maximum cell dimensions for the stored images.
| outputWidth | Output cell width in pixels. |
| outputHeight | Output cell height in pixels. |
Definition at line 104 of file texture_atlas_maker.cpp.
|
staticprotected |
Computes maximum cell dimensions for glyph images.
| outputWidth | Output cell width in pixels. |
| outputHeight | Output cell height in pixels. |
| fontAtlas | Glyph image collection. |
Definition at line 124 of file texture_atlas_maker.cpp.
|
protected |
Definition at line 93 of file texture_atlas_maker.hpp.
|
staticprotected |
Definition at line 95 of file texture_atlas_maker.hpp.