TermOx
Public Types | Public Member Functions | List of all members
ox::detail::Canvas Class Reference

A 2D field of Glyphs, useful as a screen buffer. More...

#include <canvas.hpp>

Public Types

using Diff = std::vector< std::pair< ox::Point, ox::Glyph > >
 Type used to model differences between two Canvas objects.
 

Public Member Functions

 Canvas (ox::Area a)
 Construct a new Canvas with Area of a.
 
auto area () const -> ox::Area
 Return the current size of the Canvas.
 
auto at (ox::Point p) const -> ox::Glyph
 Return the Glyph at Point p.
 
auto at (ox::Point p) -> ox::Glyph &
 Return the Glyph at Point p.
 
void resize (ox::Area a)
 Resize the Canvas to the given Area a. More...
 
auto begin () -> Buffer_t::iterator
 Return begin iterator to internal buffer.
 
auto begin () const -> Buffer_t::const_iterator
 Return begin iterator to internal buffer.
 
auto end () -> Buffer_t::iterator
 Return end iterator to internal buffer.
 
auto end () const -> Buffer_t::const_iterator
 Return end iterator to internal buffer.
 
void reset ()
 Sets all Glyphs to default construction.
 

Detailed Description

A 2D field of Glyphs, useful as a screen buffer.

Used by Painter to write output to, which is eventually written to the actual terminal screen.

Member Function Documentation

◆ resize()

void ox::detail::Canvas::resize ( ox::Area  a)

Resize the Canvas to the given Area a.

Will throw out any Glyphs from the current Canvas that no longer fit.


The documentation for this class was generated from the following files: