From 410ece0db7bcadd8c3cd118d0994d0939699d19e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Tue, 15 Jun 2021 23:53:16 +0200 Subject: [PATCH] feat: add image direct write to display --- image-viewer/src/image.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/image-viewer/src/image.c b/image-viewer/src/image.c index f37389a..5e204f7 100644 --- a/image-viewer/src/image.c +++ b/image-viewer/src/image.c @@ -144,6 +144,15 @@ static void image_write_upscale(image_t *image, display_t *display, } } } + +static void image_write_direct(image_t *image, display_t *display, + image_region_t region) { + for (int y = 0; y < region.height; y++) { + for (int x = 0; x < region.width; x++) { + display_set_pixel(display, x, y, image_get_pixel(image, x + region.x, y + region.y)); + } + } +} image_region_t region) { uint16_t w = region.width, h = region.height; uint16_t x = region.x, y = region.y; -- 2.48.1