ftxui::Canvas
canvas.hpp
ftxui::Canvas::Cell
ftxui::Canvas::XY
ftxui::Canvas::XYHash
CellType
ftxui::Canvas::CellType
kCell
kBlock
kBraille
std::function< void(Pixel &)> using Stylizer = std::function<void(Pixel&)> Stylizer ftxui::Canvas::Stylizer
int int width_ width_ ftxui::Canvas::width_ = 0
int int height_ height_ ftxui::Canvas::height_ = 0
std::unordered_map< XY, Cell, XYHash > std::unordered_map<XY, Cell, XYHash> storage_ storage_ ftxui::Canvas::storage_
Canvas
()=default
Canvas
ftxui::Canvas::Canvas
Canvas
(int width, int height)
Canvas
ftxui::Canvas::Canvas
int width
int height

Constructor.

width

the width of the canvas. A cell is a 2x4 braille dot.

height

the height of the canvas. A cell is a 2x4 braille dot.

int int width () const width ftxui::Canvas::width
int int height () const height ftxui::Canvas::height
Pixel Pixel GetPixel (int x, int y) const GetPixel ftxui::Canvas::GetPixel int x int y

Get the content of a cell.

x

the x coordinate of the cell.

y

the y coordinate of the cell.

void void DrawPointOn (int x, int y) DrawPointOn ftxui::Canvas::DrawPointOn int x int y

Draw a braille dot.

x

the x coordinate of the dot.

y

the y coordinate of the dot.

void void DrawPointOff (int x, int y) DrawPointOff ftxui::Canvas::DrawPointOff int x int y

Erase a braille dot.

x

the x coordinate of the dot.

y

the y coordinate of the dot.

void void DrawPointToggle (int x, int y) DrawPointToggle ftxui::Canvas::DrawPointToggle int x int y

Toggle a braille dot. A filled one will be erased, and the other will be drawn.

x

the x coordinate of the dot.

y

the y coordinate of the dot.

void void DrawPoint (int x, int y, bool value) DrawPoint ftxui::Canvas::DrawPoint int x int y bool value

Draw a braille dot.

x

the x coordinate of the dot.

y

the y coordinate of the dot.

value

whether the dot is filled or not.

void void DrawPoint (int x, int y, bool value, const Stylizer &s) DrawPoint ftxui::Canvas::DrawPoint int x int y bool value const Stylizer & s style

Draw a braille dot.

x

the x coordinate of the dot.

y

the y coordinate of the dot.

value

whether the dot is filled or not.

style

the style of the cell.

void void DrawPoint (int x, int y, bool value, const Color &color) DrawPoint ftxui::Canvas::DrawPoint int x int y bool value const Color & color

Draw a braille dot.

x

the x coordinate of the dot.

y

the y coordinate of the dot.

value

whether the dot is filled or not.

color

the color of the dot.

void void DrawPointLine (int x1, int y1, int x2, int y2) DrawPointLine ftxui::Canvas::DrawPointLine int x1 int y1 int x2 int y2

Draw a line made of braille dots.

x1

the x coordinate of the first dot.

y1

the y coordinate of the first dot.

x2

the x coordinate of the second dot.

y2

the y coordinate of the second dot.

void void DrawPointLine (int x1, int y1, int x2, int y2, const Stylizer &s) DrawPointLine ftxui::Canvas::DrawPointLine int x1 int y1 int x2 int y2 const Stylizer & s style

Draw a line made of braille dots.

x1

the x coordinate of the first dot.

y1

the y coordinate of the first dot.o

x2

the x coordinate of the second dot.

y2

the y coordinate of the second dot.

style

the style of the line.

void void DrawPointLine (int x1, int y1, int x2, int y2, const Color &color) DrawPointLine ftxui::Canvas::DrawPointLine int x1 int y1 int x2 int y2 const Color & color

Draw a line made of braille dots.

x1

the x coordinate of the first dot.

y1

the y coordinate of the first dot.

x2

the x coordinate of the second dot.

y2

the y coordinate of the second dot.

color

the color of the line.

void void DrawPointCircle (int x, int y, int radius) DrawPointCircle ftxui::Canvas::DrawPointCircle int x int y int radius

Draw a circle made of braille dots.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

void void DrawPointCircle (int x, int y, int radius, const Stylizer &s) DrawPointCircle ftxui::Canvas::DrawPointCircle int x int y int radius const Stylizer & s style

Draw a circle made of braille dots.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

style

the style of the circle.

void void DrawPointCircle (int x, int y, int radius, const Color &color) DrawPointCircle ftxui::Canvas::DrawPointCircle int x int y int radius const Color & color

Draw a circle made of braille dots.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

color

the color of the circle.

