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

Committer:
embeddedartists
Date:
Fri Oct 03 13:30:09 2014 +0000
Revision:
0:b567d56a59d7
First version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
embeddedartists 0:b567d56a59d7 1
embeddedartists 0:b567d56a59d7 2 #ifndef IMAGE_H
embeddedartists 0:b567d56a59d7 3 #define IMAGE_H
embeddedartists 0:b567d56a59d7 4
embeddedartists 0:b567d56a59d7 5 class Image {
embeddedartists 0:b567d56a59d7 6 public:
embeddedartists 0:b567d56a59d7 7
embeddedartists 0:b567d56a59d7 8 enum Type {
embeddedartists 0:b567d56a59d7 9 BMP = 0,
embeddedartists 0:b567d56a59d7 10 PNG,
embeddedartists 0:b567d56a59d7 11 UNKNOWN
embeddedartists 0:b567d56a59d7 12 };
embeddedartists 0:b567d56a59d7 13
embeddedartists 0:b567d56a59d7 14 typedef struct {
embeddedartists 0:b567d56a59d7 15 uint16_t* pixels;
embeddedartists 0:b567d56a59d7 16 uint32_t width;
embeddedartists 0:b567d56a59d7 17 uint32_t height;
embeddedartists 0:b567d56a59d7 18 } ImageData_t;
embeddedartists 0:b567d56a59d7 19
embeddedartists 0:b567d56a59d7 20 /** Decodes the specified image data
embeddedartists 0:b567d56a59d7 21 *
embeddedartists 0:b567d56a59d7 22 * Note that if this function returns a zero, indicating success,
embeddedartists 0:b567d56a59d7 23 * the pixels member of the pDataOut structure must be
embeddedartists 0:b567d56a59d7 24 * deallocated using lpc_free() when no longer needed.
embeddedartists 0:b567d56a59d7 25 *
embeddedartists 0:b567d56a59d7 26 * @param pDataIn the image data
embeddedartists 0:b567d56a59d7 27 * @param sizeIn the number of bytes in the pDataIn array
embeddedartists 0:b567d56a59d7 28 * @param pDataOut the decoded image (only valid if 0 is returned)
embeddedartists 0:b567d56a59d7 29 *
embeddedartists 0:b567d56a59d7 30 * @returns
embeddedartists 0:b567d56a59d7 31 * 0 on success
embeddedartists 0:b567d56a59d7 32 * 1 on failure
embeddedartists 0:b567d56a59d7 33 */
embeddedartists 0:b567d56a59d7 34 static int decode(const unsigned char* pDataIn, unsigned int sizeIn, ImageData_t* pDataOut);
embeddedartists 0:b567d56a59d7 35
embeddedartists 0:b567d56a59d7 36 private:
embeddedartists 0:b567d56a59d7 37
embeddedartists 0:b567d56a59d7 38 /** No instance needed
embeddedartists 0:b567d56a59d7 39 *
embeddedartists 0:b567d56a59d7 40 */
embeddedartists 0:b567d56a59d7 41 Image();
embeddedartists 0:b567d56a59d7 42
embeddedartists 0:b567d56a59d7 43 static Type imageType(const unsigned char* pDataIn, unsigned int sizeIn);
embeddedartists 0:b567d56a59d7 44 };
embeddedartists 0:b567d56a59d7 45
embeddedartists 0:b567d56a59d7 46 #endif
embeddedartists 0:b567d56a59d7 47
embeddedartists 0:b567d56a59d7 48