diff options
author | Christian C <cc@localhost> | 2025-03-05 12:53:56 -0800 |
---|---|---|
committer | Christian C <cc@localhost> | 2025-03-05 12:53:56 -0800 |
commit | 780ec463612e6a7fd61f0bd2ef029836c333922f (patch) | |
tree | bdb61e882925f201e2a15411f0b62e8825552818 /include/lib | |
parent | 2ce30c1873467859305c3ab4f88cc0d3ea7cb082 (diff) |
Modularize
Diffstat (limited to 'include/lib')
-rw-r--r-- | include/lib/dir.h | 6 | ||||
-rw-r--r-- | include/lib/seg/util.h | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/include/lib/dir.h b/include/lib/dir.h index 39fe435..0ec9cac 100644 --- a/include/lib/dir.h +++ b/include/lib/dir.h @@ -10,4 +10,10 @@ bool_t is_directory(char* dirname); // List directory char** list_directory(char* dirname); +// Get full path +char* full_path(char* dir, char* file); + +// Determines if file name has tif file extension +bool_t is_tif_ext(char* file_name); + #endif diff --git a/include/lib/seg/util.h b/include/lib/seg/util.h new file mode 100644 index 0000000..1fd0247 --- /dev/null +++ b/include/lib/seg/util.h @@ -0,0 +1,23 @@ +#ifndef INC_LIB_SEG_UTIL_H +#define INC_LIB_SEG_UTIL_H + +#include <stdint.h> +#include <stddef.h> + +// Convert x,y coords to linear coordinate +size_t xy_to_coord(size_t x, size_t y, uint32_t width, uint32_t height); + +// Dilate masks by one 4-connected pixel +uint16_t* dilate(uint16_t* mask, uint32_t width, uint32_t height); + +// Combine Label Masks +// For all empty spaces in the destination, put the extra label if it exists +// Allocates an array if destination is unallocated +uint16_t* combine_masks(uint16_t *destination, uint16_t *extra_labels, uint32_t width, uint32_t height); + +// Process Tif File to Labels +// width, height will be overwritten with image dimensions +// 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); + +#endif |