summaryrefslogtreecommitdiff
path: root/tools/nitrogfx/gfx.h
diff options
context:
space:
mode:
authorMartmists <martmists@gmail.com>2020-04-22 13:57:09 +0200
committerMartmists <martmists@gmail.com>2020-04-22 13:57:09 +0200
commit9b3107c478c9f39c17ef4171c9c5330adcb1385a (patch)
treee63d60215b5ba9405d7aeb3322873d26c5f03cc1 /tools/nitrogfx/gfx.h
parentdcdf58739922de3b3bbc828f46e36b83f53c52a0 (diff)
parent5ee605688aaea7fe6b4573dc2ce5ce24cd671855 (diff)
Merge branch 'master' into os_lib
Diffstat (limited to 'tools/nitrogfx/gfx.h')
-rw-r--r--tools/nitrogfx/gfx.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/nitrogfx/gfx.h b/tools/nitrogfx/gfx.h
new file mode 100644
index 00000000..5355ced8
--- /dev/null
+++ b/tools/nitrogfx/gfx.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2015 YamaArashi
+
+#ifndef GFX_H
+#define GFX_H
+
+#include <stdint.h>
+#include <stdbool.h>
+
+struct Color {
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+};
+
+struct Palette {
+ struct Color colors[256];
+ int numColors;
+};
+
+struct Image {
+ int width;
+ int height;
+ int bitDepth;
+ unsigned char *pixels;
+ bool hasPalette;
+ struct Palette palette;
+ bool hasTransparency;
+};
+
+void ReadImage(char *path, int tilesWidth, int bitDepth, int metatileWidth, int metatileHeight, struct Image *image, bool invertColors);
+void WriteImage(char *path, int numTiles, int bitDepth, int metatileWidth, int metatileHeight, struct Image *image, bool invertColors);
+void FreeImage(struct Image *image);
+void ReadGbaPalette(char *path, struct Palette *palette);
+void WriteGbaPalette(char *path, struct Palette *palette);
+
+#endif // GFX_H