void void DrawPointCircleFilled (int x, int y, int radius) DrawPointCircleFilled ftxui::Canvas::DrawPointCircleFilled int x int y int radius

Draw a filled circle made of braille dots.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

void void DrawPointCircleFilled (int x, int y, int radius, const Stylizer &s) DrawPointCircleFilled ftxui::Canvas::DrawPointCircleFilled int x int y int radius const Stylizer & s style

Draw a filled circle made of braille dots.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

style

the style of the circle.

void void DrawPointCircleFilled (int x, int y, int radius, const Color &color) DrawPointCircleFilled ftxui::Canvas::DrawPointCircleFilled int x int y int radius const Color & color

Draw a filled circle made of braille dots.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

color

the color of the circle.

void void DrawPointEllipse (int x, int y, int r1, int r2) DrawPointEllipse ftxui::Canvas::DrawPointEllipse int x int y int r1 int r2

Draw an ellipse made of braille dots.

x

the x coordinate of the center of the ellipse.

y

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

void void DrawPointEllipse (int x, int y, int r1, int r2, const Color &color) DrawPointEllipse ftxui::Canvas::DrawPointEllipse int x int y int r1 int r2 const Color & color

Draw an ellipse made of braille dots.

x

the x coordinate of the center of the ellipse.

y

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

color

the color of the ellipse.

void void DrawPointEllipse (int x, int y, int r1, int r2, const Stylizer &s) DrawPointEllipse ftxui::Canvas::DrawPointEllipse int x x1 int y y1 int r1 int r2 const Stylizer & s

Draw an ellipse made of braille dots.

x1

the x coordinate of the center of the ellipse.

y1

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

s

the style of the ellipse.

void void DrawPointEllipseFilled (int x, int y, int r1, int r2) DrawPointEllipseFilled ftxui::Canvas::DrawPointEllipseFilled int x x1 int y y1 int r1 int r2

Draw a filled ellipse made of braille dots.

x1

the x coordinate of the center of the ellipse.

y1

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

void void DrawPointEllipseFilled (int x, int y, int r1, int r2, const Color &color) DrawPointEllipseFilled ftxui::Canvas::DrawPointEllipseFilled int x x1 int y y1 int r1 int r2 const Color & color

Draw a filled ellipse made of braille dots.

x1

the x coordinate of the center of the ellipse.

y1

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

color

the color of the ellipse.

void void DrawPointEllipseFilled (int x, int y, int r1, int r2, const Stylizer &s) DrawPointEllipseFilled ftxui::Canvas::DrawPointEllipseFilled int x x1 int y y1 int r1 int r2 const Stylizer & s

Draw a filled ellipse made of braille dots.

x1

the x coordinate of the center of the ellipse.

y1

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

s

the style of the ellipse.

void void DrawBlockOn (int x, int y) DrawBlockOn ftxui::Canvas::DrawBlockOn int x int y

Draw a block.

x

the x coordinate of the block.

y

the y coordinate of the block.

void void DrawBlockOff (int x, int y) DrawBlockOff ftxui::Canvas::DrawBlockOff int x int y

Erase a block.

x

the x coordinate of the block.

y

the y coordinate of the block.

void void DrawBlockToggle (int x, int y) DrawBlockToggle ftxui::Canvas::DrawBlockToggle int x int y

Toggle a block. If it is filled, it will be erased. If it is empty, it will be filled.

x

the x coordinate of the block.

y

the y coordinate of the block.

void void DrawBlock (int x, int y, bool value) DrawBlock ftxui::Canvas::DrawBlock int x int y bool value

Draw a block.

x

the x coordinate of the block.

y

the y coordinate of the block.

value

whether the block is filled or not.

void void DrawBlock (int x, int y, bool value, const Stylizer &s) DrawBlock ftxui::Canvas::DrawBlock int x int y bool value const Stylizer & s style

Draw a block.

x

the x coordinate of the block.

y

the y coordinate of the block.

value

whether the block is filled or not.

style

the style of the block.

void void DrawBlock (int x, int y, bool value, const Color &color) DrawBlock ftxui::Canvas::DrawBlock int x int y bool value const Color & color

Draw a block.

x

the x coordinate of the block.

y

the y coordinate of the block.

value

whether the block is filled or not.

color

the color of the block.

void void DrawBlockLine (int x1, int y1, int x2, int y2) DrawBlockLine ftxui::Canvas::DrawBlockLine int x1 int y1 int x2 int y2

Draw a line made of block characters.

x1

the x coordinate of the first point of the line.

y1

the y coordinate of the first point of the line.

x2

the x coordinate of the second point of the line.

y2

the y coordinate of the second point of the line.

void void DrawBlockLine (int x1, int y1, int x2, int y2, const Stylizer &s) DrawBlockLine ftxui::Canvas::DrawBlockLine int x1 int y1 int x2 int y2 const Stylizer & s style

