aboutsummaryrefslogtreecommitdiff
path: root/src/png.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/png.h')
-rw-r--r--src/png.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/png.h b/src/png.h
new file mode 100644
index 0000000..516c4fa
--- /dev/null
+++ b/src/png.h
@@ -0,0 +1,24 @@
+#ifndef PW_PNG_H
+#define PW_PNG_H
+
+#include <SDL3/SDL_stdinc.h>
+
+/**
+ * A pixel from a loaded PNG image.
+ */
+union pw_png_pixel {
+ uint32_t raw;
+ struct {
+ uint8_t r;
+ uint8_t g;
+ uint8_t b;
+ uint8_t a;
+ } ch;
+};
+
+/**
+ * Loads a PNG with exact dimensions.
+ */
+union pw_png_pixel *pw_png_load(uint8_t const *data, size_t sz, int w, int h);
+
+#endif