From be328c464c5a56a724bc4f9e6ebea76570db9095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Colin=20de=20Verdi=C3=A8re?= Date: Tue, 1 Apr 2025 17:52:56 +0200 Subject: [PATCH] l'argument max-step est repris en compte --- src/seam-carving.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/seam-carving.cpp b/src/seam-carving.cpp index 34d06e7..484ab07 100644 --- a/src/seam-carving.cpp +++ b/src/seam-carving.cpp @@ -195,11 +195,11 @@ std::vector carving_step(const std::vector source_img, std::vector &output_img, std::vector &output_energy, int width, int height, int nbChannels, int nbColorChannels, - bool vertical) { + bool vertical, int max_step=1) { /** Carves an image and its energy by one seam, and recomputes the energy. Returns the optimal seam used */ std::vector opt_seam = - optimal_seam(source_energy, width, height, vertical); + optimal_seam(source_energy, width, height, vertical,max_step=max_step); remove_seam(source_img, output_img, width, height, nbChannels, vertical, opt_seam); @@ -308,7 +308,7 @@ void seam_carving(unsigned char *source, int width, int height, int nbChannels, for (auto seam_index = 0; seam_index < nbSeams; seam_index++) { std::vector opt_seam = carving_step( source_img, source_energy, output_img, output_energy, curWidth, - curHeight, nbChannels, nbColorChannels, vertical); + curHeight, nbChannels, nbColorChannels, vertical, max_step=max_step); std::copy(output_img.begin(), output_img.end(), source_img.begin()); std::copy(output_energy.begin(), output_energy.end(), source_energy.begin());