4#ifndef FTXUI_DOM_CANVAS_HPP
5#define FTXUI_DOM_CANVAS_HPP
10#include <unordered_map>
44 int width()
const {
return width_; }
45 int height()
const {
return height_; }
109 void DrawText(
int x,
int y,
const std::string& value);
110 void DrawText(
int x,
int y,
const std::string& value,
const Color& color);
111 void DrawText(
int x,
int y,
const std::string& value,
const Stylizer& style);
125 bool IsIn(
int x,
int y)
const {
126 return x >= 0 && x < width_ && y >= 0 && y < height_;
136 CellType type = kCell;
143 bool operator==(
const XY& other)
const {
144 return x == other.x && y == other.y;
149 size_t operator()(
const XY& xy)
const {
150 constexpr size_t shift = 1024;
151 return size_t(xy.x) * shift + size_t(xy.y);
157 std::unordered_map<XY, Cell, XYHash> storage_;
void DrawImage(int x, int y, const Image &)
Dessine une image prédéfinie, avec le coin supérieur gauche à la coordonnée donnée Vous pouvez fourni...
void DrawBlockLine(int x1, int y1, int x2, int y2)
Dessine une ligne de caractères de bloc.
void DrawPointEllipseFilled(int x, int y, int r1, int r2)
Dessine une ellipse remplie de points braille.
void DrawPointLine(int x1, int y1, int x2, int y2)
Dessine une ligne de points braille.
void DrawText(int x, int y, const std::string &value)
Dessine un morceau de texte.
std::function< void(Pixel &)> Stylizer
void DrawBlockOn(int x, int y)
Dessine un bloc.
void DrawPointCircleFilled(int x, int y, int radius)
Dessine un cercle rempli de points braille.
void DrawPointOn(int x, int y)
Dessine un point braille.
void DrawPointOff(int x, int y)
Efface un point braille.
Pixel GetPixel(int x, int y) const
Récupère le contenu d'une cellule.
void DrawBlockEllipseFilled(int x1, int y1, int r1, int r2)
Dessine une ellipse remplie de caractères de bloc.
void DrawPointEllipse(int x, int y, int r1, int r2)
Dessine une ellipse de points braille.
void DrawPoint(int x, int y, bool value)
Dessine un point braille.
void DrawBlockEllipse(int x1, int y1, int r1, int r2)
Dessine une ellipse de caractères de bloc.
void DrawBlockToggle(int x, int y)
Inverse un bloc. S'il est rempli, il sera effacé. S'il est vide, il sera rempli.
void DrawBlockCircle(int x1, int y1, int radius)
Dessine un cercle de caractères de bloc.
void DrawBlockCircleFilled(int x1, int y1, int radius)
Dessine un cercle rempli de caractères de bloc.
void DrawPointCircle(int x, int y, int radius)
Dessine un cercle de points braille.
void DrawBlockOff(int x, int y)
Efface un bloc.
void DrawBlock(int x, int y, bool value)
Dessine un bloc.
void DrawPointToggle(int x, int y)
Inverse un point braille. Un point rempli sera effacé, et un point vide sera dessiné.
void DrawPixel(int x, int y, const Pixel &)
Dessine directement un pixel prédéfini à la coordonnée donnée.
Canvas est un tampon dessinable associé aux opérations de dessin.
Color est une classe qui représente une couleur dans l'interface utilisateur du terminal.
Une grille rectangulaire de pixels.
Un caractère Unicode et son style associé.
L'espace de noms FTXUI ftxui::