summaryrefslogtreecommitdiff
path: root/apps/plugins/imageviewer/jpeg/yuv2rgb.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/imageviewer/jpeg/yuv2rgb.c')
-rw-r--r--apps/plugins/imageviewer/jpeg/yuv2rgb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/plugins/imageviewer/jpeg/yuv2rgb.c b/apps/plugins/imageviewer/jpeg/yuv2rgb.c
index 5504e425e6..d0d5cb683b 100644
--- a/apps/plugins/imageviewer/jpeg/yuv2rgb.c
+++ b/apps/plugins/imageviewer/jpeg/yuv2rgb.c
@@ -236,15 +236,15 @@ static fb_data (* const pixel_funcs[COLOUR_NUM_MODES][DITHER_NUM_MODES])(void) =
236 [DITHER_DIFFUSION] = pixel_fsdither_to_lcd, 236 [DITHER_DIFFUSION] = pixel_fsdither_to_lcd,
237 }, 237 },
238}; 238};
239 239static fb_data *lcd_fb = NULL;
240/* These defines are used fornormal horizontal strides and vertical strides. */ 240/* These defines are used fornormal horizontal strides and vertical strides. */
241#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 241#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
242#define LCDADDR(x, y) (*rb->lcd_framebuffer + LCD_HEIGHT*(x) + (y)) 242#define LCDADDR(x, y) (lcd_fb + LCD_HEIGHT*(x) + (y))
243#define ROWENDOFFSET (width*LCD_HEIGHT) 243#define ROWENDOFFSET (width*LCD_HEIGHT)
244#define ROWOFFSET (1) 244#define ROWOFFSET (1)
245#define COLOFFSET (LCD_HEIGHT) 245#define COLOFFSET (LCD_HEIGHT)
246#else 246#else
247#define LCDADDR(x, y) (*rb->lcd_framebuffer + LCD_WIDTH*(y) + (x)) 247#define LCDADDR(x, y) (lcd_fb + LCD_WIDTH*(y) + (x))
248#define ROWENDOFFSET (width) 248#define ROWENDOFFSET (width)
249#define ROWOFFSET (LCD_WIDTH) 249#define ROWOFFSET (LCD_WIDTH)
250#define COLOFFSET (1) 250#define COLOFFSET (1)
@@ -261,6 +261,12 @@ void yuv_bitmap_part(unsigned char *src[3], int csub_x, int csub_y,
261 int x, int y, int width, int height, 261 int x, int y, int width, int height,
262 int colour_mode, int dither_mode) 262 int colour_mode, int dither_mode)
263{ 263{
264 if (!lcd_fb)
265 {
266 struct viewport *vp_main = *(rb->screens[SCREEN_MAIN]->current_viewport);
267 lcd_fb = vp_main->buffer->fb_ptr;
268 }
269
264 fb_data *dst, *dst_end; 270 fb_data *dst, *dst_end;
265 fb_data (*pixel_func)(void); 271 fb_data (*pixel_func)(void);
266 struct rgb_pixel px; 272 struct rgb_pixel px;