nxt::Raster class

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.