* mln/topo/is_not_end_point.hh: Here.
---
milena/ChangeLog | 6 ++++
milena/mln/topo/is_not_end_point.hh | 47 ++++++++++++++++++++--------------
2 files changed, 34 insertions(+), 19 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index da73aef..45c94c8 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-16 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Split interface and implementation of topo::is_not_end_point.
+
+ * mln/topo/is_not_end_point.hh: Here.
+
2010-09-15 Roland Levillain <roland(a)lrde.epita.fr>
Catch up with the renaming to detach_cell.
diff --git a/milena/mln/topo/is_not_end_point.hh b/milena/mln/topo/is_not_end_point.hh
index 3c419ec..62561fa 100644
--- a/milena/mln/topo/is_not_end_point.hh
+++ b/milena/mln/topo/is_not_end_point.hh
@@ -35,7 +35,6 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
-
namespace mln
{
@@ -50,24 +49,10 @@ namespace mln
///
/// \param nbh_fg The foreground neighborhood.
/// \apram ima The image.
- is_not_end_point(const Neighborhood<N>& nbh,
- const Image<I>& ima)
- : nbh_(exact(nbh)),
- ima_(exact(ima))
- {
- }
-
- // Is \a p not na end point?
- bool operator()(const mln_psite(I)& p) const
- {
- // Number of foreground neighbors pixels.
- unsigned nneighbs = 0;
- mln_niter(N) n(nbh_, p);
- for_all(n)
- if (ima_.has(n) && ima_(n))
- ++nneighbs;
- return nneighbs != 1;
- }
+ is_not_end_point(const Neighborhood<N>& nbh, const Image<I>&
ima);
+
+ // Is \a p not an end point?
+ bool operator()(const mln_psite(I)& p) const;
private:
/// The foreground neighborhood.
@@ -76,8 +61,32 @@ namespace mln
const I& ima_;
};
+
+
# ifndef MLN_INCLUDE_ONLY
+ template <typename I, typename N>
+ inline
+ is_not_end_point<I, N>::is_not_end_point(const Neighborhood<N>& nbh,
+ const Image<I>& ima)
+ : nbh_(exact(nbh)),
+ ima_(exact(ima))
+ {
+ }
+
+ template <typename I, typename N>
+ inline
+ bool
+ is_not_end_point<I, N>::operator()(const mln_psite(I)& p) const
+ {
+ // Number of foreground neighbors pixels.
+ unsigned nneighbs = 0;
+ mln_niter(N) n(nbh_, p);
+ for_all(n)
+ if (ima_.has(n) && ima_(n))
+ ++nneighbs;
+ return nneighbs != 1;
+ }
# endif // MLN_INCLUDE_ONLY
--
1.5.6.5
Show replies by date