From 5053382808960f3209b3fd217fd6b20b240f0d38 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 13 Jun 2021 12:59:45 +0200 Subject: Added image viewer and blerp scaling --- libs/libgui/bmp.c | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 libs/libgui/bmp.c (limited to 'libs/libgui/bmp.c') diff --git a/libs/libgui/bmp.c b/libs/libgui/bmp.c deleted file mode 100644 index 5576d16..0000000 --- a/libs/libgui/bmp.c +++ /dev/null @@ -1,29 +0,0 @@ -// MIT License, Copyright (c) 2020 Marvin Borner - -#include -#include -#include -#include -#include - -struct bmp *bmp_load(const char *path) -{ - void *buf = sread(path); - if (!buf) - return NULL; - - struct bmp_header *h = buf; - if (h->signature[0] != 'B' || h->signature[1] != 'M') - return NULL; - - // TODO: Support padding with odd widths - struct bmp_info *info = (struct bmp_info *)((u32)buf + sizeof(*h)); - struct bmp *bmp = malloc(sizeof(*bmp)); - bmp->size.x = info->width; - bmp->size.y = info->height; - bmp->data = (u8 *)((u32)buf + h->offset); - bmp->bpp = info->bpp; - bmp->pitch = bmp->size.x * (bmp->bpp >> 3); - - return bmp; -} -- cgit v1.2.3