Draw a line made of block characters.

x1

the x coordinate of the first point of the line.

y1

the y coordinate of the first point of the line.

x2

the x coordinate of the second point of the line.

y2

the y coordinate of the second point of the line.

style

the style of the line.

void void DrawBlockLine (int x1, int y1, int x2, int y2, const Color &color) DrawBlockLine ftxui::Canvas::DrawBlockLine int x1 int y1 int x2 int y2 const Color & color

Draw a line made of block characters.

x1

the x coordinate of the first point of the line.

y1

the y coordinate of the first point of the line.

x2

the x coordinate of the second point of the line.

y2

the y coordinate of the second point of the line.

color

the color of the line.

void void DrawBlockCircle (int x1, int y1, int radius) DrawBlockCircle ftxui::Canvas::DrawBlockCircle int x1 x int y1 y int radius

Draw a circle made of block characters.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

void void DrawBlockCircle (int x1, int y1, int radius, const Stylizer &s) DrawBlockCircle ftxui::Canvas::DrawBlockCircle int x1 x int y1 y int radius const Stylizer & s style

Draw a circle made of block characters.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

style

the style of the circle.

void void DrawBlockCircle (int x1, int y1, int radius, const Color &color) DrawBlockCircle ftxui::Canvas::DrawBlockCircle int x1 x int y1 y int radius const Color & color

Draw a circle made of block characters.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

color

the color of the circle.

void void DrawBlockCircleFilled (int x1, int y1, int radius) DrawBlockCircleFilled ftxui::Canvas::DrawBlockCircleFilled int x1 x int y1 y int radius

Draw a filled circle made of block characters.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

void void DrawBlockCircleFilled (int x1, int y1, int radius, const Stylizer &s) DrawBlockCircleFilled ftxui::Canvas::DrawBlockCircleFilled int x1 x int y1 y int radius const Stylizer & s

Draw a filled circle made of block characters.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

s

the style of the circle.

void void DrawBlockCircleFilled (int x1, int y1, int radius, const Color &color) DrawBlockCircleFilled ftxui::Canvas::DrawBlockCircleFilled int x1 x int y1 y int radius const Color & color

Draw a filled circle made of block characters.

x

the x coordinate of the center of the circle.

y

the y coordinate of the center of the circle.

radius

the radius of the circle.

color

the color of the circle.

void void DrawBlockEllipse (int x1, int y1, int r1, int r2) DrawBlockEllipse ftxui::Canvas::DrawBlockEllipse int x1 x int y1 y int r1 int r2

Draw an ellipse made of block characters.

x

the x coordinate of the center of the ellipse.

y

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

void void DrawBlockEllipse (int x1, int y1, int r1, int r2, const Stylizer &s) DrawBlockEllipse ftxui::Canvas::DrawBlockEllipse int x1 int y1 int r1 int r2 const Stylizer & s

Draw an ellipse made of block characters.

x1

the x coordinate of the center of the ellipse.

y1

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

s

the style of the ellipse.

void void DrawBlockEllipse (int x1, int y1, int r1, int r2, const Color &color) DrawBlockEllipse ftxui::Canvas::DrawBlockEllipse int x1 x int y1 y int r1 int r2 const Color & color

Draw an ellipse made of block characters.

x

the x coordinate of the center of the ellipse.

y

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

color

the color of the ellipse.

void void DrawBlockEllipseFilled (int x1, int y1, int r1, int r2) DrawBlockEllipseFilled ftxui::Canvas::DrawBlockEllipseFilled int x1 x int y1 y int r1 int r2

Draw a filled ellipse made of block characters.

x

the x coordinate of the center of the ellipse.

y

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

void void DrawBlockEllipseFilled (int x1, int y1, int r1, int r2, const Stylizer &s) DrawBlockEllipseFilled ftxui::Canvas::DrawBlockEllipseFilled int x1 int y1 int r1 int r2 const Stylizer & s

Draw a filled ellipse made of block characters.

x1

the x coordinate of the center of the ellipse.

y1

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

s

the style of the ellipse.

void void DrawBlockEllipseFilled (int x1, int y1, int r1, int r2, const Color &color) DrawBlockEllipseFilled ftxui::Canvas::DrawBlockEllipseFilled int x1 x int y1 y int r1 int r2 const Color & color

Draw a filled ellipse made of block characters.

x

the x coordinate of the center of the ellipse.

y

the y coordinate of the center of the ellipse.

r1

the radius of the ellipse along the x axis.

r2

the radius of the ellipse along the y axis.

color

the color of the ellipse.

void void DrawText (int x, int y, const std::string &value) DrawText ftxui::Canvas::DrawText int x int y const std::string & value

Draw a piece of text.

x

the x coordinate of the text.

y

