FTXUI 6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
ftxui/screen

详细描述

请查看 ftxui/screen 模块的 教程

命名空间

namespace  ftxui::Dimension
 定义屏幕的尺寸应如何呈现。
 

struct  Box
 Box是一个表示2D空间中矩形区域的结构体。 更多...
 
class  Color
 Color 是一个表示终端用户界面中颜色的类。 更多...
 
struct  ColorInfo
 ColorInfo是一个包含终端颜色调色板信息的结构。 颜色调色板信息。 更多...
 
class  Image
 像素的矩形网格。 更多...
 
struct  Pixel
 一个 Unicode 字符及其相关样式。 更多...
 
class  Screen
 像素的矩形网格。 更多...
 
struct  Dimensions
 Dimensions 是一个表示终端大小的结构。 更多...
 

枚举

enum  Color {
  Palette1 ,
  Palette16 ,
  Palette256 ,
  TrueColor
}
 Color 是一个表示终端颜色支持的枚举。 更多...
 

函数

Dimensions Size ()
 获取终端尺寸。
 
Color ColorSupport ()
 获取终端的颜色支持。
 

类说明

◆ ftxui::Box

struct ftxui::Box

Box是一个表示2D空间中矩形区域的结构体。

它由其沿x轴和y轴的最小和最大坐标定义。 注意,坐标是包含性的,这意味着box包含最小值和最大值。

在文件 box.hpp15 行定义.

Public 成员函数

void Shift (int x, int y)
 
bool Contain (int x, int y) const
 
bool IsEmpty () const
 
bool operator== (const Box &other) const
 
bool operator!= (const Box &other) const
 

静态 Public 成员函数

static auto Intersection (Box a, Box b) -> Box
 
static auto Union (Box a, Box b) -> Box
 

Public 属性

int x_min = 0
 
int x_max = 0
 
int y_min = 0
 
int y_max = 0
 

成员函数说明

◆ Intersection()

Box Intersection ( Box a,
Box b ) -> Box
static
返回
包含在 |a| 和 |b| 中的最大 Box。

在文件 box.cpp11 行定义.

◆ Union()

Box Union ( Box a,
Box b ) -> Box
static
返回
包含 |a| 和 |b| 的最小 Box。

在文件 box.cpp22 行定义.

◆ Shift()

void Shift ( int x,
int y )

Box 移动 (x,y)。

参数
x水平偏移。
y垂直偏移。

在文件 box.cpp34 行定义.

◆ Contain()

bool Contain ( int x,
int y ) const
返回
(x,y) 是否包含在 Box 内。

在文件 box.cpp42 行定义.

◆ IsEmpty()

bool IsEmpty ( ) const
返回
Box 是否为空。

在文件 box.cpp50 行定义.

◆ operator==()

bool operator== ( const Box & other) const
返回
|other| 是否与 |this| 相同

在文件 box.cpp55 行定义.

◆ operator!=()

bool operator!= ( const Box & other) const
返回
|other| 是否与 |this| 不同。

在文件 box.cpp61 行定义.

类成员变量说明

◆ x_min

int x_min = 0

在文件 box.hpp16 行定义.

◆ x_max

int x_max = 0

在文件 box.hpp17 行定义.

◆ y_min

int y_min = 0

在文件 box.hpp18 行定义.

◆ y_max

int y_max = 0

在文件 box.hpp19 行定义.

◆ ftxui::Color

class ftxui::Color

Public 类型

enum  Palette1 : uint8_t { Default }
 
enum  Palette16 : uint8_t {
  Black = 0 ,
  Red = 1 ,
  Green = 2 ,
  Yellow = 3 ,
  Blue = 4 ,
  Magenta = 5 ,
  Cyan = 6 ,
  GrayLight = 7 ,
  GrayDark = 8 ,
  RedLight = 9 ,
  GreenLight = 10 ,
  YellowLight = 11 ,
  BlueLight = 12 ,
  MagentaLight = 13 ,
  CyanLight = 14 ,
  White = 15
}
 
