summaryrefslogtreecommitdiff
path: root/glcdgraphics/image.h
diff options
context:
space:
mode:
authorandreas 'randy' weinberger <vdr@smue.org>2010-02-21 19:58:27 +0100
committerandreas 'randy' weinberger <vdr@smue.org>2010-02-21 19:58:27 +0100
commit10ab31fa86dbf9875b5f6baa6ac59fefaaf86be3 (patch)
tree60ad7c856565f03e145b2996d1bb5f9cd64c0532 /glcdgraphics/image.h
downloadgraphlcd-base-10ab31fa86dbf9875b5f6baa6ac59fefaaf86be3.tar.gz
graphlcd-base-10ab31fa86dbf9875b5f6baa6ac59fefaaf86be3.tar.bz2
initial git upload, based on graphlcd-base-0.1.5
Diffstat (limited to 'glcdgraphics/image.h')
-rw-r--r--glcdgraphics/image.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/glcdgraphics/image.h b/glcdgraphics/image.h
new file mode 100644
index 0000000..888d942
--- /dev/null
+++ b/glcdgraphics/image.h
@@ -0,0 +1,58 @@
+/*
+ * GraphLCD graphics library
+ *
+ * image.h - image and animation handling
+ *
+ * based on graphlcd plugin 0.1.1 for the Video Disc Recorder
+ * (c) 2001-2004 Carsten Siebholz <c.siebholz AT t-online.de>
+ *
+ * This file is released under the GNU General Public License. Refer
+ * to the COPYING file distributed with this package.
+ *
+ * (c) 2004 Andreas Regel <andreas.regel AT powarman.de>
+ */
+
+#ifndef _GLCDGRAPHICS_IMAGE_H_
+#define _GLCDGRAPHICS_IMAGE_H_
+
+#include <stdint.h>
+
+#include <vector>
+
+namespace GLCD
+{
+
+class cBitmap;
+
+class cImage
+{
+private:
+ unsigned int width;
+ unsigned int height;
+ unsigned int delay;
+ unsigned int curBitmap;
+ uint64_t lastChange;
+ std::vector <cBitmap *> bitmaps;
+public:
+ cImage();
+ ~cImage();
+
+ unsigned int Width() const { return width; }
+ unsigned int Height() const { return height; }
+ unsigned int Count() const { return bitmaps.size(); }
+ unsigned int Delay() const { return delay; }
+ uint64_t LastChange() const { return lastChange; }
+ void First(uint64_t t) { lastChange = t; curBitmap = 0; }
+ bool Next(uint64_t t) { lastChange = t; curBitmap++; return curBitmap < bitmaps.size(); }
+ void SetWidth(unsigned int Width) { width = Width; }
+ void SetHeight(unsigned int Height) { height = Height; }
+ void SetDelay(unsigned int d) { delay = d; }
+ cBitmap * GetBitmap(unsigned int nr) const;
+ cBitmap * GetBitmap() const;
+ void AddBitmap(cBitmap * Bitmap) { bitmaps.push_back(Bitmap); }
+ void Clear();
+};
+
+} // end of namespace
+
+#endif