
Coddy Levi <levi@lrde.epita.fr> writes: [...]
--- a/scribo/ChangeLog +++ b/scribo/ChangeLog
[...]
@@ -42,7 +48,7 @@ * tests/filter/Makefile.am, * tests/util/Makefile.am: Add new targets.
- * tests/filter/objects_on_border.cc, +v * tests/filter/objects_on_border.cc, * tests/util/component_outline.cc: New.
* tests/img/comp_on_borders.pbm,
Careful. You should reread your patches before pushing them. :)
diff --git a/scribo/scribo/util/component_outline.hh b/scribo/scribo/util/component_outline.hh index ea2f61f..6870755 100644 --- a/scribo/scribo/util/component_outline.hh +++ b/scribo/scribo/util/component_outline.hh @@ -209,10 +209,11 @@ namespace scribo find_farthest(const I& ima, const mln::point2d& begin, const mln::point2d& end, - float precision) + float precision, + int* nb) { float d = 0.; - float dmax = 0.; + float dmax = -1.; e_dir dir = find_first_dir(ima, begin);
float a = end[1] - begin[1]; @@ -229,6 +230,8 @@ namespace scribo
while (cur != end) { + if (nb != NULL) + (*nb)++;
« NULL » is a C term. In C++, you should use « 0 » (and when the next standard is published, « nullptr »). [...]
@@ -287,7 +296,7 @@ namespace scribo { mln::point2d node;
- node = find_farthest(ima, begin, end, precision); + node = find_farthest(ima, begin, end, precision, NULL);
l.append(begin);
@@ -302,7 +311,7 @@ namespace scribo
l.append(end);
- node = find_farthest(ima, end, begin, precision); + node = find_farthest(ima, end, begin, precision, NULL);
if (node != end) {
Likewise.
@@ -362,7 +371,7 @@ namespace scribo std::pair<mln::point2d, mln::point2d> initials = internal::get_initials(ima);
- std::cout << " - " << initials.first << " - " << initials.second << std::endl; + std::cout << " - " << initials.first << " - " << initials.first << std::endl;
Please try to keep lines within 80 columns. Thanks in advance.