blob: 2b0b55633a7c08621ca49256ec9c74fe35b1b3df (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#ifndef GENERATEIMAGE_H
#define GENERATEIMAGE_H
#include <QJsonArray>
#include <QString>
#include "diceparser/diceparser.h"
#include "rang.hpp"
class DisplayToolBox
{
public:
enum class Output
{
Svg,
Terminal,
Json,
Image
};
DisplayToolBox();
#ifdef PAINTER_OP
static QString makeImage(QByteArray svgCode);
#endif
static rang::fg colorToIntCode(QString str);
static QString colorToTermCode(QString str);
static QString diceToSvg(QJsonArray array, bool withColor, bool allSameColor, bool allSameFaceCount);
static QString diceResultToString(QJsonObject val, Output type, bool hasColor);
};
#endif // GENERATEIMAGE_H
|