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
{
14
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;
30
bool
underlined_double
: 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:
44
Color
background_color
=
Color::Default
;
45
Color
foreground_color
=
Color::Default
;
46
};
47
48
}
// namespace ftxui
ftxui::Color
A class representing terminal colors.
Definition:
color.hpp:20
ftxui::Color::Default
@ Default
Definition:
color.hpp:42
color.hpp
ftxui
Definition:
animation.hpp:10
ftxui::Pixel
A Unicode character and its associated style.
Definition:
pixel.hpp:13
ftxui::Pixel::hyperlink
uint8_t hyperlink
Definition:
pixel.hpp:37
ftxui::Pixel::inverted
bool inverted
Definition:
pixel.hpp:28
ftxui::Pixel::strikethrough
bool strikethrough
Definition:
pixel.hpp:31
ftxui::Pixel::foreground_color
Color foreground_color
Definition:
pixel.hpp:45
ftxui::Pixel::blink
bool blink
Definition:
pixel.hpp:25
ftxui::Pixel::background_color
Color background_color
Definition:
pixel.hpp:44
ftxui::Pixel::character
std::string character
Definition:
pixel.hpp:41
ftxui::Pixel::dim
bool dim
Definition:
pixel.hpp:27
ftxui::Pixel::Pixel
Pixel()
Definition:
pixel.hpp:14
ftxui::Pixel::bold
bool bold
Definition:
pixel.hpp:26
ftxui::Pixel::underlined
bool underlined
Definition:
pixel.hpp:29
ftxui::Pixel::automerge
bool automerge
Definition:
pixel.hpp:32
ftxui::Pixel::underlined_double
bool underlined_double
Definition:
pixel.hpp:30