summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/lib/imagecache.h
authorzecke <zecke>2004-03-22 23:32:41 (UTC)
committer zecke <zecke>2004-03-22 23:32:41 (UTC)
commit428b687982966dc2efabaf6dbcc55ad0ea30aa10 (patch) (side-by-side diff)
tree86da20abd2e4b97a59dc32e17996bde5ee74cc91 /noncore/graphics/opie-eye/lib/imagecache.h
parent7ce623c6351646ce738a81e103632d73c5454ecc (diff)
downloadopie-428b687982966dc2efabaf6dbcc55ad0ea30aa10.zip
opie-428b687982966dc2efabaf6dbcc55ad0ea30aa10.tar.gz
opie-428b687982966dc2efabaf6dbcc55ad0ea30aa10.tar.bz2
Initial Check in of the Eye Of Zilla. This ImageViewer features
Image Infos, EXIF, Jpeg,Png,Gif support. It supports scaled loading of Jpegs. an smart image cache.... GUI needs some work and we need to find a bug in QCOP as well. TODO: Add Image Service for example Mailer Add ImageCanvas/Zoomer/Display
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 @@
+/*
+ * GPLv2 zecke@handhelds.org
+ * No WArranty...
+ */
+
+#ifndef PHUNK_IMAGE_CACHE_H
+#define PHUNK_IMAGE_CACHE_H
+
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qcache.h>
+
+
+class PImageCache : public QCache<QImage> {
+private:
+ PImageCache();
+ ~PImageCache();
+
+public:
+ static PImageCache *self();
+ QImage* cachedImage( const QString& path, int orientation = 3, int max = 0); //const;
+ void insertImage( const QString& path, const QImage &, int orien = 3, int max = 0);
+ void insertImage( const QString& path, const QImage *, int orien=3, int max = 0 );
+};
+
+
+class PPixmapCache : public QCache<QPixmap> {
+private:
+ PPixmapCache();
+ ~PPixmapCache();
+public:
+ static PPixmapCache *self();
+ QPixmap* cachedImage( const QString& path, int width, int height );
+ void insertImage( const QString& path, const QPixmap &, int width, int height );
+ void insertImage( const QString& path, const QPixmap *, int width, int height );
+};
+
+inline void PPixmapCache::insertImage( const QString& path, const QPixmap& p, int width, int height ) {
+ insertImage( path, new QPixmap( p ), width, height );
+}
+
+inline void PImageCache::insertImage( const QString& path, const QImage& p, int width, int height ) {
+ insertImage( path, new QImage( p ), width, height );
+}
+
+#endif