25 UInt32 children[2]{std::numeric_limits<UInt32>::max(), std::numeric_limits<UInt32>::max()};
28 constexpr Node() =
default;
Organizes a set of textures into a single larger texture (an atlas) by minimizing empty space.
Definition TextureAtlasLayout.hpp:18
bool mPow2
Definition TextureAtlasLayout.hpp:36
bool addToNode(UInt32 nodeIdx, UInt32 width, UInt32 height, UInt32 &x, UInt32 &y, bool allowGrowth)
Attempts to add a new element to the specified layout node.
UInt32 mInitialHeight
Definition TextureAtlasLayout.hpp:33
UInt32 mHeight
Definition TextureAtlasLayout.hpp:35
bool isEmpty() const
Checks have any elements been added to the layout.
Definition TextureAtlasLayout.hpp:81
UInt32 getWidth() const
Returns the width of the atlas texture, in pixels.
Definition TextureAtlasLayout.hpp:84
UInt32 mInitialWidth
Definition TextureAtlasLayout.hpp:32
UInt32 getHeight() const
Returns the height of the atlas texture, in pixels.
Definition TextureAtlasLayout.hpp:87
TextureAtlasLayout(const UInt32 width, const UInt32 height)
Constructs a new texture atlas layout with the provided parameters.
Definition TextureAtlasLayout.hpp:46
UInt32 mWidth
Definition TextureAtlasLayout.hpp:34
TextureAtlasLayout()=default
bool addElement(UInt32 width, UInt32 height, UInt32 &x, UInt32 &y)
Attempts to add a new element in the layout.
void clear()
Removes all entries from the layout.
TextureAtlasLayout(const UInt32 width, const UInt32 height, const UInt32 maxWidth, const UInt32 maxHeight, const bool pow2=false)
Constructs a new texture atlas layout with the provided parameters.
Definition TextureAtlasLayout.hpp:59
Vector< Node > mNodes
Definition TextureAtlasLayout.hpp:38
Utility class used for texture atlas layouts.
Definition TextureAtlasLayout.hpp:106
static Vector< Page > createAtlasLayout(Vector< Element > &elements, UInt32 width, UInt32 height, UInt32 maxWidth, UInt32 maxHeight, bool pow2=false)
Creates an optimal texture layout by packing texture elements in order to end up with as little empty...
Definition Application.hpp:19
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
std::int32_t Int32
Definition DataTypes.hpp:21
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Represent a single node in the texture atlas binary tree.
Definition TextureAtlasLayout.hpp:20
UInt32 height
Definition TextureAtlasLayout.hpp:24
constexpr Node(const UInt32 x, const UInt32 y, const UInt32 width, const UInt32 height)
Definition TextureAtlasLayout.hpp:29
UInt32 width
Definition TextureAtlasLayout.hpp:23
UInt32 y
Definition TextureAtlasLayout.hpp:22
UInt32 x
Definition TextureAtlasLayout.hpp:21
bool nodeFull
Definition TextureAtlasLayout.hpp:26
UInt32 children[2]
Definition TextureAtlasLayout.hpp:25
Represents a single element used as in input to TextureAtlasUtility.
Definition TextureAtlasLayout.hpp:112
UInt32 width
Definition TextureAtlasLayout.hpp:114
Int32 page
Definition TextureAtlasLayout.hpp:120
UInt32 height
Definition TextureAtlasLayout.hpp:114
UInt32 y
Definition TextureAtlasLayout.hpp:118
UInt32 idx
Definition TextureAtlasLayout.hpp:119
struct CeresEngine::TextureAtlasUtility::Element::@60 input
struct CeresEngine::TextureAtlasUtility::Element::@61 output
UInt32 x
Definition TextureAtlasLayout.hpp:118
Describes a single page of the texture atlas.
Definition TextureAtlasLayout.hpp:125
UInt32 width
Definition TextureAtlasLayout.hpp:126
UInt32 height
Definition TextureAtlasLayout.hpp:126