8#ifndef GALAXY_MATH_RECTPACK_HPP_
9#define GALAXY_MATH_RECTPACK_HPP_
42 void init(
const int width,
const int height)
noexcept;
54 std::optional<iRect>
pack(
const int width,
const int height);
59 void clear()
noexcept;
Rectangle 2D bin packing class.
int m_width
The starting width of the rectangle.
const std::vector< iRect > & get_free_space() const noexcept
Get free rectangles.
std::optional< iRect > pack(const int width, const int height)
Pack a rectangle into the master rectangle.
RectPack() noexcept
Constructor.
int m_height
The starting width of the rectangle.
void clear() noexcept
Clear all data.
int get_height() const noexcept
Get total height.
void init(const int width, const int height) noexcept
Set starting width and height of rectangle.
int get_width() const noexcept
Get total width.
~RectPack() noexcept
Destructor.
std::vector< iRect > m_free_rects
Free space in master rectangle.