summaryrefslogtreecommitdiff
path: root/apps/plugins/pictureflow.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pictureflow.c')
-rw-r--r--apps/plugins/pictureflow.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/apps/plugins/pictureflow.c b/apps/plugins/pictureflow.c
index b78b953f13..7261d7a402 100644
--- a/apps/plugins/pictureflow.c
+++ b/apps/plugins/pictureflow.c
@@ -634,13 +634,43 @@ static void output_row_transposed(uint32_t row, void * row_in,
634#endif 634#endif
635} 635}
636 636
637#ifdef HAVE_LCD_COLOR
638static void output_row_transposed_fromyuv(uint32_t row, void * row_in,
639 struct scaler_context *ctx)
640{
641 pix_t *dest = (pix_t*)ctx->bm->data + row;
642 pix_t *end = dest + ctx->bm->height * ctx->bm->width;
643 struct uint32_rgb *qp = (struct uint32_rgb*)row_in;
644 for (; dest < end; dest += ctx->bm->height)
645 {
646 unsigned r, g, b, y, u, v;
647 y = SC_MUL(qp->b + ctx->round, ctx->divisor);
648 u = SC_MUL(qp->g + ctx->round, ctx->divisor);
649 v = SC_MUL(qp->r + ctx->round, ctx->divisor);
650 qp++;
651 yuv_to_rgb(y, u, v, &r, &g, &b);
652 r = (31 * r + (r >> 3) + 127) >> 8;
653 g = (63 * g + (g >> 2) + 127) >> 8;
654 b = (31 * b + (b >> 3) + 127) >> 8;
655 *dest = LCD_RGBPACK_LCD(r, g, b);
656 }
657}
658#endif
659
637static unsigned int get_size(struct bitmap *bm) 660static unsigned int get_size(struct bitmap *bm)
638{ 661{
639 return bm->width * bm->height * sizeof(pix_t); 662 return bm->width * bm->height * sizeof(pix_t);
640} 663}
641 664
642const struct custom_format format_transposed = { 665const struct custom_format format_transposed = {
666#ifdef HAVE_LCD_COLOR
667 .output_row = {
668 output_row_transposed,
669 output_row_transposed_fromyuv
670 },
671#else
643 .output_row = output_row_transposed, 672 .output_row = output_row_transposed,
673#endif
644 .get_size = get_size 674 .get_size = get_size
645}; 675};
646 676