151 QImage svgAsImage(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
152 double widthScaleFactor,
bool &fitsInCache,
double fixedAspectRatio = 0,
bool blocking =
false,
153 const QMap<QString, QString> ¶meters = QMap<QString, QString>() );
177 QPicture svgAsPicture(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
178 double widthScaleFactor,
bool forceVectorOutput =
false,
double fixedAspectRatio = 0,
bool blocking =
false,
179 const QMap<QString, QString> ¶meters = QMap<QString, QString>() );
199 QSizeF svgViewboxSize(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
200 double widthScaleFactor,
double fixedAspectRatio = 0,
bool blocking =
false,
const QMap<QString, QString> ¶meters = QMap<QString, QString>() );
208 void containsParams(
const QString &path,
bool &hasFillParam, QColor &defaultFillColor,
bool &hasStrokeParam, QColor &defaultStrokeColor,
bool &hasStrokeWidthParam,
209 double &defaultStrokeWidth,
bool blocking =
false )
const;
239 void containsParams(
const QString &path,
bool &hasFillParam,
bool &hasDefaultFillParam, QColor &defaultFillColor,
240 bool &hasFillOpacityParam,
bool &hasDefaultFillOpacity,
double &defaultFillOpacity,
241 bool &hasStrokeParam,
bool &hasDefaultStrokeColor, QColor &defaultStrokeColor,
242 bool &hasStrokeWidthParam,
bool &hasDefaultStrokeWidth,
double &defaultStrokeWidth,
243 bool &hasStrokeOpacityParam,
bool &hasDefaultStrokeOpacity,
double &defaultStrokeOpacity,
244 bool blocking =
false )
const SIP_PYNAME( containsParamsV3 );
260 QByteArray getImageData(
const QString &path,
bool blocking =
false )
const;
278 QByteArray svgContent(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
279 double widthScaleFactor,
double fixedAspectRatio = 0,
bool blocking =
false,
const QMap<QString, QString> ¶meters = QMap<QString, QString>(),
bool *isMissingImage =
nullptr );
281 QByteArray svgContent(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
282 double widthScaleFactor,
double fixedAspectRatio = 0,
bool blocking =
false,
const QMap<QString, QString> ¶meters = QMap<QString, QString>() );
301 bool checkReply( QNetworkReply *reply,
const QString &path )
const override;
305 void replaceParamsAndCacheSvg( QgsSvgCacheEntry *entry,
bool blocking =
false );
306 void cacheImage( QgsSvgCacheEntry *entry );
307 void cachePicture( QgsSvgCacheEntry *entry,
bool forceVectorOutput =
false );
309 QgsSvgCacheEntry *cacheEntry(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
310 double widthScaleFactor,
double fixedAspectRatio = 0,
const QMap<QString, QString> ¶meters = QMap<QString, QString>(),
bool blocking =
false,
bool *isMissingImage =
nullptr );
313 void replaceElemParams( QDomElement &elem,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
const QMap<QString, QString> ¶meters );
315 void containsElemParams(
const QDomElement &elem,
316 bool &hasFillParam,
bool &hasDefaultFill, QColor &defaultFill,
317 bool &hasFillOpacityParam,
bool &hasDefaultFillOpacity,
double &defaultFillOpacity,
318 bool &hasStrokeParam,
bool &hasDefaultStroke, QColor &defaultStroke,
319 bool &hasStrokeWidthParam,
bool &hasDefaultStrokeWidth,
double &defaultStrokeWidth,
320 bool &hasStrokeOpacityParam,
bool &hasDefaultStrokeOpacity,
double &defaultStrokeOpacity )
const SIP_PYNAME( containsParamsV3 );
323 double calcSizeScaleFactor( QgsSvgCacheEntry *entry,
const QDomElement &docElem, QSizeF &viewboxSize )
const;
329 QSize sizeForImage(
const QgsSvgCacheEntry &entry, QSizeF &viewBoxSize, QSizeF &scaledSize )
const;
334 QImage imageFromCachedPicture(
const QgsSvgCacheEntry &entry )
const;
337 QByteArray mMissingSvg;
339 QByteArray mFetchingSvg;
341 friend class TestQgsSvgCache;
A QObject derived base class for QgsAbstractContentCache.
Base class for entries in a QgsAbstractContentCache.
virtual int dataSize() const =0
Returns the memory usage in bytes for the entry.
virtual void dump() const =0
Dumps debugging strings containing the item's properties.
QgsAbstractContentCacheEntry & operator=(const QgsAbstractContentCacheEntry &rh)=delete
QgsAbstractContentCacheEntry cannot be copied.
virtual bool isEqual(const QgsAbstractContentCacheEntry *other) const =0
Tests whether this entry matches another entry.
Abstract base class for file content caches, such as SVG or raster image caches.