summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/imageviewer')
-rw-r--r--apps/plugins/imageviewer/bmp/bmp.c2
-rw-r--r--apps/plugins/imageviewer/imageviewer.c22
-rw-r--r--apps/plugins/imageviewer/imageviewer.h8
-rw-r--r--apps/plugins/imageviewer/jpeg/jpeg.c2
4 files changed, 15 insertions, 19 deletions
diff --git a/apps/plugins/imageviewer/bmp/bmp.c b/apps/plugins/imageviewer/bmp/bmp.c
index 1229ac3d35..6b5c4b1759 100644
--- a/apps/plugins/imageviewer/bmp/bmp.c
+++ b/apps/plugins/imageviewer/bmp/bmp.c
@@ -119,7 +119,7 @@ void draw_image_rect(struct image_info *info,
119 y + MAX(0, (LCD_HEIGHT-info->height)/2), 119 y + MAX(0, (LCD_HEIGHT-info->height)/2),
120 width, height); 120 width, height);
121#else 121#else
122 MYXLCD(gray_bitmap_part)( 122 mylcd_ub_gray_bitmap_part(
123 pdisp->bitmap, info->x + x, info->y + y, info->width, 123 pdisp->bitmap, info->x + x, info->y + y, info->width,
124 x + MAX(0, (LCD_WIDTH-info->width)/2), 124 x + MAX(0, (LCD_WIDTH-info->width)/2),
125 y + MAX(0, (LCD_HEIGHT-info->height)/2), 125 y + MAX(0, (LCD_HEIGHT-info->height)/2),
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c
index ed41719cca..0fd25e7b29 100644
--- a/apps/plugins/imageviewer/imageviewer.c
+++ b/apps/plugins/imageviewer/imageviewer.c
@@ -416,10 +416,10 @@ static void pan_view_right(struct image_info *info)
416 move = MIN(HSCROLL, info->width - info->x - LCD_WIDTH); 416 move = MIN(HSCROLL, info->width - info->x - LCD_WIDTH);
417 if (move > 0) 417 if (move > 0)
418 { 418 {
419 MYXLCD(scroll_left)(move); /* scroll left */ 419 mylcd_ub_scroll_left(move); /* scroll left */
420 info->x += move; 420 info->x += move;
421 draw_image_rect(info, LCD_WIDTH - move, 0, move, info->height-info->y); 421 draw_image_rect(info, LCD_WIDTH - move, 0, move, info->height-info->y);
422 MYLCD_UPDATE(); 422 mylcd_ub_update();
423 } 423 }
424} 424}
425 425
@@ -432,10 +432,10 @@ static void pan_view_left(struct image_info *info)
432 move = MIN(HSCROLL, info->x); 432 move = MIN(HSCROLL, info->x);
433 if (move > 0) 433 if (move > 0)
434 { 434 {
435 MYXLCD(scroll_right)(move); /* scroll right */ 435 mylcd_ub_scroll_right(move); /* scroll right */
436 info->x -= move; 436 info->x -= move;
437 draw_image_rect(info, 0, 0, move, info->height-info->y); 437 draw_image_rect(info, 0, 0, move, info->height-info->y);
438 MYLCD_UPDATE(); 438 mylcd_ub_update();
439 } 439 }
440} 440}
441 441
@@ -448,7 +448,7 @@ static void pan_view_up(struct image_info *info)
448 move = MIN(VSCROLL, info->y); 448 move = MIN(VSCROLL, info->y);
449 if (move > 0) 449 if (move > 0)
450 { 450 {
451 MYXLCD(scroll_down)(move); /* scroll down */ 451 mylcd_ub_scroll_down(move); /* scroll down */
452 info->y -= move; 452 info->y -= move;
453#if defined(HAVE_LCD_COLOR) && defined(JPEG_VIEWER) 453#if defined(HAVE_LCD_COLOR) && defined(JPEG_VIEWER)
454 if (settings.jpeg_dither_mode == DITHER_DIFFUSION) 454 if (settings.jpeg_dither_mode == DITHER_DIFFUSION)
@@ -459,7 +459,7 @@ static void pan_view_up(struct image_info *info)
459 } 459 }
460#endif 460#endif
461 draw_image_rect(info, 0, 0, info->width-info->x, move); 461 draw_image_rect(info, 0, 0, info->width-info->x, move);
462 MYLCD_UPDATE(); 462 mylcd_ub_update();
463 } 463 }
464} 464}
465 465
@@ -472,7 +472,7 @@ static void pan_view_down(struct image_info *info)
472 move = MIN(VSCROLL, info->height - info->y - LCD_HEIGHT); 472 move = MIN(VSCROLL, info->height - info->y - LCD_HEIGHT);
473 if (move > 0) 473 if (move > 0)
474 { 474 {
475 MYXLCD(scroll_up)(move); /* scroll up */ 475 mylcd_ub_scroll_up(move); /* scroll up */
476 info->y += move; 476 info->y += move;
477#if defined(HAVE_LCD_COLOR) && defined(JPEG_VIEWER) 477#if defined(HAVE_LCD_COLOR) && defined(JPEG_VIEWER)
478 if (settings.jpeg_dither_mode == DITHER_DIFFUSION) 478 if (settings.jpeg_dither_mode == DITHER_DIFFUSION)
@@ -499,7 +499,7 @@ static void pan_view_down(struct image_info *info)
499 info->y++; 499 info->y++;
500 } 500 }
501#endif 501#endif
502 MYLCD_UPDATE(); 502 mylcd_ub_update();
503 } 503 }
504} 504}
505 505
@@ -611,7 +611,7 @@ static int scroll_bmp(struct image_info *info)
611#else 611#else
612 draw_image_rect(info, 0, 0, 612 draw_image_rect(info, 0, 0,
613 info->width-info->x, info->height-info->y); 613 info->width-info->x, info->height-info->y);
614 MYLCD_UPDATE(); 614 mylcd_ub_update();
615#endif 615#endif
616 break; 616 break;
617 617
@@ -783,10 +783,10 @@ static int load_and_show(char* filename, struct image_info *info)
783 rb->lcd_update(); 783 rb->lcd_update();
784 } 784 }
785 785
786 MYLCD(clear_display)(); 786 mylcd_ub_clear_display();
787 draw_image_rect(info, 0, 0, 787 draw_image_rect(info, 0, 0,
788 info->width-info->x, info->height-info->y); 788 info->width-info->x, info->height-info->y);
789 MYLCD_UPDATE(); 789 mylcd_ub_update();
790 790
791#ifdef USEGSLIB 791#ifdef USEGSLIB
792 grey_show(true); /* switch on greyscale overlay */ 792 grey_show(true); /* switch on greyscale overlay */
diff --git a/apps/plugins/imageviewer/imageviewer.h b/apps/plugins/imageviewer/imageviewer.h
index b704701cda..5f22b03e97 100644
--- a/apps/plugins/imageviewer/imageviewer.h
+++ b/apps/plugins/imageviewer/imageviewer.h
@@ -366,16 +366,12 @@
366#if LCD_DEPTH < 8 366#if LCD_DEPTH < 8
367#define USEGSLIB 367#define USEGSLIB
368#include <lib/grey.h> 368#include <lib/grey.h>
369#define MYLCD(fn) grey_ub_ ## fn
370#define MYLCD_UPDATE()
371#define MYXLCD(fn) grey_ub_ ## fn
372#else 369#else
373#include <lib/xlcd.h> 370#include <lib/xlcd.h>
374#define MYLCD(fn) rb->lcd_ ## fn
375#define MYLCD_UPDATE() rb->lcd_update();
376#define MYXLCD(fn) xlcd_ ## fn
377#endif 371#endif
378 372
373#include <lib/mylcd.h>
374
379/* Min memory allowing us to use the plugin buffer 375/* Min memory allowing us to use the plugin buffer
380 * and thus not stopping the music 376 * and thus not stopping the music
381 * *Very* rough estimation: 377 * *Very* rough estimation:
diff --git a/apps/plugins/imageviewer/jpeg/jpeg.c b/apps/plugins/imageviewer/jpeg/jpeg.c
index b16ec1c4b1..95e493e7ee 100644
--- a/apps/plugins/imageviewer/jpeg/jpeg.c
+++ b/apps/plugins/imageviewer/jpeg/jpeg.c
@@ -94,7 +94,7 @@ void draw_image_rect(struct image_info *info,
94 width, height, 94 width, height,
95 settings.jpeg_colour_mode, settings.jpeg_dither_mode); 95 settings.jpeg_colour_mode, settings.jpeg_dither_mode);
96#else 96#else
97 MYXLCD(gray_bitmap_part)( 97 mylcd_ub_gray_bitmap_part(
98 pdisp->bitmap[0], info->x + x, info->y + y, pdisp->stride, 98 pdisp->bitmap[0], info->x + x, info->y + y, pdisp->stride,
99 x + MAX(0, (LCD_WIDTH-info->width)/2), 99 x + MAX(0, (LCD_WIDTH-info->width)/2),
100 y + MAX(0, (LCD_HEIGHT-info->height)/2), 100 y + MAX(0, (LCD_HEIGHT-info->height)/2),