aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorChristian C <cc@localhost>2025-03-05 21:57:20 -0800
committerChristian C <cc@localhost>2025-03-05 21:57:20 -0800
commit22db7ab4cb3b2928095bd9775fb015a5e28487f6 (patch)
tree24f1d1538809795b8b356810b6b3e6fc8dc627b4 /src/main.c
parent74ae06a582b7c567caf3c04e5bf5dfabf6671f31 (diff)
Save to PNG
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 7c914e5..c77d7f5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4,6 +4,7 @@
#include <raylib.h>
#include <lib/lib.h>
+#include <lib/png.h>
#include <lib/bool.h>
#include <lib/monad.h>
#include <lib/dir.h>
@@ -191,7 +192,6 @@ int main(int argc, char** argv)
}
TIME(ts_end);
printf("Dilation took %f ms\n", 1000*diff_time(&ts_end, &ts_start));
-
//-----------------------------------------------
#ifdef VISUAL
@@ -282,6 +282,11 @@ int main(int argc, char** argv)
CloseWindow();
#else
if (masks != NULL) {
+ struct bitmap_t* bitmap = uint16_to_bitmap(masks, width, height);
+ if (bitmap != NULL) {
+ save_png(bitmap, "../out.png");
+ free(bitmap);
+ }
write_array("../out.bin", masks, width*height*sizeof(uint16_t));
free(masks);
}