TermOx
Public Member Functions | List of all members
ox::Glyph_matrix Class Reference

Holds a matrix of Glyphs, provides simple access by indices. More...

#include <glyph_matrix.hpp>

Public Member Functions

 Glyph_matrix (Area area)
 Construct with a set width and height, or defaults to 0 for each. More...
 
void resize (Area area)
 Resize the width and height of the matrix. More...
 
void clear ()
 Remove all Glyphs from the matrix and set width/height to 0.
 
auto width () const -> int
 Return the width of the matrix.
 
auto height () const -> int
 Return the height of the matrix.
 
auto operator() (Point p) -> Glyph &
 Glyph access operator. {0, 0} is top left. x grows south and y east. More...
 
auto operator() (Point p) const -> Glyph
 Glyph access operator. {0, 0} is top left. x grows south and y east. More...
 
auto at (Point p) -> Glyph &
 Glyph access operator. {0, 0} is top left. x grows south and y east. More...
 
auto at (Point p) const -> Glyph
 Glyph access operator. {0, 0} is top left. x grows south and y east. More...
 

Detailed Description

Holds a matrix of Glyphs, provides simple access by indices.

Constructor & Destructor Documentation

◆ Glyph_matrix()

ox::Glyph_matrix::Glyph_matrix ( Area  area)
explicit

Construct with a set width and height, or defaults to 0 for each.

Glyphs default constructed(space char with no colors or traits).

Member Function Documentation

◆ at() [1/2]

auto ox::Glyph_matrix::at ( Point  p) -> Glyph&

Glyph access operator. {0, 0} is top left. x grows south and y east.

Has bounds checking and throws std::out_of_range if not within range.

◆ at() [2/2]

auto ox::Glyph_matrix::at ( Point  p) const -> Glyph

Glyph access operator. {0, 0} is top left. x grows south and y east.

Has bounds checking and throws std::out_of_range if not within range.

◆ operator()() [1/2]

auto ox::Glyph_matrix::operator() ( Point  p) -> Glyph&

Glyph access operator. {0, 0} is top left. x grows south and y east.

Provides no bounds checking.

◆ operator()() [2/2]

auto ox::Glyph_matrix::operator() ( Point  p) const -> Glyph

Glyph access operator. {0, 0} is top left. x grows south and y east.

Provides no bounds checking.

◆ resize()

void ox::Glyph_matrix::resize ( Area  area)

Resize the width and height of the matrix.

New Glyphs will be default constructed, Glyphs no longer within the bounds of the matrix will be destructed.


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