16 #ifndef QGSMAPBOXGLSTYLECONVERTER_H
17 #define QGSMAPBOXGLSTYLECONVERTER_H
19 #include "qgis_core.h"
22 #include <QVariantMap>
43 void pushWarning(
const QString &warning );
48 QStringList
warnings()
const {
return mWarnings; }
90 double pixelSizeConversionFactor()
const;
98 void setPixelSizeConversionFactor(
double sizeConversionFactor );
106 QImage spriteImage()
const;
114 QVariantMap spriteDefinitions()
const;
122 void setSprites(
const QImage &image,
const QVariantMap &definitions );
130 void setSprites(
const QImage &image,
const QString &definitions );
137 QString layerId()
const;
144 void setLayerId(
const QString &value );
148 QStringList mWarnings;
154 double mSizeConversionFactor = 1.0;
157 QVariantMap mSpriteDefinitions;
304 static void parseSymbolLayer(
const QVariantMap &jsonLayer,
321 static bool parseSymbolLayerAsRenderer(
const QVariantMap &jsonLayer,
354 static QgsProperty parseInterpolateOpacityByZoom(
const QVariantMap &json,
int maxOpacity );
362 static QString parseOpacityStops(
double base,
const QVariantList &stops,
int maxOpacity );
379 const QVariantMap &conversionMap,
380 QString *defaultString
SIP_OUT =
nullptr );
412 const QVariantMap &conversionMap,
413 QString *defaultString
SIP_OUT =
nullptr );
422 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
431 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
439 int maxOpacity = 255, QColor *defaultColor
SIP_OUT =
nullptr,
double *defaultNumber
SIP_OUT =
nullptr );
464 static void colorAsHslaComponents(
const QColor &color,
int &hue,
int &saturation,
int &lightness,
int &alpha );
472 static QString interpolateExpression(
double zoomMin,
double zoomMax,
double valueMin,
double valueMax,
double base,
double multiplier = 1 );
479 static Qt::PenCapStyle parseCapStyle(
const QString &style );
486 static Qt::PenJoinStyle parseJoinStyle(
const QString &style );
509 static QString retrieveSpriteAsBase64(
const QVariant &value,
QgsMapBoxGlStyleConversionContext &context, QSize &spriteSize, QString &spriteProperty, QString &spriteSizeProperty );
518 static QString parseKey(
const QVariant &value );
521 QStringList mWarnings;
523 std::unique_ptr< QgsVectorTileRenderer > mRenderer;
524 std::unique_ptr< QgsVectorTileLabeling > mLabeling;
528 #endif // QGSMAPBOXGLSTYLECONVERTER_H