diff options
author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-05-09 07:31:27 +0000 |
---|---|---|
committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-05-09 07:31:27 +0000 |
commit | 91efc162564cd9c04677e2e38550cde21995b06e (patch) | |
tree | c927cefc7f12a49396541dbac246dc76ca444c71 /apps/plugins/lib/grey_draw.c | |
parent | 67695617a13e9f37f17e3718b03046f6d748a9e1 (diff) | |
download | rockbox-91efc162564cd9c04677e2e38550cde21995b06e.tar.gz rockbox-91efc162564cd9c04677e2e38550cde21995b06e.zip |
Split 8-bit-to-native conversion in bmp.c into a function, add support for plugging unscaled output in BMP and JPEG loaders, use output_row_8_native in JPEG decoder when possible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20884 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/grey_draw.c')
-rw-r--r-- | apps/plugins/lib/grey_draw.c | 13 |
1 files changed, 11 insertions, 2 deletions
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 | }; |