Terminal++ 3.1.0.4
A C++ library for interacting with ANSI terminal windows
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
terminalpp::canvas Class Reference

A class representing a grid onto which elements can be painted. More...

#include <canvas.hpp>

Classes

class  column_proxy
 A proxy into a column of elements on the canvas. More...
 
class  const_column_proxy
 A constant proxy into a column of elements on the canvas. More...
 

Public Types

using size_type = coordinate_type
 
using iterator = element *
 
using const_iterator = element const *
 

Public Member Functions

 canvas (extent size)
 Constructor.
 
extent size () const
 Returns the size of the canvas.
 
void resize (extent const &size)
 Resizes the canvas to the specified extent. Content that would fit in the new size remains as it was, otherwise it is truncated.
 
iterator begin ()
 Returns pointer to the top-left element.
 
const_iterator begin () const
 Returns pointer to the top-left element.
 
iterator end ()
 Returns one-past-the-end of the canvas.
 
const_iterator end () const
 Returns one-past-the-end of the canvas.
 
column_proxy operator[] (coordinate_type column)
 A subscript operator into a column.
 
const_column_proxy operator[] (coordinate_type) const
 A subscript operator into a column.
 

Detailed Description

A class representing a grid onto which elements can be painted.

Usage
The grid is formed from a contiguous block of memory. Position [0,0] represents the top left of the grid, and it proceeds in a left-to-right manner first, then top-to-bottom.

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