enum  Palette256 : uint8_t {
  Aquamarine1 = 122 ,
  Aquamarine1Bis = 86 ,
  Aquamarine3 = 79 ,
  Blue1 = 21 ,
  Blue3 = 19 ,
  Blue3Bis = 20 ,
  BlueViolet = 57 ,
  CadetBlue = 72 ,
  CadetBlueBis = 73 ,
  Chartreuse1 = 118 ,
  Chartreuse2 = 112 ,
  Chartreuse2Bis = 82 ,
  Chartreuse3 = 70 ,
  Chartreuse3Bis = 76 ,
  Chartreuse4 = 64 ,
  CornflowerBlue = 69 ,
  Cornsilk1 = 230 ,
  Cyan1 = 51 ,
  Cyan2 = 50 ,
  Cyan3 = 43 ,
  DarkBlue = 18 ,
  DarkCyan = 36 ,
  DarkGoldenrod = 136 ,
  DarkGreen = 22 ,
  DarkKhaki = 143 ,
  DarkMagenta = 90 ,
  DarkMagentaBis = 91 ,
  DarkOliveGreen1 = 191 ,
  DarkOliveGreen1Bis = 192 ,
  DarkOliveGreen2 = 155 ,
  DarkOliveGreen3 = 107 ,
  DarkOliveGreen3Bis = 113 ,
  DarkOliveGreen3Ter = 149 ,
  DarkOrange = 208 ,
  DarkOrange3 = 130 ,
  DarkOrange3Bis = 166 ,
  DarkRed = 52 ,
  DarkRedBis = 88 ,
  DarkSeaGreen = 108 ,
  DarkSeaGreen1 = 158 ,
  DarkSeaGreen1Bis = 193 ,
  DarkSeaGreen2 = 151 ,
  DarkSeaGreen2Bis = 157 ,
  DarkSeaGreen3 = 115 ,
  DarkSeaGreen3Bis = 150 ,
  DarkSeaGreen4 = 65 ,
  DarkSeaGreen4Bis = 71 ,
  DarkSlateGray1 = 123 ,
  DarkSlateGray2 = 87 ,
  DarkSlateGray3 = 116 ,
  DarkTurquoise = 44 ,
  DarkViolet = 128 ,
  DarkVioletBis = 92 ,
  DeepPink1 = 198 ,
  DeepPink1Bis = 199 ,
  DeepPink2 = 197 ,
  DeepPink3 = 161 ,
  DeepPink3Bis = 162 ,
  DeepPink4 = 125 ,
  DeepPink4Bis = 89 ,
  DeepPink4Ter = 53 ,
  DeepSkyBlue1 = 39 ,
  DeepSkyBlue2 = 38 ,
  DeepSkyBlue3 = 31 ,
  DeepSkyBlue3Bis = 32 ,
  DeepSkyBlue4 = 23 ,
  DeepSkyBlue4Bis = 24 ,
  DeepSkyBlue4Ter = 25 ,
  DodgerBlue1 = 33 ,
  DodgerBlue2 = 27 ,
  DodgerBlue3 = 26 ,
  Gold1 = 220 ,
  Gold3 = 142 ,
  Gold3Bis = 178 ,
  Green1 = 46 ,
  Green3 = 34 ,
  Green3Bis = 40 ,
  Green4 = 28 ,
  GreenYellow = 154 ,
  Grey0 = 16 ,
  Grey100 = 231 ,
  Grey11 = 234 ,
  Grey15 = 235 ,
  Grey19 = 236 ,
  Grey23 = 237 ,
  Grey27 = 238 ,
  Grey3 = 232 ,
  Grey30 = 239 ,
  Grey35 = 240 ,
  Grey37 = 59 ,
  Grey39 = 241 ,
  Grey42 = 242 ,
  Grey46 = 243 ,
  Grey50 = 244 ,
  Grey53 = 102 ,
  Grey54 = 245 ,
  Grey58 = 246 ,
  Grey62 = 247 ,
  Grey63 = 139 ,
  Grey66 = 248 ,
  Grey69 = 145 ,
  Grey7 = 233 ,
  Grey70 = 249 ,
  Grey74 = 250 ,
  Grey78 = 251 ,
  Grey82 = 252 ,
  Grey84 = 188 ,
  Grey85 = 253 ,
  Grey89 = 254 ,
  Grey93 = 255 ,
  Honeydew2 = 194 ,
  HotPink = 205 ,
  HotPink2 = 169 ,
  HotPink3 = 132 ,
  HotPink3Bis = 168 ,
  HotPinkBis = 206 ,
  IndianRed = 131 ,
  IndianRed1 = 203 ,
  IndianRed1Bis = 204 ,
  IndianRedBis = 167 ,
  Khaki1 = 228 ,
  Khaki3 = 185 ,
  LightCoral = 210 ,
  LightCyan1Bis = 195 ,
  LightCyan3 = 152 ,
  LightGoldenrod1 = 227 ,
  LightGoldenrod2 = 186 ,
  LightGoldenrod2Bis = 221 ,
  LightGoldenrod2Ter = 222 ,
  LightGoldenrod3 = 179 ,
  LightGreen = 119 ,
  LightGreenBis = 120 ,
  LightPink1 = 217 ,
  LightPink3 = 174 ,
  LightPink4 = 95 ,
  LightSalmon1 = 216 ,
  LightSalmon3 = 137 ,
  LightSalmon3Bis = 173 ,
  LightSeaGreen = 37 ,
  LightSkyBlue1 = 153 ,
  LightSkyBlue3 = 109 ,
  LightSkyBlue3Bis = 110 ,
  LightSlateBlue = 105 ,
  LightSlateGrey = 103 ,
  LightSteelBlue = 147 ,
  LightSteelBlue1 = 189 ,
  LightSteelBlue3 = 146 ,
  LightYellow3 = 187 ,
  Magenta1 = 201 ,
  Magenta2 = 165 ,
  Magenta2Bis = 200 ,
  Magenta3 = 127 ,
  Magenta3Bis = 163 ,
  Magenta3Ter = 164 ,
  MediumOrchid = 134 ,
  MediumOrchid1 = 171 ,
  MediumOrchid1Bis = 207 ,
  MediumOrchid3 = 133 ,
  MediumPurple = 104 ,
  MediumPurple1 = 141 ,
  MediumPurple2 = 135 ,
  MediumPurple2Bis = 140 ,
  MediumPurple3 = 97 ,
  MediumPurple3Bis = 98 ,
  MediumPurple4 = 60 ,
  MediumSpringGreen = 49 ,
  MediumTurquoise = 80 ,
  MediumVioletRed = 126 ,
  MistyRose1 = 224 ,
  MistyRose3 = 181 ,
  NavajoWhite1 = 223 ,
  NavajoWhite3 = 144 ,
  NavyBlue = 17 ,
  Orange1 = 214 ,
  Orange3 = 172 ,
  Orange4 = 58 ,
  Orange4Bis = 94 ,
  OrangeRed1 = 202 ,
  Orchid = 170 ,
  Orchid1 = 213 ,
  Orchid2 = 212 ,
  PaleGreen1 = 121 ,
  PaleGreen1Bis = 156 ,
  PaleGreen3 = 114 ,
  PaleGreen3Bis = 77 ,
  PaleTurquoise1 = 159 ,
  PaleTurquoise4 = 66 ,
  PaleVioletRed1 = 211 ,
  Pink1 = 218 ,
  Pink3 = 175 ,
  Plum1 = 219 ,
  Plum2 = 183 ,
  Plum3 = 176 ,
  Plum4 = 96 ,
  Purple = 129 ,
  Purple3 = 56 ,
  Purple4 = 54 ,
  Purple4Bis = 55 ,
  PurpleBis = 93 ,
  Red1 = 196 ,
  Red3 = 124 ,
  Red3Bis = 160 ,
  RosyBrown = 138 ,
  RoyalBlue1 = 63 ,
  Salmon1 = 209 ,
  SandyBrown = 215 ,
  SeaGreen1 = 84 ,
  SeaGreen1Bis = 85 ,
  SeaGreen2 = 83 ,
  SeaGreen3 = 78 ,
  SkyBlue1 = 117 ,
  SkyBlue2 = 111 ,
  SkyBlue3 = 74 ,
  SlateBlue1 = 99 ,
  SlateBlue3 = 61 ,
  SlateBlue3Bis = 62 ,
  SpringGreen1 = 48 ,
  SpringGreen2 = 42 ,
  SpringGreen2Bis = 47 ,
  SpringGreen3 = 35 ,
  SpringGreen3Bis = 41 ,
  SpringGreen4 = 29 ,
  SteelBlue = 67 ,
  SteelBlue1 = 75 ,
  SteelBlue1Bis = 81 ,
  SteelBlue3 = 68 ,
  Tan = 180 ,
  Thistle1 = 225 ,
  Thistle3 = 182 ,
  Turquoise2 = 45 ,
  Turquoise4 = 30 ,
  Violet = 177 ,
  Wheat1 = 229 ,
  Wheat4 = 101 ,
  Yellow1 = 226 ,
  Yellow2 = 190 ,
  Yellow3 = 148 ,
  Yellow3Bis = 184 ,
  Yellow4 = 100 ,
  Yellow4Bis = 106
}
 

