aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/lib/data/image_types.h8
-rw-r--r--include/lib/seg/util.h4
-rw-r--r--lib/data/image_types.c6
-rw-r--r--lib/seg/util.c6
-rw-r--r--src/prog.c4
5 files changed, 14 insertions, 14 deletions
diff --git a/include/lib/data/image_types.h b/include/lib/data/image_types.h
index b9ff21e..4e226ea 100644
--- a/include/lib/data/image_types.h
+++ b/include/lib/data/image_types.h
@@ -15,16 +15,16 @@ typedef struct Image {
Image_t image;
} Image;
-typedef struct ImageMask {
+typedef struct Mask {
size_t width;
size_t height;
Mask_t image;
-} ImageMask;
+} Mask;
Image* create_image(size_t width, size_t height);
-ImageMask* create_image_mask(size_t width, size_t height);
+Mask* create_image_mask(size_t width, size_t height);
void free_image(Image* image);
-void free_image_mask(ImageMask* image_mask);
+void free_image_mask(Mask* image_mask);
#endif
diff --git a/include/lib/seg/util.h b/include/lib/seg/util.h
index db46e5a..4d6b6e4 100644
--- a/include/lib/seg/util.h
+++ b/include/lib/seg/util.h
@@ -26,12 +26,12 @@ void closeup(MaskData_t** mask, uint32_t width, uint32_t height, 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
-ImageMask* combine_masks(ImageMask *destination, ImageMask *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
-ImageMask* tif_to_labels(char* tif_file_name, uint32_t *width, uint32_t *height, MaskData_t *starting_label_p);
+Mask* tif_to_labels(char* tif_file_name, uint32_t *width, uint32_t *height, MaskData_t *starting_label_p);
// Convert mask to bitmap
Bitmap* image_mask_data_to_bitmap(MaskData_t* buffer, uint32_t width, uint32_t height);
diff --git a/lib/data/image_types.c b/lib/data/image_types.c
index b7be149..d58b8c6 100644
--- a/lib/data/image_types.c
+++ b/lib/data/image_types.c
@@ -14,9 +14,9 @@ Image* create_image(size_t width, size_t height)
return ip;
}
-ImageMask* create_image_mask(size_t width, size_t height)
+Mask* create_image_mask(size_t width, size_t height)
{
- ImageMask* ip = (ImageMask*)malloc(sizeof(ImageMask));
+ Mask* ip = (Mask*)malloc(sizeof(Mask));
ip->width = width;
ip->height = height;
ip->image = (MaskData_t**)malloc(sizeof(MaskData_t*) * ip->height);
@@ -42,7 +42,7 @@ void free_image(Image* image)
}
}
-void free_image_mask(ImageMask* image_mask)
+void free_image_mask(Mask* image_mask)
{
if (image_mask->image[0] != NULL) {
free(image_mask->image[0]);
diff --git a/lib/seg/util.c b/lib/seg/util.c
index a3b3eb6..844d4a1 100644
--- a/lib/seg/util.c
+++ b/lib/seg/util.c
@@ -202,7 +202,7 @@ void closeup(MaskData_t** mask, uint32_t width, uint32_t height, size_t num_pixe
// Combine Label Masks
// For all empty spaces in the destination, put the extra label if it exists
// Allocates an array if destination is unallocated
-ImageMask* combine_masks(ImageMask *destination, ImageMask *extra_labels)
+Mask* combine_masks(Mask *destination, Mask *extra_labels)
{
if (destination == NULL) {
destination = create_image_mask(extra_labels->width, extra_labels->height);
@@ -220,7 +220,7 @@ ImageMask* combine_masks(ImageMask *destination, ImageMask *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
-ImageMask* tif_to_labels(char* tif_file_name, uint32_t *width, uint32_t *height, MaskData_t *starting_label_p)
+Mask* tif_to_labels(char* tif_file_name, uint32_t *width, uint32_t *height, MaskData_t *starting_label_p)
{
TIFFSetWarningHandler(TiffDummyHandler);
//-TIFF-IMAGE-OPEN-------------------------------
@@ -268,7 +268,7 @@ ImageMask* tif_to_labels(char* tif_file_name, uint32_t *width, uint32_t *height,
//-FLOOD-FILL-SEGMENTATION-----------------------
//-CONTIGUOUS-REGION-FINDING---------------------
- ImageMask *im_data = create_image_mask((size_t)*width, (size_t)*height);
+ Mask *im_data = create_image_mask((size_t)*width, (size_t)*height);
if (im_data == NULL) {
fprintf(stderr, "Memory allocation error\n");
free(image_data);
diff --git a/src/prog.c b/src/prog.c
index 87b7bb3..3335268 100644
--- a/src/prog.c
+++ b/src/prog.c
@@ -88,7 +88,7 @@ int main(int argc, char** argv)
uint32_t width, height;
MaskData_t starting_label = 1;
MaskData_t *masks = NULL;
- ImageMask *masks_im = NULL;
+ Mask *masks_im = NULL;
// Expect a directory to be passed as the first argument
if (directory != NULL) {
// Ensure the directory exists
@@ -118,7 +118,7 @@ int main(int argc, char** argv)
//-----------------------------------------------
//-PROCESS-TIFF-TO-LABELS------------------------
//-----------------------------------------------
- ImageMask *file_im = tif_to_labels(fpath, &width, &height, &starting_label);
+ Mask *file_im = tif_to_labels(fpath, &width, &height, &starting_label);
MaskData_t *file_labels = file_im->image[0];
if (file_labels == NULL) {
free(fpath);