summaryrefslogtreecommitdiff
path: root/apps/plugins/pictureflow/pictureflow.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pictureflow/pictureflow.c')
-rw-r--r--apps/plugins/pictureflow/pictureflow.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 82dc9748ec..6dd034c9a9 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -607,7 +607,29 @@ static inline uint32_t div255(uint32_t val)
607 607
608#define SCALE_VAL(val,out) div255((val) * (out) + 127) 608#define SCALE_VAL(val,out) div255((val) * (out) + 127)
609 609
610static void output_row_transposed(uint32_t row, void * row_in, 610static void output_row_8_transposed(uint32_t row, void * row_in,
611 struct scaler_context *ctx)
612{
613 pix_t *dest = (pix_t*)ctx->bm->data + row;
614 pix_t *end = dest + ctx->bm->height * ctx->bm->width;
615#ifdef USEGSLIB
616 uint8_t *qp = (uint8_t*)row_in;
617 for (; dest < end; dest += ctx->bm->height)
618 *dest = *qp++;
619#else
620 struct uint8_rgb *qp = (struct uint8_rgb*)row_in;
621 unsigned r, g, b;
622 for (; dest < end; dest += ctx->bm->height)
623 {
624 r = qp->red;
625 g = qp->green;
626 b = (qp++)->blue;
627 *dest = LCD_RGBPACK_LCD(r,g,b);
628 }
629#endif
630}
631
632static void output_row_32_transposed(uint32_t row, void * row_in,
611 struct scaler_context *ctx) 633 struct scaler_context *ctx)
612{ 634{
613 pix_t *dest = (pix_t*)ctx->bm->data + row; 635 pix_t *dest = (pix_t*)ctx->bm->data + row;
@@ -635,7 +657,7 @@ static void output_row_transposed(uint32_t row, void * row_in,
635} 657}
636 658
637#ifdef HAVE_LCD_COLOR 659#ifdef HAVE_LCD_COLOR
638static void output_row_transposed_fromyuv(uint32_t row, void * row_in, 660static void output_row_32_transposed_fromyuv(uint32_t row, void * row_in,
639 struct scaler_context *ctx) 661 struct scaler_context *ctx)
640{ 662{
641 pix_t *dest = (pix_t*)ctx->bm->data + row; 663 pix_t *dest = (pix_t*)ctx->bm->data + row;
@@ -663,13 +685,14 @@ static unsigned int get_size(struct bitmap *bm)
663} 685}
664 686
665const struct custom_format format_transposed = { 687const struct custom_format format_transposed = {
688 .output_row_8 = output_row_8_transposed,
666#ifdef HAVE_LCD_COLOR 689#ifdef HAVE_LCD_COLOR
667 .output_row = { 690 .output_row_32 = {
668 output_row_transposed, 691 output_row_32_transposed,
669 output_row_transposed_fromyuv 692 output_row_32_transposed_fromyuv
670 }, 693 },
671#else 694#else
672 .output_row = output_row_transposed, 695 .output_row_32 = output_row_32_transposed,
673#endif 696#endif
674 .get_size = get_size 697 .get_size = get_size
675}; 698};