diff options
Diffstat (limited to 'apps/plugins/test_greylib_bitmap_scale.c')
-rw-r--r-- | apps/plugins/test_greylib_bitmap_scale.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/plugins/test_greylib_bitmap_scale.c b/apps/plugins/test_greylib_bitmap_scale.c index f8a7bb92cc..3d6f81f91e 100644 --- a/apps/plugins/test_greylib_bitmap_scale.c +++ b/apps/plugins/test_greylib_bitmap_scale.c | |||
@@ -22,6 +22,12 @@ | |||
22 | #include "plugin.h" | 22 | #include "plugin.h" |
23 | #include "lib/grey.h" | 23 | #include "lib/grey.h" |
24 | 24 | ||
25 | #if LCD_DEPTH == 1 | ||
26 | #define BMP_LOAD read_bmp_file | ||
27 | #else | ||
28 | #define BMP_LOAD rb->read_bmp_file | ||
29 | #endif | ||
30 | |||
25 | PLUGIN_HEADER | 31 | PLUGIN_HEADER |
26 | GREY_INFO_STRUCT | 32 | GREY_INFO_STRUCT |
27 | static unsigned char grey_bm_buf[LCD_WIDTH * LCD_HEIGHT + | 33 | 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]; | |||
30 | 36 | ||
31 | static const struct plugin_api* rb; /* global api struct pointer */ | 37 | static const struct plugin_api* rb; /* global api struct pointer */ |
32 | 38 | ||
39 | MEM_FUNCTION_WRAPPERS(rb) | ||
40 | |||
33 | /* this is the plugin entry point */ | 41 | /* this is the plugin entry point */ |
34 | enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) | 42 | enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) |
35 | { | 43 | { |
@@ -47,9 +55,14 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame | |||
47 | 55 | ||
48 | rb->strcpy(filename, parameter); | 56 | rb->strcpy(filename, parameter); |
49 | 57 | ||
50 | ret = rb->read_bmp_file(filename, &grey_bm, sizeof(grey_bm_buf), | 58 | #if LCD_DEPTH == 1 |
51 | FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, | 59 | bmp_init(rb); |
52 | &format_grey); | 60 | resize_init(rb); |
61 | #endif | ||
62 | |||
63 | ret = BMP_LOAD(filename, &grey_bm, sizeof(grey_bm_buf), | ||
64 | FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, | ||
65 | &format_grey); | ||
53 | 66 | ||
54 | if(ret < 1) | 67 | if(ret < 1) |
55 | { | 68 | { |