GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::resource::ArrayAtlasPacker Class Reference

Axis-aligned rectangle packer for expandable square texture atlases with array layers. More...

#include <GREM/resource/ArrayAtlasPacker.hpp>

Classes

struct  InsertBoxResult
 Result of the insertBox() function. More...

Public Member Functions

 ArrayAtlasPacker () noexcept
 Construct an atlas packer with the default options.
 ArrayAtlasPacker (const ArrayAtlasPackerOptions &options)
 Construct an atlas packer.
InsertBoxResult insertBox (Extent3D size)
 Find and reserve a suitable space for a new axis-aligned box to be inserted into the atlas.
uint32_t getResolution () const noexcept
 Get the current required resolution of the atlas.
uint32_t getDepth () const noexcept
 Get the current required depth of the atlas.

Detailed Description

Axis-aligned rectangle packer for expandable square texture atlases with array layers.

Constructor & Destructor Documentation

◆ ArrayAtlasPacker() [1/2]

grem::resource::ArrayAtlasPacker::ArrayAtlasPacker ( )
inlinenoexcept

Construct an atlas packer with the default options.

◆ ArrayAtlasPacker() [2/2]

grem::resource::ArrayAtlasPacker::ArrayAtlasPacker ( const ArrayAtlasPackerOptions & options)
inlineexplicit

Construct an atlas packer.

Parameters
optionsatlas packer options, see ArrayAtlasPackerOptions.

Member Function Documentation

◆ insertBox()

InsertBoxResult grem::resource::ArrayAtlasPacker::insertBox ( Extent3D size)
inlinenodiscard

Find and reserve a suitable space for a new axis-aligned box to be inserted into the atlas.

Parameters
sizesize of the new box, in pixels and layers.
Returns
see InsertBoxResult.
Exceptions
std::length_errorif an internal size limit was exceeded.
std::bad_array_new_lengthif an internal size limit was exceeded.
std::bad_allocon allocation failure.

◆ getResolution()

uint32_t grem::resource::ArrayAtlasPacker::getResolution ( ) const
inlinenodiscardnoexcept

Get the current required resolution of the atlas.

Returns
the width of the square atlas region, in pixels.

◆ getDepth()

uint32_t grem::resource::ArrayAtlasPacker::getDepth ( ) const
inlinenodiscardnoexcept

Get the current required depth of the atlas.

Returns
the number of array layers in the atlas.

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