renames test-energy to show-seams

This commit is contained in:
François Colin de Verdière 2025-04-04 12:22:11 +02:00
parent 56df0521b3
commit 4b6f123974

View File

@ -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");