1 #ifndef TERMOX_PAINTER_GLYPH_MATRIX_HPP
2 #define TERMOX_PAINTER_GLYPH_MATRIX_HPP
5 #include <termox/painter/glyph.hpp>
6 #include <termox/widget/area.hpp>
7 #include <termox/widget/point.hpp>
28 [[nodiscard]]
auto width()
const -> int;
31 [[nodiscard]]
auto height()
const -> int;
43 [[nodiscard]]
auto at(Point p) ->
Glyph&;
47 [[nodiscard]]
auto at(Point p)
const ->
Glyph;
50 std::vector<std::vector<Glyph>> matrix_;
Holds a matrix of Glyphs, provides simple access by indices.
Definition: glyph_matrix.hpp:12
auto at(Point p) -> Glyph &
Glyph access operator. {0, 0} is top left. x grows south and y east.
Definition: glyph_matrix.cpp:41
void clear()
Remove all Glyphs from the matrix and set width/height to 0.
Definition: glyph_matrix.cpp:25
Glyph_matrix(Area area)
Construct with a set width and height, or defaults to 0 for each.
Definition: glyph_matrix.cpp:11
auto width() const -> int
Return the width of the matrix.
Definition: glyph_matrix.cpp:27
auto operator()(Point p) -> Glyph &
Glyph access operator. {0, 0} is top left. x grows south and y east.
Definition: glyph_matrix.cpp:34
void resize(Area area)
Resize the width and height of the matrix.
Definition: glyph_matrix.cpp:15
auto height() const -> int
Return the height of the matrix.
Definition: glyph_matrix.cpp:32
Holds a description of a paintable tile on the screen.
Definition: glyph.hpp:11