FTXUI 6.1.9
C++ functional terminal UI.
Chargement...
Recherche...
Aucune correspondance
image.hpp
Aller à la documentation de ce fichier.
1// Copyright 2024 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#ifndef FTXUI_SCREEN_IMAGE_HPP
5#define FTXUI_SCREEN_IMAGE_HPP
6
7#include <string> // for string, basic_string, allocator
8#include <vector> // for vector
9
10#include "ftxui/screen/box.hpp" // for Box
11#include "ftxui/screen/pixel.hpp" // for Pixel
12
13namespace ftxui {
14
15/// @brief Une grille rectangulaire de pixels.
16/// @ingroup screen
17class Image {
18 public:
19 // Constructors:
20 Image() = delete;
21 Image(int dimx, int dimy);
22
23 // Destructor:
24 virtual ~Image() = default;
25
26 // Accède à un caractère de la grille à une position donnée.
27 std::string& at(int x, int y);
28 const std::string& at(int x, int y) const;
29
30 // Accède à une cellule (Pixel) de la grille à une position donnée.
31 Pixel& PixelAt(int x, int y);
32 const Pixel& PixelAt(int x, int y) const;
33
34 // Obtenir les dimensions de l'écran.
35 int dimx() const { return dimx_; }
36 int dimy() const { return dimy_; }
37
38 // Remplit l'image avec des espaces et un style par défaut.
39 void Clear();
40
42
43 protected:
44 int dimx_;
45 int dimy_;
46 std::vector<std::vector<Pixel>> pixels_;
47};
48
49} // namespace ftxui
50
51#endif // FTXUI_SCREEN_IMAGE_HPP
int dimy() const
Definition image.hpp:36
Pixel & PixelAt(int x, int y)
Accède à une cellule (Pixel) à une position donnée.
Definition image.cpp:43
std::string & at(int x, int y)
Accède à un caractère dans une cellule à une position donnée.
Definition image.cpp:29
Image()=delete
Box stencil
Definition image.hpp:41
void Clear()
Efface tous les pixels de l'écran.
Definition image.cpp:55
int dimx() const
Definition image.hpp:35
std::vector< std::vector< Pixel > > pixels_
Definition image.hpp:46
virtual ~Image()=default
Une grille rectangulaire de pixels.
Definition image.hpp:17
Box est une structure qui représente une zone rectangulaire dans un espace 2D.
Definition box.hpp:16
Un caractère Unicode et son style associé.
Definition pixel.hpp:15
L'espace de noms FTXUI ftxui::
Definition animation.hpp:10