diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/bench_mem_jpeg.c | 5 | ||||
-rw-r--r-- | apps/plugins/lib/grey_draw.c | 13 | ||||
-rw-r--r-- | apps/plugins/lib/pluginlib_bmp.c | 7 | ||||
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 35 |
4 files changed, 43 insertions, 17 deletions
diff --git a/apps/plugins/bench_mem_jpeg.c b/apps/plugins/bench_mem_jpeg.c index 958e5208e8..cd7dea356e 100644 --- a/apps/plugins/bench_mem_jpeg.c +++ b/apps/plugins/bench_mem_jpeg.c | |||
@@ -42,13 +42,14 @@ static void output_row_null(uint32_t row, void * row_in, | |||
42 | } | 42 | } |
43 | 43 | ||
44 | const struct custom_format format_null = { | 44 | const struct custom_format format_null = { |
45 | .output_row_8 = output_row_null, | ||
45 | #ifdef HAVE_LCD_COLOR | 46 | #ifdef HAVE_LCD_COLOR |
46 | .output_row = { | 47 | .output_row_32 = { |
47 | output_row_null, | 48 | output_row_null, |
48 | output_row_null | 49 | output_row_null |
49 | }, | 50 | }, |
50 | #else | 51 | #else |
51 | .output_row = output_row_null, | 52 | .output_row_32 = output_row_null, |
52 | #endif | 53 | #endif |
53 | .get_size = get_size_null | 54 | .get_size = get_size_null |
54 | }; | 55 | }; |
diff --git a/apps/plugins/lib/grey_draw.c b/apps/plugins/lib/grey_draw.c index 65f2211b7f..6315ad9b1a 100644 --- a/apps/plugins/lib/grey_draw.c +++ b/apps/plugins/lib/grey_draw.c | |||
@@ -719,7 +719,15 @@ void grey_ub_gray_bitmap(const unsigned char *src, int x, int y, int width, | |||
719 | grey_ub_gray_bitmap_part(src, 0, 0, width, x, y, width, height); | 719 | grey_ub_gray_bitmap_part(src, 0, 0, width, x, y, width, height); |
720 | } | 720 | } |
721 | 721 | ||
722 | static void output_row_grey(uint32_t row, void * row_in, struct scaler_context *ctx) | 722 | static void output_row_grey_8(uint32_t row, void * row_in, |
723 | struct scaler_context *ctx) | ||
724 | { | ||
725 | uint8_t *dest = (uint8_t*)ctx->bm->data + ctx->bm->width * row; | ||
726 | rb->memcpy(dest, row_in, ctx->bm->width); | ||
727 | } | ||
728 | |||
729 | static void output_row_grey_32(uint32_t row, void * row_in, | ||
730 | struct scaler_context *ctx) | ||
723 | { | 731 | { |
724 | int col; | 732 | int col; |
725 | uint32_t *qp = (uint32_t*)row_in; | 733 | uint32_t *qp = (uint32_t*)row_in; |
@@ -734,6 +742,7 @@ static unsigned int get_size_grey(struct bitmap *bm) | |||
734 | } | 742 | } |
735 | 743 | ||
736 | const struct custom_format format_grey = { | 744 | const struct custom_format format_grey = { |
737 | .output_row = output_row_grey, | 745 | .output_row_8 = output_row_grey_8, |
746 | .output_row_32 = output_row_grey_32, | ||
738 | .get_size = get_size_grey | 747 | .get_size = get_size_grey |
739 | }; | 748 | }; |
diff --git a/apps/plugins/lib/pluginlib_bmp.c b/apps/plugins/lib/pluginlib_bmp.c index 110e534be0..6b1a54291c 100644 --- a/apps/plugins/lib/pluginlib_bmp.c +++ b/apps/plugins/lib/pluginlib_bmp.c | |||
@@ -124,14 +124,7 @@ void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst) | |||
124 | 124 | ||
125 | #endif /* LCD_DEPTH > 1 */ | 125 | #endif /* LCD_DEPTH > 1 */ |
126 | 126 | ||
127 | #ifndef HAVE_BMP_SCALING | ||
128 | #include "wrappers.h" | 127 | #include "wrappers.h" |
129 | 128 | ||
130 | /* import the core bmp loader */ | 129 | /* import the core bmp loader */ |
131 | #include "recorder/bmp.c" | 130 | #include "recorder/bmp.c" |
132 | #else | ||
133 | /* the full 16x16 Bayer dither matrix may be calculated quickly with this table | ||
134 | */ | ||
135 | const unsigned char dither_table[16] = | ||
136 | { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }; | ||
137 | #endif | ||
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 | ||
610 | static void output_row_transposed(uint32_t row, void * row_in, | 610 | static 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 | |||
632 | static 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 |
638 | static void output_row_transposed_fromyuv(uint32_t row, void * row_in, | 660 | static 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 | ||
665 | const struct custom_format format_transposed = { | 687 | const 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 | }; |