From e4345365f18667018dd11cd56cf9106e8ec3c346 Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Tue, 1 Sep 2009 00:57:47 +0000 Subject: [PATCH] Add in BMP loader for vertical stride and include lcd-16bit-vert.c in SOURCES git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22580 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/bmp.c | 19 +++++++++++++++++++ firmware/SOURCES | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index 8fcd8ca92e..9f83748a82 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c @@ -423,6 +423,24 @@ void output_row_8_native(uint32_t row, void * row_in, } #endif /* LCD_PIXELFORMAT */ #elif LCD_DEPTH == 16 +#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE + /* M:Robe 500 */ + fb_data *dest = (fb_data *)ctx->bm->data + row; + int delta = 127; + unsigned r, g, b; + for (col = 0; col < ctx->bm->width; col++) { + if (ctx->dither) + delta = DITHERXDY(col,dy); + r = qp->red; + g = qp->green; + b = (qp++)->blue; + r = (31 * r + (r >> 3) + delta) >> 8; + g = (63 * g + (g >> 2) + delta) >> 8; + b = (31 * b + (b >> 3) + delta) >> 8; + *dest = LCD_RGBPACK_LCD(r, g, b); + dest += ctx->bm->height; + } +#else /* iriver h300, colour iPods, X5 */ fb_data *dest = (fb_data *)ctx->bm->data + fb_width * row; int delta = 127; @@ -438,6 +456,7 @@ void output_row_8_native(uint32_t row, void * row_in, b = (31 * b + (b >> 3) + delta) >> 8; *dest++ = LCD_RGBPACK_LCD(r, g, b); } +#endif #endif /* LCD_DEPTH */ } #endif diff --git a/firmware/SOURCES b/firmware/SOURCES index 6b641a4b2e..ba37745aff 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -89,7 +89,11 @@ drivers/lcd-2bit-vert.c drivers/lcd-2bit-vi.c #endif /* LCD_PIXELFORMAT */ #elif LCD_DEPTH == 16 +#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE +drivers/lcd-16bit-vert.c +#else drivers/lcd-16bit.c +#endif #endif /* LCD_DEPTH */ #endif /* HAVE_LCD_BITMAP */