16 #ifndef QGSMAPRENDERERCACHE_H
17 #define QGSMAPRENDERERCACHE_H
19 #include "qgis_core.h"
90 void setCacheImage(
const QString &cacheKey,
const QImage &image,
const QList< QgsMapLayer * > &dependentLayers = QList< QgsMapLayer * >() );
105 void setCacheImageWithParameters(
const QString &cacheKey,
109 const QList< QgsMapLayer * > &dependentLayers = QList< QgsMapLayer * >() );
118 bool hasCacheImage(
const QString &cacheKey )
const;
133 bool hasAnyCacheImage(
const QString &cacheKey,
double minimumScaleThreshold = 0,
double maximumScaleThreshold = 0 )
const;
142 QImage cacheImage(
const QString &cacheKey )
const;
156 QImage transformedCacheImage(
const QString &cacheKey,
const QgsMapToPixel &mtp )
const;
162 QList< QgsMapLayer * > dependentLayers(
const QString &cacheKey )
const;
168 void clearCacheImage(
const QString &cacheKey );
175 void invalidateCacheForLayer(
QgsMapLayer *layer );
179 void layerRequestedRepaint();
183 struct CacheParameters
192 void clearInternal();
195 void dropUnusedConnections();
197 QSet< QgsWeakMapLayerPointer > dependentLayers()
const;
199 mutable QMutex mMutex;
203 double mScale = -1.0;
206 QMap<QString, CacheParameters> mCachedImages;
208 QSet< QgsWeakMapLayerPointer > mConnectedLayers;
212 #endif // QGSMAPRENDERERCACHE_H