~ruther/CTU-FEE-B0B35APO-Semestral-project

410ece0db7bcadd8c3cd118d0994d0939699d19e — František Boháček 3 years ago a59007a
feat: add image direct write to display
1 files changed, 9 insertions(+), 0 deletions(-)

M image-viewer/src/image.c
M image-viewer/src/image.c => image-viewer/src/image.c +9 -0
@@ 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;

Do not follow this link