forked from andijakl/nfcinteractor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtagimagecache.h
40 lines (33 loc) · 1.09 KB
/
tagimagecache.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Andreas Jakl (andreas.jakl@nokia.com)
**
** Released under Nokia Example Code License.
** See license.txt in the main project folder.
**
****************************************************************************/
#ifndef TAGIMAGECACHE_H
#define TAGIMAGECACHE_H
#include <QDeclarativeImageProvider>
#include <QImage>
#include <QDebug>
/*!
\brief Caches any images found on tags in memory, for retrieval
and display in the QML user interface.
The class is derived from QDeclarativeImageProvider and uses the
QImage operation mode.
*/
class TagImageCache : public QDeclarativeImageProvider
{
public:
TagImageCache();
~TagImageCache();
int addImage(QImage img);
// From QDeclarativeImageProvider interface
QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize);
private:
QList<QImage> m_imageCache;
};
#endif // TAGIMAGECACHE_H