aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli/displaytoolbox.h
blob: 30b7ba3fc7d330e31c89ca7aab6a08f5736137ef (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.h"

class DisplayToolBox
{
public:
    enum class Output
    {
        Svg,
        Terminal,
        Json,
        Image
    };
    DisplayToolBox();
#ifdef PAINTER_OP
    static QString makeImage(QByteArray svgCode);
#endif
    static QString colorToTermCode(QString str);
    static QString diceToText(QJsonArray array, bool withColor, bool allSameFaceCount, bool allSameColor);
    static QJsonArray diceToJson(QList<ExportedDiceResult>& diceList, bool& allSameFaceCount, bool& allSameColor);
    static QString diceToSvg(QJsonArray array, bool withColor, bool allSameColor, bool allSameFaceCount);
    static QString diceResultToString(QJsonObject val, Output type, bool hasColor);
};

#endif // GENERATEIMAGE_H