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