QGIS API Documentation 3.41.0-Master (45a0abf3bec)
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#include <QCache>
21#include <QMutex>
22
23class QImage;
24class QUrl;
25
26#define SIP_NO_FILE
27
40class CORE_EXPORT QgsTileCache
41{
42 public:
43
45 static void insertTile( const QUrl &url, const QImage &image );
46
51 static bool tile( const QUrl &url, QImage &image );
52
54 static int totalCost();
56 static int maxCost();
57
58 private:
60 static QCache<QUrl, QImage> sTileCache;
62 static QMutex sTileCacheMutex;
63};
64
65#endif // QGSTILECACHE_H
A simple tile cache implementation.