QGIS API Documentation
2.6.0-Brighton
|
This class is responsible for keeping cache of rendered images of individual layers. More...
#include <qgsmaprenderercache.h>
Public Member Functions | |
QgsMapRendererCache () | |
void | clear () |
invalidate the cache contents | |
bool | init (QgsRectangle extent, double scale) |
initialize cache: set new parameters and erase cache if parameters have changed | |
void | setCacheImage (QString layerId, const QImage &img) |
set cached image for the specified layer ID | |
QImage | cacheImage (QString layerId) |
get cached image for the specified layer ID. Returns null image if it is not cached. | |
void | clearCacheImage (QString layerId) |
remove layer from the cache |
Protected Slots | |
void | layerRequestedRepaint () |
remove layer (that emitted the signal) from the cache |
Protected Member Functions | |
void | clearInternal () |
invalidate cache contents (without locking) |
Protected Attributes | |
QMutex | mMutex |
QgsRectangle | mExtent |
double | mScale |
QMap< QString, QImage > | mCachedImages |
This class is responsible for keeping cache of rendered images of individual layers.
Once a layer has rendered image stored in the cache (using setCacheImage(...)), the cache listens to repaintRequested() signals from layer. If triggered, the cache removes the rendered image (and disconnects from the layer).
The class is thread-safe (multiple classes can access the same instance safely).
QgsMapRendererCache::QgsMapRendererCache | ( | ) |
QImage QgsMapRendererCache::cacheImage | ( | QString | layerId | ) |
get cached image for the specified layer ID. Returns null image if it is not cached.
void QgsMapRendererCache::clear | ( | ) |
invalidate the cache contents
void QgsMapRendererCache::clearCacheImage | ( | QString | layerId | ) |
remove layer from the cache
|
protected |
invalidate cache contents (without locking)
bool QgsMapRendererCache::init | ( | QgsRectangle | extent, |
double | scale | ||
) |
initialize cache: set new parameters and erase cache if parameters have changed
|
protectedslot |
remove layer (that emitted the signal) from the cache
void QgsMapRendererCache::setCacheImage | ( | QString | layerId, |
const QImage & | img | ||
) |
set cached image for the specified layer ID
|
protected |
|
protected |
|
protected |
|
protected |