diff options
author | Christian C <cc@localhost> | 2025-03-05 21:57:20 -0800 |
---|---|---|
committer | Christian C <cc@localhost> | 2025-03-05 21:57:20 -0800 |
commit | 22db7ab4cb3b2928095bd9775fb015a5e28487f6 (patch) | |
tree | 24f1d1538809795b8b356810b6b3e6fc8dc627b4 /src/main.c | |
parent | 74ae06a582b7c567caf3c04e5bf5dfabf6671f31 (diff) |
Save to PNG
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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); } |