diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-11-08 21:34:46 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-11-08 21:34:46 +0000 |
commit | 13209604c1512658e729d0bd9f1c54cf3e53568d (patch) | |
tree | 2787f9036b5c40cf79cd324f3d215bb9d48dd34a /firmware/drivers/lcd-16bit-common.c | |
parent | 6223ad266e556f5b8d749d5f4fe08e27385be66f (diff) | |
download | rockbox-13209604c1512658e729d0bd9f1c54cf3e53568d.tar.gz rockbox-13209604c1512658e729d0bd9f1c54cf3e53568d.zip |
Add new lcd_bmp and lcd_bmp_part APIs.
This new APIs wrap around lcd_[mono|transparent]_bitmap/_part calls and
handle all kinds bitmaps. The intended use is to draw bitmaps that
come from read_bmp_fd/_file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30936 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-16bit-common.c')
-rw-r--r-- | firmware/drivers/lcd-16bit-common.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-16bit-common.c b/firmware/drivers/lcd-16bit-common.c index 1e1548e997..bbac2b295a 100644 --- a/firmware/drivers/lcd-16bit-common.c +++ b/firmware/drivers/lcd-16bit-common.c | |||
@@ -515,3 +515,21 @@ void ICODE_ATTR lcd_alpha_bitmap_part(const unsigned char *src, int src_x, | |||
515 | #endif | 515 | #endif |
516 | } while (--row); | 516 | } while (--row); |
517 | } | 517 | } |
518 | |||
519 | /* Draw a partial bitmap (mono or native) including alpha channel */ | ||
520 | void ICODE_ATTR lcd_bmp_part(const struct bitmap* bm, int src_x, int src_y, | ||
521 | int x, int y, int width, int height) | ||
522 | { | ||
523 | int bitmap_stride = STRIDE_MAIN(bm->width, bm->height); | ||
524 | if (bm->format == FORMAT_MONO) | ||
525 | lcd_mono_bitmap_part(bm->data, src_x, src_y, bitmap_stride, x, y, width, height); | ||
526 | else | ||
527 | lcd_bitmap_transparent_part((fb_data*)bm->data, | ||
528 | src_x, src_y, bitmap_stride, x, y, width, height); | ||
529 | } | ||
530 | |||
531 | /* Draw a native bitmap with alpha channel */ | ||
532 | void ICODE_ATTR lcd_bmp(const struct bitmap *bmp, int x, int y) | ||
533 | { | ||
534 | lcd_bmp_part(bmp, 0, 0, x, y, bmp->width, bmp->height); | ||
535 | } | ||