QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
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
24
#define SIP_NO_FILE
25
26
class
QImage;
27
class
QUrl;
28
29
42
class
CORE_EXPORT
QgsTileCache
43
{
44
public
:
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
QgsTileCache
A simple tile cache implementation.
Definition
qgstilecache.h:43
QgsTileCache::tile
static bool tile(const QUrl &url, QImage &image)
Try to access a tile and load it into "image" argument.
Definition
qgstilecache.cpp:35
QgsTileCache::totalCost
static int totalCost()
how many tiles are stored in the in-memory cache
Definition
qgstilecache.cpp:70
QgsTileCache::insertTile
static void insertTile(const QUrl &url, const QImage &image)
Add a tile image with given URL to the cache.
Definition
qgstilecache.cpp:29
QgsTileCache::maxCost
static int maxCost()
how many tiles can be stored in the in-memory cache
Definition
qgstilecache.cpp:76
Generated on
for QGIS API Documentation by
1.17.0