QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Static Public Member Functions | List of all members
QgsTileCache Class Reference

A simple tile cache implementation. More...

#include <qgstilecache.h>

Static Public Member Functions

static void insertTile (const QUrl &url, const QImage &image)
 Add a tile image with given URL to the cache. More...
 
static int maxCost ()
 how many tiles can be stored in the in-memory cache More...
 
static bool tile (const QUrl &url, QImage &image)
 Try to access a tile and load it into "image" argument. More...
 
static int totalCost ()
 how many tiles are stored in the in-memory cache More...
 

Detailed Description

A simple tile cache implementation.

Tiles are cached according to their URL. There is a small in-memory cache and a secondary caching in the local disk. The in-memory cache is there to save CPU time otherwise wasted to read and uncompress data saved on the disk.

The class is thread safe (its methods can be called from any thread).

Note
Not available in Python bindings
Since
QGIS 3.8.0

Definition at line 40 of file qgstilecache.h.

Member Function Documentation

◆ insertTile()

void QgsTileCache::insertTile ( const QUrl &  url,
const QImage &  image 
)
static

Add a tile image with given URL to the cache.

Definition at line 27 of file qgstilecache.cpp.

◆ maxCost()

static int QgsTileCache::maxCost ( )
inlinestatic

how many tiles can be stored in the in-memory cache

Definition at line 56 of file qgstilecache.h.

◆ tile()

bool QgsTileCache::tile ( const QUrl &  url,
QImage &  image 
)
static

Try to access a tile and load it into "image" argument.

Returns
true if the tile exists in the cache

Definition at line 33 of file qgstilecache.cpp.

◆ totalCost()

static int QgsTileCache::totalCost ( )
inlinestatic

how many tiles are stored in the in-memory cache

Definition at line 54 of file qgstilecache.h.


The documentation for this class was generated from the following files: