diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/lib/SOURCES | 5 | ||||
-rw-r--r-- | apps/plugins/lib/bmp.c | 15 | ||||
-rw-r--r-- | apps/plugins/lib/bmp.h | 5 | ||||
-rw-r--r-- | apps/plugins/lib/resize.c (renamed from apps/plugins/lib/core_resize.c) | 12 | ||||
-rw-r--r-- | apps/plugins/lib/resize.h (renamed from apps/plugins/lib/core_bmp.c) | 13 | ||||
-rw-r--r-- | apps/plugins/lib/wrappers.h | 44 | ||||
-rw-r--r-- | apps/plugins/test_greylib_bitmap_scale.c | 2 |
7 files changed, 88 insertions, 8 deletions
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index c8c1553dc8..b28878cffc 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES | |||
@@ -5,8 +5,7 @@ playback_control.c | |||
5 | rgb_hsv.c | 5 | rgb_hsv.c |
6 | #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) | 6 | #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) |
7 | #if LCD_DEPTH == 1 | 7 | #if LCD_DEPTH == 1 |
8 | core_bmp.c | 8 | resize.c |
9 | core_resize.c | ||
10 | #endif | 9 | #endif |
11 | grey_core.c | 10 | grey_core.c |
12 | grey_draw.c | 11 | grey_draw.c |
@@ -34,9 +33,7 @@ picture.c | |||
34 | xlcd_core.c | 33 | xlcd_core.c |
35 | xlcd_draw.c | 34 | xlcd_draw.c |
36 | xlcd_scroll.c | 35 | xlcd_scroll.c |
37 | #if LCD_DEPTH>1 | ||
38 | bmp.c | 36 | bmp.c |
39 | #endif | ||
40 | #ifdef HAVE_LCD_COLOR | 37 | #ifdef HAVE_LCD_COLOR |
41 | bmp_smooth_scale.c | 38 | bmp_smooth_scale.c |
42 | #endif | 39 | #endif |
diff --git a/apps/plugins/lib/bmp.c b/apps/plugins/lib/bmp.c index a8ebbffc27..b3e0e2b948 100644 --- a/apps/plugins/lib/bmp.c +++ b/apps/plugins/lib/bmp.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2006 by Antoine Cellerier <dionoea -at- videolan -dot- org> | 10 | * Copyright (C) 2006 by Antoine Cellerier <dionoea -at- videolan -dot- org> |
11 | * Copyright (C) 2009 by Andrew Mahone | ||
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it and/or | 13 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 14 | * modify it under the terms of the GNU General Public License |
@@ -26,6 +27,7 @@ | |||
26 | #include "lcd.h" | 27 | #include "lcd.h" |
27 | #include "system.h" | 28 | #include "system.h" |
28 | 29 | ||
30 | #if LCD_DEPTH > 1 | ||
29 | #ifdef HAVE_LCD_COLOR | 31 | #ifdef HAVE_LCD_COLOR |
30 | #define LE16(x) (htole16(x))&0xff, ((htole16(x))>>8)&0xff | 32 | #define LE16(x) (htole16(x))&0xff, ((htole16(x))>>8)&0xff |
31 | #define LE32(x) (htole32(x))&0xff, ((htole32(x))>>8)&0xff, ((htole32(x))>>16)&0xff, ((htole32(x))>>24)&0xff | 33 | #define LE32(x) (htole32(x))&0xff, ((htole32(x))>>8)&0xff, ((htole32(x))>>16)&0xff, ((htole32(x))>>24)&0xff |
@@ -119,3 +121,16 @@ void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst) | |||
119 | yr += yrstep; | 121 | yr += yrstep; |
120 | } | 122 | } |
121 | } | 123 | } |
124 | |||
125 | #else | ||
126 | #include "wrappers.h" | ||
127 | |||
128 | static const struct plugin_api *rb; | ||
129 | |||
130 | #include "../../recorder/bmp.c" | ||
131 | |||
132 | void bmp_init(const struct plugin_api *api) | ||
133 | { | ||
134 | rb = api; | ||
135 | } | ||
136 | #endif | ||
diff --git a/apps/plugins/lib/bmp.h b/apps/plugins/lib/bmp.h index 12894f7551..379a889994 100644 --- a/apps/plugins/lib/bmp.h +++ b/apps/plugins/lib/bmp.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "lcd.h" | 24 | #include "lcd.h" |
25 | #include "plugin.h" | 25 | #include "plugin.h" |
26 | 26 | ||
27 | #if LCD_DEPTH > 1 | ||
27 | #ifdef HAVE_LCD_COLOR | 28 | #ifdef HAVE_LCD_COLOR |
28 | /** | 29 | /** |
29 | * Save bitmap to file | 30 | * Save bitmap to file |
@@ -43,4 +44,8 @@ void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst); | |||
43 | */ | 44 | */ |
44 | void smooth_resize_bitmap(struct bitmap *src, struct bitmap *dst); | 45 | void smooth_resize_bitmap(struct bitmap *src, struct bitmap *dst); |
45 | 46 | ||
47 | #else | ||
48 | void bmp_init(const struct plugin_api *api); | ||
49 | #endif | ||
50 | |||
46 | #endif | 51 | #endif |
diff --git a/apps/plugins/lib/core_resize.c b/apps/plugins/lib/resize.c index 099d4079ed..28446e75a7 100644 --- a/apps/plugins/lib/core_resize.c +++ b/apps/plugins/lib/resize.c | |||
@@ -7,7 +7,9 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * This is a wrapper for the core bmp.c | 10 | * Copyright (C) 2009 by Andrew Mahone |
11 | * | ||
12 | * This is a wrapper for the core resize.c | ||
11 | * | 13 | * |
12 | * This program is free software; you can redistribute it and/or | 14 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 15 | * modify it under the terms of the GNU General Public License |
@@ -20,5 +22,13 @@ | |||
20 | ****************************************************************************/ | 22 | ****************************************************************************/ |
21 | 23 | ||
22 | #include <plugin.h> | 24 | #include <plugin.h> |
25 | #include "wrappers.h" | ||
26 | |||
27 | static const struct plugin_api *rb; | ||
28 | |||
23 | #include "../../recorder/resize.c" | 29 | #include "../../recorder/resize.c" |
24 | 30 | ||
31 | void resize_init(const struct plugin_api *api) | ||
32 | { | ||
33 | rb = api; | ||
34 | } | ||
diff --git a/apps/plugins/lib/core_bmp.c b/apps/plugins/lib/resize.h index 28d70b1bb8..3674e140c3 100644 --- a/apps/plugins/lib/core_bmp.c +++ b/apps/plugins/lib/resize.h | |||
@@ -7,7 +7,9 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * This is a wrapper for the core bmp.c | 10 | * Copyright (C) 2009 by Andrew Mahone |
11 | * | ||
12 | * This is a header for the pluginlib extensions to the core resize.c file | ||
11 | * | 13 | * |
12 | * This program is free software; you can redistribute it and/or | 14 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 15 | * modify it under the terms of the GNU General Public License |
@@ -19,6 +21,11 @@ | |||
19 | * | 21 | * |
20 | ****************************************************************************/ | 22 | ****************************************************************************/ |
21 | 23 | ||
22 | #include <plugin.h> | 24 | #ifndef _LIB_RESIZE_H_ |
23 | #include "../../recorder/bmp.c" | 25 | #define _LIB_RESIZE_H_ |
26 | |||
27 | #if LCD_DEPTH == 1 | ||
28 | void resize_init(const struct plugin_api *api); | ||
29 | #endif | ||
24 | 30 | ||
31 | #endif | ||
diff --git a/apps/plugins/lib/wrappers.h b/apps/plugins/lib/wrappers.h new file mode 100644 index 0000000000..2eb4ea025e --- /dev/null +++ b/apps/plugins/lib/wrappers.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Andrew Mahone | ||
11 | * | ||
12 | * This header redefines some core functions as calls via the plugin_api, to | ||
13 | * allow easy compilation of core source files in the pluginlib with different | ||
14 | * features from the version built for the core, or when a core object file is | ||
15 | * not built for a particular target. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or | ||
18 | * modify it under the terms of the GNU General Public License | ||
19 | * as published by the Free Software Foundation; either version 2 | ||
20 | * of the License, or (at your option) any later version. | ||
21 | * | ||
22 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
23 | * KIND, either express or implied. | ||
24 | * | ||
25 | ****************************************************************************/ | ||
26 | |||
27 | #ifndef _LIB_WRAPPERS_H_ | ||
28 | #define _LIB_WRAPPERS_H_ | ||
29 | |||
30 | #define open rb->open | ||
31 | #define close rb->close | ||
32 | #define read rb->read | ||
33 | #define lseek rb->lseek | ||
34 | #define memset rb->memset | ||
35 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
36 | #define cpu_boost rb->cpu_boost | ||
37 | #endif | ||
38 | #define yield rb->yield | ||
39 | #if CONFIG_CODEC == SWCODEC | ||
40 | #define align_buffer rb->align_buffer | ||
41 | #endif | ||
42 | |||
43 | #endif | ||
44 | |||
diff --git a/apps/plugins/test_greylib_bitmap_scale.c b/apps/plugins/test_greylib_bitmap_scale.c index 3d6f81f91e..a3de006e05 100644 --- a/apps/plugins/test_greylib_bitmap_scale.c +++ b/apps/plugins/test_greylib_bitmap_scale.c | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | #include "plugin.h" | 22 | #include "plugin.h" |
23 | #include "lib/grey.h" | 23 | #include "lib/grey.h" |
24 | #include "lib/resize.h" | ||
25 | #include "lib/bmp.h" | ||
24 | 26 | ||
25 | #if LCD_DEPTH == 1 | 27 | #if LCD_DEPTH == 1 |
26 | #define BMP_LOAD read_bmp_file | 28 | #define BMP_LOAD read_bmp_file |