#include <stdio.h>
#include <cmath>
#include <vector>
int main() {
auto c = Canvas(100, 100);
c.DrawText(0, 0, "This is a canvas", [](Pixel& p) {
p.underlined = true;
});
c.DrawPointCircle(30, 50, 20);
c.DrawPointCircleFilled(40, 40, 10);
std::vector<int> ys(100);
for (int x = 0; x < 100; x++)
ys[x] = int(80 + 20 * cos(x * 0.2));
for (int x = 0; x < 99; x++)
c.DrawPointLine(x, ys[x], x + 1, ys[x + 1],
Color::Red);
screen.Print();
getchar();
return 0;
}
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
Dimensions Fit(Element &, bool extend_beyond_screen=false)
Element canvas(ConstRef< Canvas >)
Produce an element from a Canvas, or a reference to a Canvas.
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Element border(Element)
Draw a border around the element.