mirror of
https://github.com/tdulcet/Table-and-Graph-Libs.git
synced 2025-05-07 07:31:20 +08:00
dedicated drawing func
This commit is contained in:
parent
68d18a05cf
commit
950e3391a8
15
graphs.hpp
15
graphs.hpp
@ -763,9 +763,9 @@ namespace graphs
|
|||||||
color_type col_4; // 4-bit color
|
color_type col_4; // 4-bit color
|
||||||
uint8_t col_8; // 8-bit color
|
uint8_t col_8; // 8-bit color
|
||||||
struct {
|
struct {
|
||||||
uint8_t r;
|
uint8_t red;
|
||||||
uint8_t g;
|
uint8_t green;
|
||||||
uint8_t b;
|
uint8_t blue;
|
||||||
} col_24; // 24-bit true color
|
} col_24; // 24-bit true color
|
||||||
};
|
};
|
||||||
enum class ColorBits: uint8_t { e4, e8, e24 };
|
enum class ColorBits: uint8_t { e4, e8, e24 };
|
||||||
@ -804,7 +804,16 @@ namespace graphs
|
|||||||
ColorBits color_type = ColorBits::e4; // bit depth of color representation
|
ColorBits color_type = ColorBits::e4; // bit depth of color representation
|
||||||
bool check = true; // validate sizes for graph draw
|
bool check = true; // validate sizes for graph draw
|
||||||
bool border = false; // draw border around the graph
|
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
|
// print histogram using single data set, optionally drawn on top of existing texture
|
||||||
template <typename T>
|
template <typename T>
|
||||||
auto histogram_experimental(const T &data, const Options &options = {}, const Color &color = {color_red}, Texture &&texture = std::make_unique<Texture::element_type>()) -> Texture&& {
|
auto histogram_experimental(const T &data, const Options &options = {}, const Color &color = {color_red}, Texture &&texture = std::make_unique<Texture::element_type>()) -> Texture&& {
|
||||||
|
Loading…
Reference in New Issue
Block a user