148 QImage svgAsImage(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
149 double widthScaleFactor,
bool &fitsInCache,
double fixedAspectRatio = 0,
bool blocking =
false,
150 const QMap<QString, QString> ¶meters = QMap<QString, QString>() );
174 QPicture svgAsPicture(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
175 double widthScaleFactor,
bool forceVectorOutput =
false,
double fixedAspectRatio = 0,
bool blocking =
false,
176 const QMap<QString, QString> ¶meters = QMap<QString, QString>() );
195 QSizeF svgViewboxSize(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
196 double widthScaleFactor,
double fixedAspectRatio = 0,
bool blocking =
false,
const QMap<QString, QString> ¶meters = QMap<QString, QString>() );
204 void containsParams(
const QString &path,
bool &hasFillParam, QColor &defaultFillColor,
bool &hasStrokeParam, QColor &defaultStrokeColor,
bool &hasStrokeWidthParam,
205 double &defaultStrokeWidth,
bool blocking =
false )
const;
234 void containsParams(
const QString &path,
bool &hasFillParam,
bool &hasDefaultFillParam, QColor &defaultFillColor,
235 bool &hasFillOpacityParam,
bool &hasDefaultFillOpacity,
double &defaultFillOpacity,
236 bool &hasStrokeParam,
bool &hasDefaultStrokeColor, QColor &defaultStrokeColor,
237 bool &hasStrokeWidthParam,
bool &hasDefaultStrokeWidth,
double &defaultStrokeWidth,
238 bool &hasStrokeOpacityParam,
bool &hasDefaultStrokeOpacity,
double &defaultStrokeOpacity,
239 bool blocking =
false )
const SIP_PYNAME( containsParamsV3 );
255 QByteArray getImageData(
const QString &path,
bool blocking =
false )
const;
273 QByteArray svgContent(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
274 double widthScaleFactor,
double fixedAspectRatio = 0,
bool blocking =
false,
const QMap<QString, QString> ¶meters = QMap<QString, QString>(),
bool *isMissingImage =
nullptr );
276 QByteArray svgContent(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
277 double widthScaleFactor,
double fixedAspectRatio = 0,
bool blocking =
false,
const QMap<QString, QString> ¶meters = QMap<QString, QString>() );
296 bool checkReply( QNetworkReply *reply,
const QString &path )
const override;
300 void replaceParamsAndCacheSvg( QgsSvgCacheEntry *entry,
bool blocking =
false );
301 void cacheImage( QgsSvgCacheEntry *entry );
302 void cachePicture( QgsSvgCacheEntry *entry,
bool forceVectorOutput =
false );
304 QgsSvgCacheEntry *cacheEntry(
const QString &path,
double size,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
305 double widthScaleFactor,
double fixedAspectRatio = 0,
const QMap<QString, QString> ¶meters = QMap<QString, QString>(),
bool blocking =
false,
bool *isMissingImage =
nullptr );
308 void replaceElemParams( QDomElement &elem,
const QColor &fill,
const QColor &stroke,
double strokeWidth,
const QMap<QString, QString> ¶meters );
310 void containsElemParams(
const QDomElement &elem,
311 bool &hasFillParam,
bool &hasDefaultFill, QColor &defaultFill,
312 bool &hasFillOpacityParam,
bool &hasDefaultFillOpacity,
double &defaultFillOpacity,
313 bool &hasStrokeParam,
bool &hasDefaultStroke, QColor &defaultStroke,
314 bool &hasStrokeWidthParam,
bool &hasDefaultStrokeWidth,
double &defaultStrokeWidth,
315 bool &hasStrokeOpacityParam,
bool &hasDefaultStrokeOpacity,
double &defaultStrokeOpacity )
const SIP_PYNAME( containsParamsV3 );
318 double calcSizeScaleFactor( QgsSvgCacheEntry *entry,
const QDomElement &docElem, QSizeF &viewboxSize )
const;
324 QSize sizeForImage(
const QgsSvgCacheEntry &entry, QSizeF &viewBoxSize, QSizeF &scaledSize )
const;
329 QImage imageFromCachedPicture(
const QgsSvgCacheEntry &entry )
const;
332 QByteArray mMissingSvg;
334 QByteArray mFetchingSvg;
336 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
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.