From 4b6f1239748a4588f5667373aa1d96f0c25d8221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Colin=20de=20Verdi=C3=A8re?= Date: Fri, 4 Apr 2025 12:22:11 +0200 Subject: [PATCH] renames test-energy to show-seams --- src/seam-carving.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/seam-carving.cpp b/src/seam-carving.cpp index 33831d6..dfc5ac5 100644 --- a/src/seam-carving.cpp +++ b/src/seam-carving.cpp @@ -15,7 +15,7 @@ // Global flags bool silent = false; -bool test_energy = false; +bool show_seams = false; bool until_mask_removal = false; int max_step = 1; std::string function = "grad"; @@ -396,7 +396,7 @@ auto seam_carving(unsigned char *source, int width, int height, int nbChannels, if (mask) masked_energy = mask_energy(source_energy, width, height, mask); - if (test_energy) { + if (show_seams) { ini_energy = energy_e1(source_img, width, height, nbChannels); for (auto k = 0; k < width * height; k++) { complete_blacklist[k] = false; @@ -464,7 +464,7 @@ auto seam_carving(unsigned char *source, int width, int height, int nbChannels, vertical ? curWidth-- : curHeight--; // We just reduced the dimension - if (test_energy) { // Update blacklist + if (show_seams) { // Update blacklist for (auto i = 0; i < dim_long; i++) { int j, cur_j = 0; // cur_j is the index relative to the current carved // image. j is absolute in the source image @@ -487,7 +487,7 @@ auto seam_carving(unsigned char *source, int width, int height, int nbChannels, } std::cout << std::endl; // Add newline after ProgressBar - if (test_energy) { + if (show_seams) { return std::make_tuple(test_energy_output, width, height, nbChannels); } else { return std::make_tuple(source_img, curWidth, curHeight, nbChannels); @@ -517,7 +517,7 @@ int main(int argc, char **argv) { app.add_flag("--vertical", vertical, "Vertical carving (remove vertical seams)"); app.add_flag("--silent", silent, "No verbose messages"); - app.add_flag("--test-energy", test_energy, + app.add_flag("--show-seams", show_seams, "Don't resize image, just try the specified energy function"); app.add_option("-f,--function", function, "The function to apply to compute the energy");