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 /include/lib | |
parent | 74ae06a582b7c567caf3c04e5bf5dfabf6671f31 (diff) |
Save to PNG
Diffstat (limited to 'include/lib')
-rw-r--r-- | include/lib/png.h | 22 | ||||
-rw-r--r-- | include/lib/seg/util.h | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/include/lib/png.h b/include/lib/png.h new file mode 100644 index 0000000..e7943c2 --- /dev/null +++ b/include/lib/png.h @@ -0,0 +1,22 @@ +#ifndef INC_LIB_PNG_H +#define INC_LIB_PNG_H + +#include <stdint.h> +#include <sys/types.h> + +struct pixel_t { + uint8_t red; + uint8_t green; + uint8_t blue; +}; + +struct bitmap_t { + struct pixel_t* image_buffer; + size_t width; + size_t height; +}; + +// Save bitmap to file +void save_png(struct bitmap_t* bitmap, char* fname); + +#endif diff --git a/include/lib/seg/util.h b/include/lib/seg/util.h index c3c0060..fcafff6 100644 --- a/include/lib/seg/util.h +++ b/include/lib/seg/util.h @@ -31,4 +31,7 @@ uint16_t* combine_masks(uint16_t *destination, uint16_t *extra_labels, uint32_t // starting_label_p will be incremented for each label found in the image uint16_t* tif_to_labels(char* tif_file_name, uint32_t *width, uint32_t *height, uint16_t *starting_label_p); +// Convert mask to bitmap +struct bitmap_t* uint16_to_bitmap(uint16_t* buffer, uint32_t width, uint32_t height); + #endif |