summaryrefslogtreecommitdiff
path: root/include/tinyff/image
diff options
context:
space:
mode:
authorTazyFoundSoup <gardendistrict0x0@outlook.com>2026-02-16 12:57:51 +1100
committerTazyFoundSoup <gardendistrict0x0@outlook.com>2026-02-16 12:57:51 +1100
commit8c6559fc78ec7a60ebac978a48d0bdbae806aadd (patch)
treeb90aea506831b32937562d8245ec772061dd8b9e /include/tinyff/image
parent7fea9918dc63eeeac069b01035d68cdceff684d7 (diff)
feat(bmp): Add bitmap
Diffstat (limited to 'include/tinyff/image')
-rw-r--r--include/tinyff/image/bmp.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/tinyff/image/bmp.h b/include/tinyff/image/bmp.h
new file mode 100644
index 0000000..5f7462b
--- /dev/null
+++ b/include/tinyff/image/bmp.h
@@ -0,0 +1,36 @@
+#ifndef BMP_H_
+#define BMP_H_
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "tinyff/result.h"
+#include "tinyff/common.h"
+#include "tinyff/stream.h"
+#include "tinyff/image/generic.h"
+
+static const unsigned char BMP_SIGNATURE[2] = {
+ 'B', 'M'
+};
+
+typedef struct {
+ uint32_t file_size; // tbh, i actually have no idea why this is needed
+ uint32_t data_offset;
+
+ uint32_t width;
+ uint32_t height;
+ uint16_t bpp;
+ uint32_t compression;
+ uint32_t image_size;
+ uint32_t x_ppm; // X pixels per meter
+ uint32_t y_ppm; // Y pixels per meter
+ uint32_t colors_used;
+ uint32_t important_colors;
+
+
+} ff_bmp_ctx;
+
+#endif BMP_H_ \ No newline at end of file