summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/lib/imagecache.h
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/lib/imagecache.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/lib/imagecache.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/lib/imagecache.h b/noncore/graphics/opie-eye/lib/imagecache.h
new file mode 100644
index 0000000..076ecd3
--- a/dev/null
+++ b/noncore/graphics/opie-eye/lib/imagecache.h
@@ -0,0 +1,46 @@
1/*
2 * GPLv2 zecke@handhelds.org
3 * No WArranty...
4 */
5
6#ifndef PHUNK_IMAGE_CACHE_H
7#define PHUNK_IMAGE_CACHE_H
8
9#include <qimage.h>
10#include <qpixmap.h>
11#include <qcache.h>
12
13
14class PImageCache : public QCache<QImage> {
15private:
16 PImageCache();
17 ~PImageCache();
18
19public:
20 static PImageCache *self();
21 QImage* cachedImage( const QString& path, int orientation = 3, int max = 0); //const;
22 void insertImage( const QString& path, const QImage &, int orien = 3, int max = 0);
23 void insertImage( const QString& path, const QImage *, int orien=3, int max = 0 );
24};
25
26
27class PPixmapCache : public QCache<QPixmap> {
28private:
29 PPixmapCache();
30 ~PPixmapCache();
31public:
32 static PPixmapCache *self();
33 QPixmap* cachedImage( const QString& path, int width, int height );
34 void insertImage( const QString& path, const QPixmap &, int width, int height );
35 void insertImage( const QString& path, const QPixmap *, int width, int height );
36};
37
38inline void PPixmapCache::insertImage( const QString& path, const QPixmap& p, int width, int height ) {
39 insertImage( path, new QPixmap( p ), width, height );
40}
41
42inline void PImageCache::insertImage( const QString& path, const QImage& p, int width, int height ) {
43 insertImage( path, new QImage( p ), width, height );
44}
45
46#endif