Graphical demo for the LPC4088 Experiment Base Board with one of the Display Expansion Kits. This demo shows a rotating 3D cube with and without textures.

Dependencies:   EALib mbed

Committer:
embeddedartists
Date:
Fri Oct 03 12:48:37 2014 +0000
Revision:
0:c828045bbe69
First version.

Who changed what in which revision?

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