Graphical demo for the LPC4088 Experiment Base Board with one of the Display Expansion Kits. This program decodes decodes and shows two png images.

Dependencies:   EALib mbed

Revision:
0:b567d56a59d7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Image.h	Fri Oct 03 13:30:09 2014 +0000
@@ -0,0 +1,48 @@
+
+#ifndef IMAGE_H
+#define IMAGE_H
+
+class Image {
+public:
+
+    enum Type {
+        BMP = 0,
+        PNG,
+        UNKNOWN
+    };
+    
+    typedef struct {
+        uint16_t* pixels;
+        uint32_t  width;
+        uint32_t  height;
+    } ImageData_t;
+
+    /** Decodes the specified image data
+     *
+     *  Note that if this function returns a zero, indicating success,
+     *  the pixels member of the pDataOut structure must be
+     *  deallocated using lpc_free() when no longer needed.
+     *
+     *  @param pDataIn the image data
+     *  @param sizeIn the number of bytes in the pDataIn array
+     *  @param pDataOut the decoded image (only valid if 0 is returned)
+     *
+     *  @returns
+     *       0 on success
+     *       1 on failure
+     */
+    static int decode(const unsigned char* pDataIn, unsigned int sizeIn, ImageData_t* pDataOut);
+
+private:
+
+    /** No instance needed
+     *
+     */
+    Image();
+    
+    static Type imageType(const unsigned char* pDataIn, unsigned int sizeIn);
+};
+
+#endif
+
+