summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-09-01 00:57:47 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-09-01 00:57:47 +0000
commite4345365f18667018dd11cd56cf9106e8ec3c346 (patch)
tree8531492033abbe2f69a5c753461009b357d9f1d7
parent8cb5df6a469ab69179ef304b30455925806b7b95 (diff)
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
-rw-r--r--apps/recorder/bmp.c19
-rw-r--r--firmware/SOURCES4
2 files changed, 23 insertions, 0 deletions
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 */