summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/imageviewer/bmp/bmp.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/apps/plugins/imageviewer/bmp/bmp.c b/apps/plugins/imageviewer/bmp/bmp.c
index b96577dbed..e12cb831d6 100644
--- a/apps/plugins/imageviewer/bmp/bmp.c
+++ b/apps/plugins/imageviewer/bmp/bmp.c
@@ -27,10 +27,8 @@
27 27
28#include "../imageviewer.h" 28#include "../imageviewer.h"
29 29
30#ifdef HAVE_LCD_COLOR 30#if defined(HAVE_LCD_COLOR)
31#define resize_bitmap smooth_resize_bitmap 31#define resize_bitmap smooth_resize_bitmap
32#elif defined(USEGSLIB)
33#define resize_bitmap grey_resize_bitmap
34#else 32#else
35#define resize_bitmap simple_resize_bitmap 33#define resize_bitmap simple_resize_bitmap
36#endif 34#endif
@@ -65,38 +63,6 @@ struct bitmap bmp;
65 63
66/************************* Implementation ***************************/ 64/************************* Implementation ***************************/
67 65
68#ifdef USEGSLIB
69/* copied & pasted from lib/pluginlib_bmp.c. */
70static void grey_resize_bitmap(struct bitmap *src, struct bitmap *dst)
71{
72 const int srcw = src->width;
73 const int srch = src->height;
74 const int dstw = dst->width;
75 const int dsth = dst->height;
76 unsigned char *srcd = src->data;
77 unsigned char *dstd = dst->data;
78
79 const long xrstep = ((srcw-1) << 8) / (dstw-1);
80 const long yrstep = ((srch-1) << 8) / (dsth-1);
81 unsigned char *src_row, *dst_row;
82 long xr, yr = 0;
83 int src_x, src_y, dst_x, dst_y;
84 for (dst_y=0; dst_y < dsth; dst_y++)
85 {
86 src_y = (yr >> 8);
87 src_row = &srcd[src_y * srcw];
88 dst_row = &dstd[dst_y * dstw];
89 for (xr=0,dst_x=0; dst_x < dstw; dst_x++)
90 {
91 src_x = (xr >> 8);
92 dst_row[dst_x] = src_row[src_x];
93 xr += xrstep;
94 }
95 yr += yrstep;
96 }
97}
98#endif /* USEGSLIB */
99
100bool img_ext(const char *ext) 66bool img_ext(const char *ext)
101{ 67{
102 if (!ext) 68 if (!ext)