Loading...
Searching...
No Matches
pixel.hpp
Go to the documentation of this file.
// Copyright 2024 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#ifndef FTXUI_SCREEN_PIXEL_HPP
#define FTXUI_SCREEN_PIXEL_HPP
#include <cstdint> // for uint8_t
#include <string> // for string, basic_string, allocator
#include "ftxui/screen/color.hpp" // for Color, Color::Default
namespace ftxui {
/// @brief A Unicode character and its associated style.
/// @ingroup screen
struct Pixel {
Pixel()
: blink(false),
bold(false),
dim(false),
italic(false),
inverted(false),
underlined(false),
underlined_double(false),
strikethrough(false),
automerge(false) {}
// A bit field representing the style:
bool blink : 1;
bool bold : 1;
bool dim : 1;
bool italic : 1;
bool inverted : 1;
bool underlined : 1;
bool underlined_double : 1;
bool strikethrough : 1;
bool automerge : 1;
// The hyperlink associated with the pixel.
// 0 is the default value, meaning no hyperlink.
// It's an index for accessing Screen meta data
uint8_t hyperlink = 0;
// The graphemes stored into the pixel. To support combining characters,
// like: a?, this can potentially contain multiple codepoints.
std::string character = "";
// Colors:
Color background_color = Color::Default;
Color foreground_color = Color::Default;
};
} // namespace ftxui
#endif // FTXUI_SCREEN_PIXEL_HPP
ftxui::Color
A class representing terminal colors.
Definition color.hpp:20
ftxui::Color::Default
@ Default
Definition color.hpp:48
color.hpp
ftxui
Definition animation.hpp:10
ftxui::Make
std::shared_ptr< T > Make(Args &&... args)
Definition component.hpp:26
ftxui::Pixel
A Unicode character and its associated style.
Definition pixel.hpp:15
ftxui::Pixel::hyperlink
uint8_t hyperlink
Definition pixel.hpp:41
ftxui::Pixel::inverted
bool inverted
Definition pixel.hpp:32
ftxui::Pixel::strikethrough
bool strikethrough
Definition pixel.hpp:35
ftxui::Pixel::foreground_color
Color foreground_color
Definition pixel.hpp:49
ftxui::Pixel::blink
bool blink
Definition pixel.hpp:28
ftxui::Pixel::background_color
Color background_color
Definition pixel.hpp:48
ftxui::Pixel::character
std::string character
Definition pixel.hpp:45
ftxui::Pixel::dim
bool dim
Definition pixel.hpp:30
ftxui::Pixel::Pixel
Pixel()
Definition pixel.hpp:16
ftxui::Pixel::bold
bool bold
Definition pixel.hpp:29
ftxui::Pixel::underlined
bool underlined
Definition pixel.hpp:33
ftxui::Pixel::italic
bool italic
Definition pixel.hpp:31
ftxui::Pixel::automerge
bool automerge
Definition pixel.hpp:36
ftxui::Pixel::underlined_double
bool underlined_double
Definition pixel.hpp:34