Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: widgets/EAImage.h
- Revision:
- 0:839ecbf5cb2a
- Child:
- 1:f04bcaea1d60
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/widgets/EAImage.h Thu Feb 11 12:21:18 2010 +0000
@@ -0,0 +1,53 @@
+// Copyright 2010 Richard Parker
+
+#ifndef MBED_EAIMAGE_H
+#define MBED_EAIMAGE_H
+
+#include "mbed.h"
+
+#include "EAWidget.h"
+
+class EALCD;
+
+/**
+ * Class to handle loading and displaying an image.
+ * @author Richard Parker
+ */
+class EAImage: public EAWidget
+{
+public:
+ EAImage();
+ ~EAImage();
+
+ bool load(const char* path);
+
+ inline const char* path() const { return _path; }
+
+ inline bool isValid() const { return (_path != NULL); }
+
+ virtual void paint(EALCD& lcd);
+ virtual void paint(EALCD& lcd, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
+
+private:
+ struct EABMPHeader {
+ unsigned int headerSize;
+ unsigned int width;
+ unsigned int height;
+ unsigned short noColorPlanes;
+ unsigned short bitsPerPixel;
+ unsigned int compressionType;
+ unsigned int bmpSize;
+ unsigned int horizontalRes;
+ unsigned int verticalRes;
+ unsigned int noColors;
+ unsigned int noImportantColors;
+ };
+
+ char* _path;
+ unsigned int _dataOffset;
+
+ bool _loadHeader(const char* path);
+
+};
+
+#endif
\ No newline at end of file