diff options
Diffstat (limited to 'apps/plugins/lib/grey_draw.c')
-rw-r--r-- | apps/plugins/lib/grey_draw.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/plugins/lib/grey_draw.c b/apps/plugins/lib/grey_draw.c index e9812b6784..51d340dd7f 100644 --- a/apps/plugins/lib/grey_draw.c +++ b/apps/plugins/lib/grey_draw.c | |||
@@ -669,3 +669,22 @@ void grey_ub_gray_bitmap(const unsigned char *src, int x, int y, int width, | |||
669 | { | 669 | { |
670 | grey_ub_gray_bitmap_part(src, 0, 0, width, x, y, width, height); | 670 | grey_ub_gray_bitmap_part(src, 0, 0, width, x, y, width, height); |
671 | } | 671 | } |
672 | |||
673 | static void output_row_grey(uint32_t row, void * row_in, struct scaler_context *ctx) | ||
674 | { | ||
675 | int col; | ||
676 | uint32_t *qp = (uint32_t*)row_in; | ||
677 | uint8_t *dest = (uint8_t*)ctx->bm->data + ctx->bm->width * row; | ||
678 | for (col = 0; col < ctx->bm->width; col++) | ||
679 | *dest++ = ((*qp++) + ctx->round) * (uint64_t)ctx->divisor >> 32; | ||
680 | } | ||
681 | |||
682 | static unsigned int get_size_grey(struct bitmap *bm) | ||
683 | { | ||
684 | return bm->width * bm->height; | ||
685 | } | ||
686 | |||
687 | const struct custom_format format_grey = { | ||
688 | .output_row = output_row_grey, | ||
689 | .get_size = get_size_grey | ||
690 | }; | ||