From 950e3391a8c1a86efc1575287ff1c0ba31f57663 Mon Sep 17 00:00:00 2001 From: Jan Kuhlmann <33833587+M2-TE@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:30:16 +0100 Subject: [PATCH] dedicated drawing func --- graphs.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/graphs.hpp b/graphs.hpp index 8a9be75..172072a 100644 --- a/graphs.hpp +++ b/graphs.hpp @@ -763,9 +763,9 @@ namespace graphs color_type col_4; // 4-bit color uint8_t col_8; // 8-bit color struct { - uint8_t r; - uint8_t g; - uint8_t b; + uint8_t red; + uint8_t green; + uint8_t blue; } col_24; // 24-bit true color }; enum class ColorBits: uint8_t { e4, e8, e24 }; @@ -804,7 +804,16 @@ namespace graphs ColorBits color_type = ColorBits::e4; // bit depth of color representation bool check = true; // validate sizes for graph draw bool border = false; // draw border around the graph + bool draw_immediately = true; // draw graph immediately after creation. otherwise call draw/graph with the returned texture }; + // use a graph texture to draw a graph into the terminal + void graph(Texture& texture, Options &options) { + // TODO + } + // use a graph texture to draw a graph into the terminal + void draw(Texture& texture, Options &options) { + graph(texture, options); + } // print histogram using single data set, optionally drawn on top of existing texture template auto histogram_experimental(const T &data, const Options &options = {}, const Color &color = {color_red}, Texture &&texture = std::make_unique()) -> Texture&& {