FTXUI  5.0.0
C++ functional terminal UI.
pixel.hpp
Go to the documentation of this file.
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 
5 #include <cstdint> // for uint8_t
6 #include <string> // for string, basic_string, allocator
7 #include "ftxui/screen/color.hpp" // for Color, Color::Default
8 
9 namespace ftxui {
10 
11 /// @brief A Unicode character and its associated style.
12 /// @ingroup screen
13 struct Pixel {
15  : blink(false),
16  bold(false),
17  dim(false),
18  inverted(false),
19  underlined(false),
20  underlined_double(false),
21  strikethrough(false),
22  automerge(false) {}
23 
24  // A bit field representing the style:
25  bool blink : 1;
26  bool bold : 1;
27  bool dim : 1;
28  bool inverted : 1;
29  bool underlined : 1;
31  bool strikethrough : 1;
32  bool automerge : 1;
33 
34  // The hyperlink associated with the pixel.
35  // 0 is the default value, meaning no hyperlink.
36  // It's an index for accessing Screen meta data
37  uint8_t hyperlink = 0;
38 
39  // The graphemes stored into the pixel. To support combining characters,
40  // like: a?, this can potentially contain multiple codepoints.
41  std::string character = " ";
42 
43  // Colors:
46 };
47 
48 } // namespace ftxui
A class representing terminal colors.
Definition: color.hpp:20
A Unicode character and its associated style.
Definition: pixel.hpp:13
uint8_t hyperlink
Definition: pixel.hpp:37
bool inverted
Definition: pixel.hpp:28
bool strikethrough
Definition: pixel.hpp:31
Color foreground_color
Definition: pixel.hpp:45
bool blink
Definition: pixel.hpp:25
Color background_color
Definition: pixel.hpp:44
std::string character
Definition: pixel.hpp:41
bool dim
Definition: pixel.hpp:27
bool bold
Definition: pixel.hpp:26
bool underlined
Definition: pixel.hpp:29
bool automerge
Definition: pixel.hpp:32
bool underlined_double
Definition: pixel.hpp:30