Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MARY_CAMERA NokiaLCD mbed
Diff: bmp_handler.cpp
- Revision:
- 23:8471197d3096
- Parent:
- 22:d5e24ab4afb7
- Child:
- 28:ef40d40b5d39
--- a/bmp_handler.cpp Tue Mar 11 03:29:01 2014 +0000
+++ b/bmp_handler.cpp Tue Mar 11 07:51:22 2014 +0000
@@ -54,32 +54,28 @@
FILE *fp;
-int open_BMP( char *file_name )
+int open_BMP( char *file_name, int horizontal_size, int vertical_size )
{
#ifdef RGB565_FORMAT
#else
-#if 1
bmp_header bh = {
0x4D42,
- MARY_CAMERA::PIXEL_PER_LINE * MARY_CAMERA::LINE_PER_FRAME * 4 + 54,
+ horizontal_size * vertical_size * 4 + 54,
0,
0,
54,
40,
- MARY_CAMERA::PIXEL_PER_LINE,
- MARY_CAMERA::LINE_PER_FRAME,
+ horizontal_size,
+ vertical_size,
1,
32,
0,
- MARY_CAMERA::PIXEL_PER_LINE * MARY_CAMERA::LINE_PER_FRAME * 4,
+ horizontal_size * vertical_size * 4,
2835,
2835,
0,
0
};
-
- bmp_header *bhp = &bh;
- #endif
#endif
@@ -104,8 +100,7 @@
unsigned long v[ length ];
unsigned long tmp;
- for ( int i = 0; i < length; i++ )
- {
+ for ( int i = 0; i < length; i++ ) {
tmp = p[ i ];
v[ i ] = (tmp & 0x001F) << 3;
v[ i ] |= (tmp & 0x07E0) << 5;