Raster class
#include <nxt/raster.hpp>
Owning raster storage. Allocates and manages the underlying arrays. Use view() to get a RasterView for rendering operations.
Constructors, destructors, conversion operators
-
Raster(std::
size_t width, std:: size_t height, GlyphTable& glyphs) -
Raster(width_
t width, height_ t height, GlyphTable& glyphs) - Raster(Size size, GlyphTable& glyphs)
- operator RasterView() noexcept
- Implicit conversion to view (convenience)
Public functions
-
auto bgs() const → std::
span<const Rgba8> noexcept -
auto bgs_2d() const → const_
color_ view_ t noexcept - void clear()
- Clear to spaces with default colors.
-
auto ems() const → std::
span<const Emphasis> noexcept -
auto ems_2d() const → const_
emphasis_ view_ t noexcept - auto extent() const → Size noexcept
-
auto fgs() const → std::
span<const Rgba8> noexcept -
auto fgs_2d() const → const_
color_ view_ t noexcept -
auto glyph_span(height_
t y, width_ t x, std:: size_t len) const → std:: span<const GlyphTable:: GlyphId> noexcept - Get a span of glyphs for a region on a row.
- auto glyph_table() const → GlyphTable& noexcept
- Access glyph table.
-
auto glyphs() const → std::
span<const GlyphTable:: GlyphId> noexcept - Direct access to storage (for diffing)
-
auto glyphs_2d() const → const_
glyph_ view_ t noexcept - 2D views (const, for diffing)
-
auto height() const → height_
t noexcept - auto indexed_rows() const → auto
- Iterate rows with their y coordinate: (height_
t, row_range) -
auto row(height_
t y) const → auto - Get a row as indexed cells for iteration.
- auto rows() const → auto
- Iterate rows (just the row ranges)
- auto view() → RasterView noexcept
- Get a view of the entire raster.
-
auto width() const → width_
t noexcept - Dimensions.
Function documentation
nxt:: Raster:: Raster(std:: size_t width,
std:: size_t height,
GlyphTable& glyphs)
Initialize with given dimensions. All cells default to space (ASCII 32) with DEFAULT_COLOR.