15Cell& dev_null_cell() {
21Surface::Surface(
int dimx,
int dimy)
22 : stencil{0, dimx - 1, 0, dimy - 1},
25 cells_(static_cast<size_t>(dimx) * static_cast<size_t>(dimy)) {}
30std::string& Surface::at(
int x,
int y) {
31 return CellAt(x, y).character;
37const std::string& Surface::at(
int x,
int y)
const {
38 return CellAt(x, y).character;
44Cell& Surface::CellAt(
int x,
int y) {
45 return stencil.Contain(x, y) ? FastCellAt(x, y) : dev_null_cell();
51const Cell& Surface::CellAt(
int x,
int y)
const {
52 return stencil.Contain(x, y) ? FastCellAt(x, y) : dev_null_cell();
58Cell& Surface::FastCellAt(
int x,
int y) {
59 return cells_[
static_cast<size_t>(
y) *
static_cast<size_t>(dimx_) +
60 static_cast<size_t>(x)];
66const Cell& Surface::FastCellAt(
int x,
int y)
const {
67 return cells_[
static_cast<size_t>(
y) *
static_cast<size_t>(dimx_) +
68 static_cast<size_t>(x)];
72void Surface::Clear() {
73 std::fill(cells_.begin(), cells_.end(), Cell());
The FTXUI ftxui:: namespace.