the y coordinate of the text.

value

the text to draw.

void void DrawText (int x, int y, const std::string &value, const Color &color) DrawText ftxui::Canvas::DrawText int x int y const std::string & value const Color & color

Draw a piece of text.

x

the x coordinate of the text.

y

the y coordinate of the text.

value

the text to draw.

color

the color of the text.

void void DrawText (int x, int y, const std::string &value, const Stylizer &style) DrawText ftxui::Canvas::DrawText int x int y const std::string & value const Stylizer & style

Draw a piece of text.

x

the x coordinate of the text.

y

the y coordinate of the text.

value

the text to draw.

style

the style of the text.

void void DrawPixel (int x, int y, const Pixel &) DrawPixel ftxui::Canvas::DrawPixel int x int y const Pixel & p

Directly draw a predefined pixel at the given coordinate.

x

the x coordinate of the pixel.

y

the y coordinate of the pixel.

p

the pixel to draw.

void void DrawImage (int x, int y, const Image &) DrawImage ftxui::Canvas::DrawImage int x int y const Image & image

Draw a predefined image, with top-left corner at the given coordinate You can supply negative coordinates to align the image however you like - only the 'visible' portion will be drawn.

x

the x coordinate corresponding to the top-left corner of the image.

y

the y coordinate corresponding to the top-left corner of the image.

image

the image to draw.

void void Style (int x, int y, const Stylizer &style) Style ftxui::Canvas::Style int x int y const Stylizer & style

Modify a pixel at a given location.

style

a function that modifies the pixel.

bool bool IsIn (int x, int y) const IsIn ftxui::Canvas::IsIn int x int y
- ftxui::Canvas
  Canvas
- ftxui::Canvas
  Canvas
- ftxui::Canvas
  CellType
- ftxui::Canvas
  DrawBlock
- ftxui::Canvas
  DrawBlock
- ftxui::Canvas
  DrawBlock
- ftxui::Canvas
  DrawBlockCircle
- ftxui::Canvas
  DrawBlockCircle
- ftxui::Canvas
  DrawBlockCircle
- ftxui::Canvas
  DrawBlockCircleFilled
- ftxui::Canvas
  DrawBlockCircleFilled
- ftxui::Canvas
  DrawBlockCircleFilled
- ftxui::Canvas
  DrawBlockEllipse
- ftxui::Canvas
  DrawBlockEllipse
- ftxui::Canvas
  DrawBlockEllipse
- ftxui::Canvas
  DrawBlockEllipseFilled
- ftxui::Canvas
  DrawBlockEllipseFilled
- ftxui::Canvas
  DrawBlockEllipseFilled
- ftxui::Canvas
  DrawBlockLine
- ftxui::Canvas
  DrawBlockLine
- ftxui::Canvas
  DrawBlockLine
- ftxui::Canvas
  DrawBlockOff
- ftxui::Canvas
  DrawBlockOn
- ftxui::Canvas
  DrawBlockToggle
- ftxui::Canvas
  DrawImage
- ftxui::Canvas
  DrawPixel
- ftxui::Canvas
  DrawPoint
- ftxui::Canvas
  DrawPoint
- ftxui::Canvas
  DrawPoint
- ftxui::Canvas
  DrawPointCircle
- ftxui::Canvas
  DrawPointCircle
- ftxui::Canvas
  DrawPointCircle
- ftxui::Canvas
  DrawPointCircleFilled
- ftxui::Canvas
  DrawPointCircleFilled
- ftxui::Canvas
  DrawPointCircleFilled
- ftxui::Canvas
  DrawPointEllipse
- ftxui::Canvas
  DrawPointEllipse
- ftxui::Canvas
  DrawPointEllipse
- ftxui::Canvas
  DrawPointEllipseFilled
- ftxui::Canvas
  DrawPointEllipseFilled
- ftxui::Canvas
  DrawPointEllipseFilled
- ftxui::Canvas
  DrawPointLine
- ftxui::Canvas
  DrawPointLine
- ftxui::Canvas
  DrawPointLine
- ftxui::Canvas
  DrawPointOff
- ftxui::Canvas
  DrawPointOn
- ftxui::Canvas
  DrawPointToggle
- ftxui::Canvas
  DrawText
- ftxui::Canvas
  DrawText
- ftxui::Canvas
  DrawText
- ftxui::Canvas
  GetPixel
- ftxui::Canvas
  height
- ftxui::Canvas
  height_
- ftxui::Canvas
  IsIn
- ftxui::Canvas
  kBlock
- ftxui::Canvas
  kBraille
- ftxui::Canvas
  kCell
- ftxui::Canvas
  storage_
- ftxui::Canvas
  Style
- ftxui::Canvas
  Stylizer
- ftxui::Canvas
  width
- ftxui::Canvas
  width_