File indexing completed on 2024-05-12 05:39:25
0001 #ifndef GENERATEIMAGE_H 0002 #define GENERATEIMAGE_H 0003 0004 #include <QJsonArray> 0005 #include <QString> 0006 0007 #include "diceparser/diceparser.h" 0008 0009 class DisplayToolBox 0010 { 0011 public: 0012 enum class Output 0013 { 0014 Svg, 0015 Terminal, 0016 Json, 0017 Image 0018 }; 0019 DisplayToolBox(); 0020 #ifdef PAINTER_OP 0021 static QString makeImage(QByteArray svgCode); 0022 #endif 0023 static QString colorToIntCode(QString str); 0024 static QString colorToTermCode(QString str); 0025 static QString diceToSvg(QJsonArray array, bool withColor, bool allSameColor, bool allSameFaceCount); 0026 static QString diceResultToString(QJsonObject val, Output type, bool hasColor); 0027 }; 0028 0029 #endif // GENERATEIMAGE_H