aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli/displaytoolbox.h
blob: 5a22b0fce123795da51fedda35c10def0006da31 (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
#ifndef GENERATEIMAGE_H
#define GENERATEIMAGE_H

#include <QJsonArray>
#include <QString>

#include "diceparser/diceparser.h"

class DisplayToolBox
{
public:
    enum class Output
    {
        Svg,
        Terminal,
        Json,
        Image
    };
    DisplayToolBox();
#ifdef PAINTER_OP
    static QString makeImage(QByteArray svgCode);
#endif
    static QString 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