diff options
author | Christian C <cc@localhost> | 2025-03-05 16:14:18 -0800 |
---|---|---|
committer | Christian C <cc@localhost> | 2025-03-05 16:14:18 -0800 |
commit | 74e46ee7709785f91e04ac42619e4a7e9f90bc18 (patch) | |
tree | 82f5140c42cff58d9a980e2737eea808e1820560 /src/main.c | |
parent | a3684826417bf9cea4c24e8a82e9574feb64576d (diff) |
Modularize
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -31,6 +31,7 @@ int main(int argc, char** argv) print_label(root); printf("\n"); free_avl_tree_nodes(root); + root = NULL; //----------------------------------------------- //-LIST-FILES-IN-DIRECTORY----------------------- //----------------------------------------------- @@ -169,6 +170,18 @@ int main(int argc, char** argv) CloseWindow(); #else if (masks != NULL) { + for (size_t y = 0; y < height; y++) { + for (size_t x = 0; x < width; x++) { + if (masks[x + y*width] != 0) { + root = increase_label_area_alloc(root, masks[x + y*width]); + } + } + } + printf("Inorder traversal of AVL tree: "); + print_label(root); + printf("\n"); + free_avl_tree_nodes(root); + root = NULL; write_array("../out.bin", masks, width*height*sizeof(uint16_t)); free(masks); } |