
* tests/world/kn/border/Makefile.am: New target. * tests/world/kn/border/compute_1_faces.cc: New. --- milena/ChangeLog | 8 +++++++ milena/tests/world/kn/border/Makefile.am | 2 + .../{duplicate_2_faces.cc => compute_1_faces.cc} | 22 ++++++++++---------- 3 files changed, 21 insertions(+), 11 deletions(-) copy milena/tests/world/kn/border/{duplicate_2_faces.cc => compute_1_faces.cc} (83%) diff --git a/milena/ChangeLog b/milena/ChangeLog index 84feb27..d1fd20e 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,13 @@ 2012-10-29 Guillaume Lazzara <z@lrde.epita.fr> + Add test for world::kn::border::compute_1_faces. + + * tests/world/kn/border/Makefile.am: New target. + + * tests/world/kn/border/compute_1_faces.cc: New. + +2012-10-29 Guillaume Lazzara <z@lrde.epita.fr> + Add kn::is_primary_2_face and kn::is_not_primary_2_face. * mln/world/k2/is_non_primary_2_face.hh, diff --git a/milena/tests/world/kn/border/Makefile.am b/milena/tests/world/kn/border/Makefile.am index e8a2666..d4b7ecd 100644 --- a/milena/tests/world/kn/border/Makefile.am +++ b/milena/tests/world/kn/border/Makefile.am @@ -18,9 +18,11 @@ include $(top_srcdir)/milena/tests/tests.mk check_PROGRAMS = \ adjust_duplicate_2_faces \ + compute_1_faces \ duplicate_2_faces adjust_duplicate_2_faces_SOURCES = adjust_duplicate_2_faces.cc +compute_1_faces_SOURCES = compute_1_faces.cc duplicate_2_faces_SOURCES = duplicate_2_faces.cc TESTS = $(check_PROGRAMS) diff --git a/milena/tests/world/kn/border/duplicate_2_faces.cc b/milena/tests/world/kn/border/compute_1_faces.cc similarity index 83% copy from milena/tests/world/kn/border/duplicate_2_faces.cc copy to milena/tests/world/kn/border/compute_1_faces.cc index 3f91c01..062203a 100644 --- a/milena/tests/world/kn/border/duplicate_2_faces.cc +++ b/milena/tests/world/kn/border/compute_1_faces.cc @@ -27,23 +27,22 @@ #include <mln/core/image/image2d.hh> #include <mln/border/fill.hh> +#include <mln/world/kn/border/compute_1_faces.hh> #include <mln/world/kn/border/duplicate_2_faces.hh> - +#include <mln/fun/vv2v/sum.hh> int main() { using namespace mln; - border::thickness = 1; - int refvals[][7] = { - {2, 9, 2, 9, 3, 9, 3}, - {9, 0, 1, 0, 1, 0, 9}, - {2, 1, 2, 1, 3, 1, 3}, - {9, 0, 1, 0, 1, 0, 9}, - {4, 1, 4, 1, 5, 1, 5}, - {9, 0, 1, 0, 1, 0, 9}, - {4, 9, 4, 9, 5, 9, 5} + {2, 4, 2, 5, 3, 6, 3 }, + {4, 0, 1, 0, 1, 0, 6 }, + {2, 1, 2, 1, 3, 1, 3 }, + {6, 0, 1, 0, 1, 0, 8 }, + {4, 1, 4, 1, 5, 1, 5 }, + {8, 0, 1, 0, 1, 0, 10}, + {4, 8, 4, 9, 5, 10, 5 } }; image2d<int> ref = make::image(refvals, point2d(-2,-2)); @@ -57,8 +56,9 @@ int main() }; image2d<int> ima = make::image(vals, point2d(-1,-1)); - border::fill(ima, 9); + border::fill(ima, 0); world::kn::border::duplicate_2_faces(ima); + world::kn::border::compute_1_faces(ima, fun::vv2v::sum<int>()); mln_piter(image2d<int>) p(ref.domain()); for_all(p) -- 1.7.2.5