summaryrefslogtreecommitdiff
path: root/apps/plugins/test_greylib_bitmap_scale.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/test_greylib_bitmap_scale.c')
-rw-r--r--apps/plugins/test_greylib_bitmap_scale.c19
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
25PLUGIN_HEADER 31PLUGIN_HEADER
26GREY_INFO_STRUCT 32GREY_INFO_STRUCT
27static unsigned char grey_bm_buf[LCD_WIDTH * LCD_HEIGHT + 33static 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
31static const struct plugin_api* rb; /* global api struct pointer */ 37static const struct plugin_api* rb; /* global api struct pointer */
32 38
39MEM_FUNCTION_WRAPPERS(rb)
40
33/* this is the plugin entry point */ 41/* this is the plugin entry point */
34enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) 42enum 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 {