---
milena/ChangeLog | 8 +++-
.../kn/{face_dim.hh => dilate_0_from_1_faces.hh} | 43 ++++++++++----------
2 files changed, 27 insertions(+), 24 deletions(-)
copy milena/mln/world/kn/{face_dim.hh => dilate_0_from_1_faces.hh} (63%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 0a784ae..39d9925 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,9 +1,13 @@
-2012-11-01 Guilelaume Lazzara <z(a)lrde.epita.fr>
+2012-11-01 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * mln/world/kn/dilate_0_from_1_faces.hh: New.
+
+2012-11-01 Guillaume Lazzara <z(a)lrde.epita.fr>
* mln/world/kn/fill_1_from_2_faces.hh: Rely on
fill_1_from_aux_2_faces.
-2012-11-01 Guilelaume Lazzara <z(a)lrde.epita.fr>
+2012-11-01 Guillaume Lazzara <z(a)lrde.epita.fr>
Add world::kn::fill_2_from_aux_1_faces.hh.
diff --git a/milena/mln/world/kn/face_dim.hh
b/milena/mln/world/kn/dilate_0_from_1_faces.hh
similarity index 63%
copy from milena/mln/world/kn/face_dim.hh
copy to milena/mln/world/kn/dilate_0_from_1_faces.hh
index 6a6c418..1acfd83 100644
--- a/milena/mln/world/kn/face_dim.hh
+++ b/milena/mln/world/kn/dilate_0_from_1_faces.hh
@@ -25,12 +25,17 @@
/// \file
///
-/// \brief Returns the dimension of site in KN.
+/// \brief Dilate 1-faces values to 0-faces.
-#ifndef MLN_WORLD_KN_FACE_DIM_HH
-# define MLN_WORLD_KN_FACE_DIM_HH
+/// FIXME: to be optimized. We could stop looking in neighborhod
+/// values once the first True is found.
-# include <mln/core/alias/point2d.hh>
+#ifndef MLN_WORLD_KN_DILATE_0_FROM_1_FACES_HH
+# define MLN_WORLD_KN_DILATE_0_FROM_1_FACES_HH
+
+# include <mln/core/concept/image.hh>
+# include <mln/accu/logic/lor.hh>
+# include <mln/world/kn/fill_0_from_1_faces.hh>
namespace mln
{
@@ -41,28 +46,24 @@ namespace mln
namespace kn
{
- /// \brief Returns the dimension of site in KN.
- unsigned face_dim(const point2d& p);
-
- /// \overload
- unsigned face_dim(const mln::def::coord& row, const mln::def::coord& col);
+ /// \brief Dilate 1-faces values to 0-faces.
+ template <typename I>
+ void dilate_0_from_1_faces(Image<I>& inout);
# ifndef MLN_INCLUDE_ONLY
+ template <typename I>
+ void dilate_0_from_1_faces(Image<I>& inout_)
+ {
+ trace::entering("mln::world::kn::dilate_0_from_1_faces");
- // Facade
+ mln_precondition(exact(inout_).is_valid());
+ I& inout = exact(inout_);
- inline
- unsigned face_dim(const point2d& p)
- {
- return face_dim(p.row(), p.col());
- }
+ fill_0_from_1_faces(inout, accu::logic::lor());
- inline
- unsigned face_dim(const mln::def::coord& row, const mln::def::coord& col)
- {
- return (row % 2 == 0) + (col % 2 == 0);
+ trace::exiting("mln::world::kn::dilate_0_from_1_faces");
}
@@ -74,6 +75,4 @@ namespace mln
} // end of namespace mln
-#endif // ! MLN_WORLD_KN_FACE_DIM_HH
-
-
+#endif // ! MLN_WORLD_KN_DILATE_0_FROM_1_FACES_HH
--
1.7.2.5