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 * ATMEL Microcontroller Software Support - ROUSSET -
embeddedartists 0:b567d56a59d7 3 * ----------------------------------------------------------------------------
embeddedartists 0:b567d56a59d7 4 * Copyright (c) 2006, Atmel Corporation
embeddedartists 0:b567d56a59d7 5
embeddedartists 0:b567d56a59d7 6 * All rights reserved.
embeddedartists 0:b567d56a59d7 7 *
embeddedartists 0:b567d56a59d7 8 * Redistribution and use in source and binary forms, with or without
embeddedartists 0:b567d56a59d7 9 * modification, are permitted provided that the following conditions are met:
embeddedartists 0:b567d56a59d7 10 *
embeddedartists 0:b567d56a59d7 11 * - Redistributions of source code must retain the above copyright notice,
embeddedartists 0:b567d56a59d7 12 * this list of conditions and the disclaiimer below.
embeddedartists 0:b567d56a59d7 13 *
embeddedartists 0:b567d56a59d7 14 * - Redistributions in binary form must reproduce the above copyright notice,
embeddedartists 0:b567d56a59d7 15 * this list of conditions and the disclaimer below in the documentation and/or
embeddedartists 0:b567d56a59d7 16 * other materials provided with the distribution.
embeddedartists 0:b567d56a59d7 17 *
embeddedartists 0:b567d56a59d7 18 * Atmel's name may not be used to endorse or promote products derived from
embeddedartists 0:b567d56a59d7 19 * this software without specific prior written permission.
embeddedartists 0:b567d56a59d7 20 *
embeddedartists 0:b567d56a59d7 21 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
embeddedartists 0:b567d56a59d7 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
embeddedartists 0:b567d56a59d7 23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
embeddedartists 0:b567d56a59d7 24 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
embeddedartists 0:b567d56a59d7 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
embeddedartists 0:b567d56a59d7 26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
embeddedartists 0:b567d56a59d7 27 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
embeddedartists 0:b567d56a59d7 28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
embeddedartists 0:b567d56a59d7 29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
embeddedartists 0:b567d56a59d7 30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
embeddedartists 0:b567d56a59d7 31 * ----------------------------------------------------------------------------
embeddedartists 0:b567d56a59d7 32 */
embeddedartists 0:b567d56a59d7 33
embeddedartists 0:b567d56a59d7 34 #ifndef BMP_H
embeddedartists 0:b567d56a59d7 35 #define BMP_H
embeddedartists 0:b567d56a59d7 36
embeddedartists 0:b567d56a59d7 37 //------------------------------------------------------------------------------
embeddedartists 0:b567d56a59d7 38 // Exported types
embeddedartists 0:b567d56a59d7 39 //------------------------------------------------------------------------------
embeddedartists 0:b567d56a59d7 40
embeddedartists 0:b567d56a59d7 41 struct BMPHeader {
embeddedartists 0:b567d56a59d7 42
embeddedartists 0:b567d56a59d7 43 unsigned short type;
embeddedartists 0:b567d56a59d7 44 unsigned int fileSize;
embeddedartists 0:b567d56a59d7 45 unsigned short reserved1;
embeddedartists 0:b567d56a59d7 46 unsigned short reserved2;
embeddedartists 0:b567d56a59d7 47 unsigned int offset;
embeddedartists 0:b567d56a59d7 48 unsigned int headerSize;
embeddedartists 0:b567d56a59d7 49 unsigned int width;
embeddedartists 0:b567d56a59d7 50 unsigned int height;
embeddedartists 0:b567d56a59d7 51 unsigned short planes;
embeddedartists 0:b567d56a59d7 52 unsigned short bits;
embeddedartists 0:b567d56a59d7 53 unsigned int compression;
embeddedartists 0:b567d56a59d7 54 unsigned int imageSize;
embeddedartists 0:b567d56a59d7 55 unsigned int xresolution;
embeddedartists 0:b567d56a59d7 56 unsigned int yresolution;
embeddedartists 0:b567d56a59d7 57 unsigned int ncolours;
embeddedartists 0:b567d56a59d7 58 unsigned int importantcolours;
embeddedartists 0:b567d56a59d7 59
embeddedartists 0:b567d56a59d7 60 } __attribute__ ((packed));
embeddedartists 0:b567d56a59d7 61
embeddedartists 0:b567d56a59d7 62 //------------------------------------------------------------------------------
embeddedartists 0:b567d56a59d7 63 // Exported functions
embeddedartists 0:b567d56a59d7 64 //------------------------------------------------------------------------------
embeddedartists 0:b567d56a59d7 65
embeddedartists 0:b567d56a59d7 66 extern unsigned char BMP_IsValid(void *file);
embeddedartists 0:b567d56a59d7 67
embeddedartists 0:b567d56a59d7 68 extern unsigned int BMP_GetFileSize(void *file);
embeddedartists 0:b567d56a59d7 69
embeddedartists 0:b567d56a59d7 70 extern unsigned char BMP_Decode(
embeddedartists 0:b567d56a59d7 71 void *file,
embeddedartists 0:b567d56a59d7 72 unsigned char *buffer,
embeddedartists 0:b567d56a59d7 73 unsigned int width,
embeddedartists 0:b567d56a59d7 74 unsigned int height,
embeddedartists 0:b567d56a59d7 75 unsigned char bpp);
embeddedartists 0:b567d56a59d7 76
embeddedartists 0:b567d56a59d7 77 #endif //#ifndef BMP_H
embeddedartists 0:b567d56a59d7 78
embeddedartists 0:b567d56a59d7 79
embeddedartists 0:b567d56a59d7 80