15Cell& dev_null_cell() {
21Surface::Surface(
int dimx,
int dimy)
22 : stencil{0, std::max(0, dimx) - 1, 0, std::max(0, dimy) - 1},
23 dimx_(std::max(0, dimx)),
24 dimy_(std::max(0, dimy)),
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();
59Cell& Surface::FastCellAt(
int x,
int y) {
60 return cells_[
static_cast<size_t>(
y) *
static_cast<size_t>(dimx_) +
61 static_cast<size_t>(x)];
68const Cell& Surface::FastCellAt(
int x,
int y)
const {
69 return cells_[
static_cast<size_t>(
y) *
static_cast<size_t>(dimx_) +
70 static_cast<size_t>(x)];
74void Surface::Clear() {
75 std::fill(cells_.begin(), cells_.end(), Cell());
78void Surface::Reserved1() {}
79void Surface::Reserved2() {}
80void Surface::Reserved3() {}
81void Surface::Reserved4() {}
82void Surface::Reserved5() {}
83void Surface::Reserved6() {}
84void Surface::Reserved7() {}
85void Surface::Reserved8() {}
L'espace de noms FTXUI ftxui::