Public 成员函数

 Color ()
 构建一个透明颜色。
 
 Color (Palette1 index)
 构建一个透明颜色。
 
 Color (Palette16 index)
 使用 Palette16 颜色构建一个颜色。
 
 Color (Palette256 index)
 使用 Palette256 颜色构建一个颜色。
 
 Color (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=255)
 从其 RGB 表示构建一个颜色。 https://en.wikipedia.org/wiki/RGB_color_model
 
bool operator== (const Color &rhs) const
 
bool operator!= (const Color &rhs) const
 
std::string Print (bool is_background_color) const
 
bool IsOpaque () const
 

静态 Public 成员函数

static Color RGB (uint8_t red, uint8_t green, uint8_t blue)
 从其 RGB 表示构建一个颜色。 https://en.wikipedia.org/wiki/RGB_color_model
 
static Color HSV (uint8_t hue, uint8_t saturation, uint8_t value)
 从其 HSV 表示构建一个颜色。 https://en.wikipedia.org/wiki/HSL_and_HSV
 
static Color RGBA (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
 从其 RGBA 表示构建一个颜色。 https://en.wikipedia.org/wiki/RGB_color_model
 
static Color HSVA (uint8_t hue, uint8_t saturation, uint8_t value, uint8_t alpha)
 从其 HSV 表示构建一个颜色。 https://en.wikipedia.org/wiki/HSL_and_HSV
 
static Color Interpolate (float t, const Color &a, const Color &b)
 
static Color Blend (const Color &lhs, const Color &rhs)
 使用 alpha 通道混合两种颜色。
 

成员枚举类型说明

◆ Palette1

enum Palette1 : uint8_t
枚举值
Default 

在文件 color.hpp47 行定义.

◆ Palette16

enum Palette16 : uint8_t
枚举值
Black 
Red 
Green 
Yellow 
Blue 
Magenta 
Cyan 
GrayLight 
GrayDark 
RedLight 
GreenLight 
YellowLight 
BlueLight 
MagentaLight 
CyanLight 
White 

在文件 color.hpp51 行定义.

◆ Palette256

enum Palette256 : uint8_t
枚举值
Aquamarine1 
Aquamarine1Bis 
Aquamarine3 
Blue1 
Blue3 
Blue3Bis 
BlueViolet 
CadetBlue 
CadetBlueBis 
Chartreuse1 
Chartreuse2 
Chartreuse2Bis 
Chartreuse3 
Chartreuse3Bis 
Chartreuse4 
CornflowerBlue 
Cornsilk1 
Cyan1 
Cyan2 
Cyan3 
DarkBlue 
DarkCyan 
DarkGoldenrod 
DarkGreen 
DarkKhaki 
DarkMagenta 
DarkMagentaBis 
DarkOliveGreen1 
DarkOliveGreen1Bis 
DarkOliveGreen2 
DarkOliveGreen3 
DarkOliveGreen3Bis 
DarkOliveGreen3Ter 
DarkOrange 
DarkOrange3 
DarkOrange3Bis 
DarkRed 
DarkRedBis 
DarkSeaGreen 
DarkSeaGreen1 
DarkSeaGreen1Bis 
DarkSeaGreen2 
DarkSeaGreen2Bis 
DarkSeaGreen3 
DarkSeaGreen3Bis 
DarkSeaGreen4 
DarkSeaGreen4Bis 
DarkSlateGray1 
DarkSlateGray2 
DarkSlateGray3 
DarkTurquoise 
DarkViolet 
DarkVioletBis 
DeepPink1 
DeepPink1Bis 
DeepPink2 
DeepPink3 
DeepPink3Bis 
DeepPink4 
DeepPink4Bis 
DeepPink4Ter 
DeepSkyBlue1 
DeepSkyBlue2 
DeepSkyBlue3 
DeepSkyBlue3Bis 
DeepSkyBlue4 
DeepSkyBlue4Bis 
DeepSkyBlue4Ter 
DodgerBlue1 
DodgerBlue2 
DodgerBlue3 
Gold1 
Gold3 
Gold3Bis 
Green1 
Green3 
Green3Bis 
Green4 
GreenYellow 
Grey0 
Grey100 
Grey11 
Grey15 
Grey19 
Grey23 
Grey27 
Grey3 
Grey30 
Grey35 
Grey37 
Grey39 
Grey42 
Grey46 
Grey50 
Grey53 
Grey54 
Grey58 
Grey62 
Grey63 
Grey66 
Grey69 
Grey7 
Grey70 
Grey74 
Grey78 
Grey82 
Grey84 
Grey85 
Grey89 
Grey93 
Honeydew2 
HotPink 
HotPink2 
HotPink3 
HotPink3Bis 
HotPinkBis 
IndianRed 
IndianRed1 
IndianRed1Bis 
IndianRedBis 
Khaki1 
Khaki3 
LightCoral 
LightCyan1Bis 
LightCyan3 
LightGoldenrod1 
LightGoldenrod2 
LightGoldenrod2Bis 
LightGoldenrod2Ter 
LightGoldenrod3 
LightGreen 
LightGreenBis 
LightPink1 
LightPink3 
LightPink4 
LightSalmon1 
LightSalmon3 
LightSalmon3Bis 
LightSeaGreen 
LightSkyBlue1 
LightSkyBlue3 
LightSkyBlue3Bis 
LightSlateBlue 
LightSlateGrey 
LightSteelBlue 
LightSteelBlue1 
LightSteelBlue3 
LightYellow3 
Magenta1 
Magenta2 
Magenta2Bis 
Magenta3 
Magenta3Bis 
Magenta3Ter 
MediumOrchid 
MediumOrchid1 
MediumOrchid1Bis 
MediumOrchid3 
MediumPurple 
MediumPurple1 
MediumPurple2 
MediumPurple2Bis 
MediumPurple3 
MediumPurple3Bis 
MediumPurple4 
MediumSpringGreen 
MediumTurquoise 
MediumVioletRed 
MistyRose1 
MistyRose3 
NavajoWhite1 
NavajoWhite3 
NavyBlue 
Orange1 
Orange3 
Orange4 
Orange4Bis 
OrangeRed1 
Orchid 
Orchid1 
Orchid2 
PaleGreen1 
PaleGreen1Bis 
PaleGreen3 
PaleGreen3Bis 
PaleTurquoise1 
PaleTurquoise4 
PaleVioletRed1 
Pink1 
Pink3 
Plum1 
Plum2 
Plum3 
Plum4 
Purple 
Purple3 
Purple4 
Purple4Bis 
PurpleBis 
Red1 
Red3 
Red3Bis 
RosyBrown 
RoyalBlue1 
Salmon1 
SandyBrown 
SeaGreen1 
SeaGreen1Bis 
SeaGreen2 
SeaGreen3 
SkyBlue1 
SkyBlue2 
SkyBlue3 
SlateBlue1 
SlateBlue3 
SlateBlue3Bis 
SpringGreen1 
SpringGreen2 
SpringGreen2Bis 
SpringGreen3 
SpringGreen3Bis 
SpringGreen4 
SteelBlue 
SteelBlue1 
SteelBlue1Bis 
SteelBlue3 
Tan 
Thistle1 
Thistle3 
Turquoise2 
Turquoise4 
Violet 
Wheat1 
Wheat4 
Yellow1 
Yellow2 
Yellow3 
Yellow3Bis 
Yellow4 
Yellow4Bis 

在文件 color.hpp70 行定义.

构造及析构函数说明

◆ Color() [1/5]

Color ( )
default

构建一个透明颜色。

◆ Color() [2/5]

Color ( Palette1 index)

构建一个透明颜色。

在文件 screen/color.cpp79 行定义.

◆ Color() [3/5]

Color ( Palette16 index)

使用 Palette16 颜色构建一个颜色。

在文件 screen/color.cpp82 行定义.

◆ Color() [4/5]

Color ( Palette256 index)

使用 Palette256 颜色构建一个颜色。

在文件 screen/color.cpp86 行定义.

◆ Color() [5/5]

Color ( uint8_t red,
uint8_t green,
uint8_t blue,
uint8_t alpha = 255 )

从其 RGB 表示构建一个颜色。 https://en.wikipedia.org/wiki/RGB_color_model

参数
red红色分量 [0,255]
green绿色分量 [0,255]
blue蓝色分量 [0,255]
alpha透明度分量 [0,255]

在文件 screen/color.cpp102 行定义.

成员函数说明

◆ RGB()

Color RGB ( uint8_t red,
uint8_t green,
uint8_t blue )
static

从其 RGB 表示构建一个颜色。 https://en.wikipedia.org/wiki/RGB_color_model

参数
red红色分量 [0,255]
green绿色分量 [0,255]
blue蓝色分量 [0,255]

在文件 screen/color.cpp146 行定义.

◆ HSV()

Color HSV ( uint8_t h,
uint8_t s,
uint8_t v )
static

从其 HSV 表示构建一个颜色。 https://en.wikipedia.org/wiki/HSL_and_HSV

参数
h颜色的色相 [0,255]
s“色彩度” [0,255]。
v“亮度” [0,255]

在文件 screen/color.cpp197 行定义.

◆ RGBA()

Color RGBA ( uint8_t red,
uint8_t green,
uint8_t blue,
uint8_t alpha )
static

从其 RGBA 表示构建一个颜色。 https://en.wikipedia.org/wiki/RGB_color_model

参数
red红色分量 [0,255]
green绿色分量 [0,255]
blue蓝色分量 [0,255]
alpha透明度分量 [0,255]
参见
Color::RGB

在文件 screen/color.cpp158 行定义.

◆ HSVA()

Color HSVA ( uint8_t h,
uint8_t s,
uint8_t v,
uint8_t alpha )
static

从其 HSV 表示构建一个颜色。 https://en.wikipedia.org/wiki/HSL_and_HSV

参数
h颜色的色相 [0,255]
s“色彩度” [0,255]。
v“亮度” [0,255]
alpha透明度分量 [0,255]

在文件 screen/color.cpp170 行定义.

◆ Interpolate()

Color Interpolate ( float t,
const Color & a,
const Color & b )
static

在文件 screen/color.cpp202 行定义.

◆ Blend()

Color Blend ( const Color & lhs,
const Color & rhs )
static

使用 alpha 通道混合两种颜色。

在文件 screen/color.cpp271 行定义.

◆ operator==()

bool operator== ( const Color & rhs) const

在文件 screen/color.cpp36 行定义.

◆ operator!=()

bool operator!= ( const Color & rhs) const

在文件 screen/color.cpp41 行定义.

◆ Print()

std::string Print ( bool is_background_color) const

在文件 screen/color.cpp45 行定义.

◆ IsOpaque()

bool IsOpaque ( ) const
inline

在文件 color.hpp319 行定义.

◆ ftxui::ColorInfo

struct ftxui::ColorInfo

ColorInfo是一个包含终端颜色调色板信息的结构。 颜色调色板信息。

在文件 color_info.hpp16 行定义.

Public 属性

const char * name
 
uint8_t index_256
 
uint8_t index_16
 
uint8_t red
 
uint8_t green
 
uint8_t blue
 
uint8_t hue
 
uint8_t saturation
 
uint8_t value
 

类成员变量说明

◆ name

const char* name

在文件 color_info.hpp17 行定义.

◆ index_256

uint8_t index_256

在文件 color_info.hpp18 行定义.

◆ index_16

uint8_t index_16

在文件 color_info.hpp19 行定义.

◆ red

uint8_t red

在文件 color_info.hpp20 行定义.

◆ green

uint8_t green

在文件 color_info.hpp21 行定义.

◆ blue

uint8_t blue

在文件 color_info.hpp22 行定义.

◆ hue

uint8_t hue

在文件 color_info.hpp23 行定义.

◆ saturation

uint8_t saturation

在文件 color_info.hpp24 行定义.

◆ value

uint8_t value

在文件 color_info.hpp25 行定义.

◆ ftxui::Image

class ftxui::Image

像素的矩形网格。

在文件 image.hpp16 行定义.

+ 类 Image 继承关系图:

Public 成员函数

 Image ()=delete
 
 Image (int dimx, int dimy)
 
virtual ~Image ()=default
 
std::string & at (int x, int y)
 访问给定位置单元格中的字符。
 
const std::string & at (int x, int y) const
 访问给定位置单元格中的字符。
 
PixelPixelAt (int x, int y)
 访问给定位置的单元格 (Pixel)。
 
const PixelPixelAt (int x, int y) const
 访问给定位置的单元格 (Pixel)。
 
int dimx () const
 
int dimy () const
 
void Clear ()
 清除屏幕上的所有像素。
 

Public 属性

Box stencil
 

Protected 属性

int dimx_
 
int dimy_
 
std::vector< std::vector< Pixel > > pixels_
 

构造及析构函数说明

◆ Image() [1/2]

Image ( )
delete

◆ Image() [2/2]

Image ( int dimx,
int dimy )

在文件 image.cpp19 行定义.

◆ ~Image()

virtual ~Image ( )
virtualdefault

成员函数说明

◆ at() [1/2]

std::string & at ( int x,
int y )

访问给定位置单元格中的字符。

参数
x沿 x 轴的单元格位置。
y沿 y 轴的单元格位置。

在文件 image.cpp28 行定义.

◆ at() [2/2]

const std::string & at ( int x,
int y ) const

访问给定位置单元格中的字符。

参数
x沿 x 轴的单元格位置。
y沿 y 轴的单元格位置。

在文件 image.cpp35 行定义.

◆ PixelAt() [1/2]

Pixel & PixelAt ( int x,
int y )

访问给定位置的单元格 (Pixel)。

参数
x沿 x 轴的单元格位置。
y沿 y 轴的单元格位置。

在文件 image.cpp42 行定义.

◆ PixelAt() [2/2]

const Pixel & PixelAt ( int x,
int y ) const

访问给定位置的单元格 (Pixel)。

参数
x沿 x 轴的单元格位置。
y沿 y 轴的单元格位置。

在文件 image.cpp49 行定义.

◆ dimx()

int dimx ( ) const
inline

在文件 image.hpp34 行定义.

◆ dimy()

int dimy ( ) const
inline

在文件 image.hpp35 行定义.

◆ Clear()

void Clear ( )

清除屏幕上的所有像素。

在文件 image.cpp54 行定义.

类成员变量说明

◆ stencil

Box stencil

在文件 image.hpp40 行定义.

◆ dimx_

int dimx_
protected

在文件 image.hpp43 行定义.

◆ dimy_

int dimy_
protected

在文件 image.hpp44 行定义.

◆ pixels_

std::vector<std::vector<Pixel> > pixels_
protected

在文件 image.hpp45 行定义.

◆ ftxui::Pixel

struct ftxui::Pixel

一个 Unicode 字符及其相关样式。

示例
examples/component/canvas_animated.cpp, examples/component/selection.cpp , 以及 examples/dom/canvas.cpp.

在文件 pixel.hpp14 行定义.

Public 成员函数

 Pixel ()
 

Public 属性

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
 
uint8_t hyperlink = 0
 
std::string character = ""
 
Color background_color = Color::Default
 
Color foreground_color = Color::Default
 

构造及析构函数说明

◆ Pixel()

Pixel ( )
inline

在文件 pixel.hpp15 行定义.

类成员变量说明

◆ blink

bool blink

在文件 pixel.hpp27 行定义.

◆ bold

bool bold
示例
examples/component/canvas_animated.cpp.

在文件 pixel.hpp28 行定义.

◆ dim

bool dim

在文件 pixel.hpp29 行定义.

◆ italic

bool italic

在文件 pixel.hpp30 行定义.

◆ inverted

bool inverted

在文件 pixel.hpp31 行定义.

◆ underlined

bool underlined

◆ underlined_double

bool underlined_double
示例
examples/component/selection.cpp.

在文件 pixel.hpp33 行定义.

◆ strikethrough

bool strikethrough

在文件 pixel.hpp34 行定义.

◆ automerge

bool automerge

在文件 pixel.hpp35 行定义.

◆ hyperlink

uint8_t hyperlink = 0

在文件 pixel.hpp40 行定义.

◆ character

std::string character = ""

在文件 pixel.hpp44 行定义.

◆ background_color

Color background_color = Color::Default

在文件 pixel.hpp47 行定义.

◆ foreground_color

Color foreground_color = Color::Default

◆ ftxui::Screen

class ftxui::Screen

像素的矩形网格。

示例
examples/dom/gauge.cpp , 以及 examples/dom/gauge_direction.cpp.

在文件 screen.hpp26 行定义.

+ 类 Screen 继承关系图:

Public 类型

using SelectionStyle = std::function<void(Pixel&)>
 

Public 成员函数

 Screen (int dimx, int dimy)
 
 ~Screen () override=default
 
std::string ToString () const
 
void Print () const
 
void Clear ()
 清除屏幕上的所有像素。
 
std::string ResetPosition (bool clear=false) const
 返回一个字符串,用于将光标位置重置到屏幕开头。
 
void ApplyShader ()
 
Cursor cursor () const
 
void SetCursor (Cursor cursor)
 
uint8_t RegisterHyperlink (const std::string &link)
 
const std::string & Hyperlink (uint8_t id) const
 
const SelectionStyleGetSelectionStyle () const
 返回当前选择样式。
 
void SetSelectionStyle (SelectionStyle decorator)
 设置当前选择样式。
 
std::string & at (int x, int y)
 访问给定位置单元格中的字符。
 
const std::string & at (int x, int y) const
 访问给定位置单元格中的字符。
 
PixelPixelAt (int x, int y)
 访问给定位置的单元格 (Pixel)。
 
const PixelPixelAt (int x, int y) const
 访问给定位置的单元格 (Pixel)。
 
int dimx () const
 
int dimy () const
 

静态 Public 成员函数

static Screen Create (Dimensions dimension)
 创建一个具有给定维度的屏幕。
 
static Screen Create (Dimensions width, Dimensions height)
 创建一个具有给定 x 轴和 y 轴维度的屏幕。
 

Public 属性

Box stencil
 

Protected 属性

Cursor cursor_
 
std::vector< std::string > hyperlinks_ = {""}
 
SelectionStyle selection_style_
 
int dimx_
 
int dimy_
 
std::vector< std::vector< Pixel > > pixels_
 

成员类型定义说明

◆ SelectionStyle

using SelectionStyle = std::function<void(Pixel&)>

在文件 screen.hpp74 行定义.

构造及析构函数说明

◆ Screen()

Screen ( int dimx,
int dimy )

在文件 screen.cpp398 行定义.

◆ ~Screen()

~Screen ( )
overridedefault

成员函数说明

◆ Create() [1/2]

Screen Create ( Dimensions dimension)
static

创建一个具有给定维度的屏幕。

在文件 screen.cpp394 行定义.

◆ Create() [2/2]

Screen Create ( Dimensions width,
Dimensions height )
static

创建一个具有给定 x 轴和 y 轴维度的屏幕。

在文件 screen.cpp388 行定义.

◆ ToString()

std::string ToString ( ) const

生成一个可用于在终端上打印 Screen 的 std::string。

注解
不要忘记刷新 stdout。或者,您可以使用 Screen::Print();

在文件 screen.cpp413 行定义.

◆ Print()

void Print ( ) const

在文件 screen.cpp450 行定义.

◆ Clear()

void Clear ( )

清除屏幕上的所有像素。

在文件 screen.cpp490 行定义.

◆ ResetPosition()

std::string ResetPosition ( bool clear = false) const

返回一个字符串,用于将光标位置重置到屏幕开头。

std::string reset_position;
while(true) {
auto document = render();
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
Render(screen, document);
std::cout << reset_position << screen.ToString() << std::flush;
reset_position = screen.ResetPosition();
using namespace std::chrono_literals;
std::this_thread::sleep_for(0.01s);
}
void Render(Screen &screen, const Element &element)
在 ftxui::Screen 上显示元素。
static Screen Create(Dimensions dimension)
创建一个具有给定维度的屏幕。
返回
用于将光标位置重置到屏幕开头的字符串。

在文件 screen.cpp471 行定义.

◆ ApplyShader()

void ApplyShader ( )

在文件 screen.cpp502 行定义.

◆ cursor()

Cursor cursor ( ) const
inline

在文件 screen.hpp66 行定义.

◆ SetCursor()

void SetCursor ( Cursor cursor)
inline

在文件 screen.hpp67 行定义.

◆ RegisterHyperlink()

std::uint8_t RegisterHyperlink ( const std::string & link)

在文件 screen.cpp529 行定义.

◆ Hyperlink()

const std::string & Hyperlink ( uint8_t id) const

在文件 screen.cpp542 行定义.

◆ GetSelectionStyle()

const Screen::SelectionStyle & GetSelectionStyle ( ) const

返回当前选择样式。

参见
SetSelectionStyle

在文件 screen.cpp551 行定义.

◆ SetSelectionStyle()

void SetSelectionStyle ( SelectionStyle decorator)

设置当前选择样式。

参见
GetSelectionStyle

在文件 screen.cpp557 行定义.

◆ at() [1/2]

std::string & at ( int x,
int y )
inherited

访问给定位置单元格中的字符。

参数
x沿 x 轴的单元格位置。
y沿 y 轴的单元格位置。

在文件 image.cpp28 行定义.

◆ at() [2/2]

const std::string & at ( int x,
int y ) const
inherited

访问给定位置单元格中的字符。

参数
x沿 x 轴的单元格位置。
y沿 y 轴的单元格位置。

在文件 image.cpp35 行定义.

◆ PixelAt() [1/2]

Pixel & PixelAt ( int x,
int y )
inherited

访问给定位置的单元格 (Pixel)。

参数
x沿 x 轴的单元格位置。
y沿 y 轴的单元格位置。

在文件 image.cpp42 行定义.

◆ PixelAt() [2/2]

const Pixel & PixelAt ( int x,
int y ) const
inherited

访问给定位置的单元格 (Pixel)。

参数
x沿 x 轴的单元格位置。
y沿 y 轴的单元格位置。

在文件 image.cpp49 行定义.

◆ dimx()

int dimx ( ) const
inlineinherited

在文件 image.hpp34 行定义.

◆ dimy()

int dimy ( ) const
inlineinherited

在文件 image.hpp35 行定义.

类成员变量说明

◆ cursor_

Cursor cursor_
protected

在文件 screen.hpp79 行定义.

◆ hyperlinks_

std::vector<std::string> hyperlinks_ = {""}
protected

在文件 screen.hpp80 行定义.

◆ selection_style_

SelectionStyle selection_style_
protected
初始值:
= [](Pixel& pixel) {
pixel.inverted ^= true;
}

在文件 screen.hpp83 行定义.

◆ stencil

Box stencil
inherited

在文件 image.hpp40 行定义.

◆ dimx_

int dimx_
protectedinherited

在文件 image.hpp43 行定义.

◆ dimy_

int dimy_
protectedinherited

在文件 image.hpp44 行定义.

◆ pixels_

std::vector<std::vector<Pixel> > pixels_
protectedinherited

在文件 image.hpp45 行定义.

◆ ftxui::Dimensions

struct ftxui::Dimensions

Dimensions 是一个表示终端大小的结构。

在文件 terminal.hpp10 行定义.

Public 属性

int dimx
 
int dimy
 

类成员变量说明

◆ dimx

int dimx

在文件 terminal.hpp11 行定义.

◆ dimy

int dimy

在文件 terminal.hpp12 行定义.

枚举类型说明

◆ Color

enum Color

Color 是一个表示终端颜色支持的枚举。

枚举值
Palette1 
Palette16 
Palette256 
TrueColor 

在文件 terminal.hpp21 行定义.

函数说明

◆ Size()

Dimensions Size ( )

获取终端尺寸。

返回
终端尺寸。

在文件 terminal.cpp89 行定义.

◆ ColorSupport()

Color ColorSupport ( )

获取终端的颜色支持。

在文件 terminal.cpp123 行定义.