QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgstilecache.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstilecache.h
3 --------------------------------------
4 Date : September 2016
5 Copyright : (C) 2016 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSTILECACHE_H
17#define QGSTILECACHE_H
18
19#include "qgis_core.h"
20
21#include <QCache>
22#include <QMutex>
23
24class QImage;
25class QUrl;
26
27#define SIP_NO_FILE
28
41class CORE_EXPORT QgsTileCache
42{
43 public:
44
46 static void insertTile( const QUrl &url, const QImage &image );
47
52 static bool tile( const QUrl &url, QImage &image );
53
55 static int totalCost();
57 static int maxCost();
58
59 private:
61 static QCache<QUrl, QImage> sTileCache;
63 static QMutex sTileCacheMutex;
64};
65
66#endif // QGSTILECACHE_H
A simple tile cache implementation.
static bool tile(const QUrl &url, QImage &image)
Try to access a tile and load it into "image" argument.
static int totalCost()
how many tiles are stored in the in-memory cache
static void insertTile(const QUrl &url, const QImage &image)
Add a tile image with given URL to the cache.
static int maxCost()
how many tiles can be stored in the in-memory cache