diff options
| author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-04 21:22:05 +0000 |
|---|---|---|
| committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-04 21:22:05 +0000 |
| commit | 4eedc933572605e42f6f2fb00d099fe4a2075032 (patch) | |
| tree | 4e623580b92763369fb824ec725a28b71f9272ef /apps/plugins | |
| parent | b93874fefcb152f5e079366c6bf65df7ebf657fa (diff) | |
| download | rockbox-4eedc933572605e42f6f2fb00d099fe4a2075032.zip rockbox-4eedc933572605e42f6f2fb00d099fe4a2075032.tar.gz rockbox-4eedc933572605e42f6f2fb00d099fe4a2075032.tar.bz2 rockbox-4eedc933572605e42f6f2fb00d099fe4a2075032.tar.xz | |
build a scaling-enabled bitmap loader in pluginlib for mono bitmap targets, and use it in the test greylib scaler plugin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19671 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/lib/SOURCES | 4 | ||||
| -rw-r--r-- | apps/plugins/lib/bmp.c | 2 | ||||
| -rw-r--r-- | apps/plugins/lib/core_bmp.c | 24 | ||||
| -rw-r--r-- | apps/plugins/lib/core_resize.c | 24 | ||||
| -rw-r--r-- | apps/plugins/test_greylib_bitmap_scale.c | 19 |
5 files changed, 70 insertions, 3 deletions
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index d21f21a..c8c1553 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES @@ -4,6 +4,10 @@ fixedpoint.c playback_control.c rgb_hsv.c #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) +#if LCD_DEPTH == 1 +core_bmp.c +core_resize.c +#endif grey_core.c grey_draw.c grey_parm.c diff --git a/apps/plugins/lib/bmp.c b/apps/plugins/lib/bmp.c index a8ebbff..85e996c 100644 --- a/apps/plugins/lib/bmp.c +++ b/apps/plugins/lib/bmp.c @@ -87,6 +87,8 @@ int save_bmp_file( char* filename, struct bitmap *bm, const struct plugin_api* r } #endif +#include "../../recorder/bmp.c" + /** Very simple image scale from src to dst (nearest neighbour). Source and destination dimensions are read from the struct bitmap. diff --git a/apps/plugins/lib/core_bmp.c b/apps/plugins/lib/core_bmp.c new file mode 100644 index 0000000..28d70b1 --- /dev/null +++ b/apps/plugins/lib/core_bmp.c @@ -0,0 +1,24 @@ +/*************************************************************************** +* __________ __ ___. +* Open \______ \ ____ ____ | | _\_ |__ _______ ___ +* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +* \/ \/ \/ \/ \/ +* $Id$ +* +* This is a wrapper for the core bmp.c +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +* KIND, either express or implied. +* +****************************************************************************/ + +#include <plugin.h> +#include "../../recorder/bmp.c" + diff --git a/apps/plugins/lib/core_resize.c b/apps/plugins/lib/core_resize.c new file mode 100644 index 0000000..099d407 --- /dev/null +++ b/apps/plugins/lib/core_resize.c @@ -0,0 +1,24 @@ +/*************************************************************************** +* __________ __ ___. +* Open \______ \ ____ ____ | | _\_ |__ _______ ___ +* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +* \/ \/ \/ \/ \/ +* $Id$ +* +* This is a wrapper for the core bmp.c +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +* KIND, either express or implied. +* +****************************************************************************/ + +#include <plugin.h> +#include "../../recorder/resize.c" + diff --git a/apps/plugins/test_greylib_bitmap_scale.c b/apps/plugins/test_greylib_bitmap_scale.c index f8a7bb9..3d6f81f 100644 --- a/apps/plugins/test_greylib_bitmap_scale.c +++ b/apps/plugins/test_greylib_bitmap_scale.c @@ -22,6 +22,12 @@ #include "plugin.h" #include "lib/grey.h" +#if LCD_DEPTH == 1 +#define BMP_LOAD read_bmp_file +#else +#define BMP_LOAD rb->read_bmp_file +#endif + PLUGIN_HEADER GREY_INFO_STRUCT static unsigned char grey_bm_buf[LCD_WIDTH * LCD_HEIGHT + @@ -30,6 +36,8 @@ static unsigned char grey_display_buf[2*LCD_WIDTH * LCD_HEIGHT]; static const struct plugin_api* rb; /* global api struct pointer */ +MEM_FUNCTION_WRAPPERS(rb) + /* this is the plugin entry point */ enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) { @@ -47,9 +55,14 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame rb->strcpy(filename, parameter); - ret = rb->read_bmp_file(filename, &grey_bm, sizeof(grey_bm_buf), - FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, - &format_grey); +#if LCD_DEPTH == 1 + bmp_init(rb); + resize_init(rb); +#endif + + ret = BMP_LOAD(filename, &grey_bm, sizeof(grey_bm_buf), + FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, + &format_grey); if(ret < 1) { |