aboutsummaryrefslogtreecommitdiff
path: root/include/lib/seg
diff options
context:
space:
mode:
authorChristian C <cc@localhost>2025-04-01 17:38:32 -0700
committerChristian C <cc@localhost>2025-04-01 17:38:32 -0700
commita18cea2fef7aa1545c9a984b60919541b26a6f84 (patch)
treed1ab991e28b701bdfdc9035704389ad6c57391c9 /include/lib/seg
parent2bc54ac42b831a7dfcba26c2d12ba002f80a5e40 (diff)
Clang Format
Diffstat (limited to 'include/lib/seg')
-rw-r--r--include/lib/seg/mask_data.h33
-rw-r--r--include/lib/seg/util.h20
2 files changed, 27 insertions, 26 deletions
diff --git a/include/lib/seg/mask_data.h b/include/lib/seg/mask_data.h
index 70bacfa..02276f0 100644
--- a/include/lib/seg/mask_data.h
+++ b/include/lib/seg/mask_data.h
@@ -12,55 +12,56 @@ typedef struct MaskData {
} MaskData;
// Allocate Mask Data for Label
-MaskData* create_mask_data(MaskData_t label);
+MaskData *create_mask_data(MaskData_t label);
// Compare mask data labels
-bool_t compare_labels(MaskData* left, MaskData* right);
+bool_t compare_labels(MaskData *left, MaskData *right);
// Create AVL Mask node
-AVLNode* create_avl_mask_node(MaskData* data);
+AVLNode *create_avl_mask_node(MaskData *data);
// Insert MaskData into the AVL Tree
-Result insert_mask(AVLNode* node, MaskData* data);
+Result insert_mask(AVLNode *node, MaskData *data);
// Allocate a label's Mask data in a tree
// If it already exists, skip the allocation
-AVLNode* insert_mask_alloc(AVLNode* node, MaskData_t label);
+AVLNode *insert_mask_alloc(AVLNode *node, MaskData_t label);
// Print AVL Node Mask Data Label
-void print_label(AVLNode* root);
+void print_label(AVLNode *root);
// Increase the label's area
-bool_t increase_label_area(AVLNode* root, MaskData_t label);
+bool_t increase_label_area(AVLNode *root, MaskData_t label);
// Increase the label's perimeter
-bool_t increase_label_perimeter(AVLNode* root, MaskData_t label);
+bool_t increase_label_perimeter(AVLNode *root, MaskData_t label);
// Increase the label's area
// Create an AVL node if it doesn't exist
-AVLNode* increase_label_area_alloc(AVLNode* root, MaskData_t label);
+AVLNode *increase_label_area_alloc(AVLNode *root, MaskData_t label);
// Increase the label's perimeter
// Create an AVL node if it doesn't exist
-AVLNode* increase_label_perimeter_alloc(AVLNode* root, MaskData_t label);
+AVLNode *increase_label_perimeter_alloc(AVLNode *root, MaskData_t label);
// Comparison of MaskData_ts
-bool_t compare_image_mask_data_t(MaskData_t* s1, MaskData_t* s2);
+bool_t compare_image_mask_data_t(MaskData_t *s1, MaskData_t *s2);
// In-order traversal print pointer
-void print_in_order_image_mask_data_t(AVLNode* root);
+void print_in_order_image_mask_data_t(AVLNode *root);
// Check if MaskData_t in AVLTree with MaskData_t* data
-bool_t in_image_mask_data_t_tree(AVLNode* root, MaskData_t value);
+bool_t in_image_mask_data_t_tree(AVLNode *root, MaskData_t value);
// Filter out small masks
// Assumption: Contiguous labeling
-AVLNode* get_small_labels(AVLNode* removal_tree, AVLNode* label_tree, size_t min_area, size_t min_perimeter);
+AVLNode *get_small_labels(AVLNode *removal_tree, AVLNode *label_tree,
+ size_t min_area, size_t min_perimeter);
// Get mask label data
-AVLNode* get_mask_data(Mask* mask);
+AVLNode *get_mask_data(Mask *mask);
// Filter out small masks in mask
-void filter_small_masks(Mask* mask, size_t min_area, size_t min_perimeter);
+void filter_small_masks(Mask *mask, size_t min_area, size_t min_perimeter);
#endif
diff --git a/include/lib/seg/util.h b/include/lib/seg/util.h
index 9f66670..d726be8 100644
--- a/include/lib/seg/util.h
+++ b/include/lib/seg/util.h
@@ -2,40 +2,40 @@
#define INC_LIB_SEG_UTIL_H
#include <lib/bool.h>
-#include <lib/png.h>
#include <lib/data/image_types.h>
-#include <stdint.h>
+#include <lib/png.h>
#include <stddef.h>
+#include <stdint.h>
// Determine if coordinate is on a mask boundary
// Assumes mask is (WxH)
-bool_t is_on_mask_boundary(Mask* mask, size_t x, size_t y);
+bool_t is_on_mask_boundary(Mask *mask, size_t x, size_t y);
// Dilate masks by one 4-connected pixel
-void dilate(Mask* mask);
+void dilate(Mask *mask);
// Erode masks by one 4-connected pixel
-void erode(Mask* mask);
+void erode(Mask *mask);
// Close up masks by N-pixels
-void closeup(Mask* mask, size_t count);
+void closeup(Mask *mask, size_t count);
// Combine Label Masks
// For all empty spaces in the destination, put the extra label if it exists
// Allocates an array if destination is unallocated
-Mask* combine_masks(Mask *destination, Mask *extra_labels);
+Mask *combine_masks(Mask *destination, Mask *extra_labels);
// 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
-Mask* tif_to_labels(char* tif_file_name, MaskData_t *starting_label_p);
+Mask *tif_to_labels(char *tif_file_name, MaskData_t *starting_label_p);
// Convert mask to bitmap
-Bitmap* image_mask_data_to_bitmap(const Mask* mask);
+Bitmap *image_mask_data_to_bitmap(const Mask *mask);
// Reduce a mask to the contiguous regions
// Automatically update pointer to contiguous mask
// Freeing previous mask
-void reduce_contiguous_regions(Mask* mask, MaskData_t* total_labels);
+void reduce_contiguous_regions(Mask *mask, MaskData_t *total_labels);
#endif