2014-10-25 20:27:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2021-10-02 07:13:14 +00:00
|
|
|
#include <base/types.h>
|
2014-10-25 20:27:37 +00:00
|
|
|
|
|
|
|
#define UNICODE_BAR_CHAR_SIZE (strlen("█"))
|
|
|
|
|
|
|
|
|
2017-05-07 20:25:26 +00:00
|
|
|
/** Allows you to draw a unicode-art bar whose width is displayed with a resolution of 1/8 character.
|
2014-10-25 20:27:37 +00:00
|
|
|
*/
|
|
|
|
namespace UnicodeBar
|
|
|
|
{
|
2021-01-02 20:40:15 +00:00
|
|
|
double getWidth(double x, double min, double max, double max_width);
|
2020-09-19 19:15:16 +00:00
|
|
|
size_t getWidthInBytes(double width);
|
2017-04-01 07:20:54 +00:00
|
|
|
|
2017-05-07 20:25:26 +00:00
|
|
|
/// In `dst` there must be a space for barWidthInBytes(width) characters and a trailing zero.
|
2020-09-19 19:15:16 +00:00
|
|
|
void render(double width, char * dst);
|
|
|
|
std::string render(double width);
|
2014-10-25 20:27:37 +00:00
|
|
|
}
|