This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch exp/khalimsky has been updated
via 104c7b7044973cc4da49295f06294ddc2aa552ea (commit)
via 8ea985cae75d44dec8136731773c9cfa1764724c (commit)
via 89de8a2b83bd6d56272cf272381d2dab8b27bb32 (commit)
from 81fe5b981e588b3dfe533d7763c3aa73372b3780 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
104c7b7 Fix preconditions.
8ea985c Add tests for inner_border routines.
89de8a2 configure.ac: Configure milena/tests/inner_border/Makefile.am.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 +
configure.ac | 1 +
milena/ChangeLog | 19 +++++
milena/mln/inner_border/extend.hh | 2 +-
milena/mln/inner_border/fill.hh | 2 +-
milena/tests/Makefile.am | 3 +-
.../{core/routine => inner_border}/Makefile.am | 17 ++--
.../extend.cc} | 45 ++++++------
.../extend_and_fill.cc} | 51 +++++++------
.../extend_and_fill_with_inner_border.cc} | 79 ++++++++------------
.../k1/immerse_with.cc => inner_border/fill.cc} | 65 ++++++++++-------
11 files changed, 155 insertions(+), 133 deletions(-)
copy milena/tests/{core/routine => inner_border}/Makefile.am (71%)
copy milena/tests/{world/kn/fill_0_1_faces_internal_border.cc => inner_border/extend.cc} (67%)
copy milena/tests/{world/kn/fill_0_1_faces_internal_border.cc => inner_border/extend_and_fill.cc} (62%)
copy milena/tests/{world/kn/fill_1_from_2_faces.cc => inner_border/extend_and_fill_with_inner_border.cc} (60%)
copy milena/tests/{world/k1/immerse_with.cc => inner_border/fill.cc} (64%)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch exp/khalimsky has been updated
via 81fe5b981e588b3dfe533d7763c3aa73372b3780 (commit)
via ab1d771840bf5feb550af4f83fdf17b68aad3cfd (commit)
from abeebe9d18431d7dfb2f0fb711b3ede92a17ab55 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
81fe5b9 Add compute_tree_of_shapes algorithm.
ab1d771 Various fixes.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 36 ++
milena/mln/accu/math/span.hh | 43 +-
milena/mln/data/compute_in_inner_border.hh | 6 +-
milena/mln/fun/vv2v/span.hh | 19 +-
milena/mln/fun/vvvv2v/span.hh | 27 +-
milena/mln/inner_border/fill.hh | 4 +-
.../{on_frontiere.hh => is_on_frontiere.hh} | 45 ++-
milena/mln/util/hqueue.hh | 162 +++++++
.../fill.hh => util/tree_of_shapes.hh} | 79 ++--
milena/mln/value/interval.hh | 20 +-
milena/mln/world/k2/is_primary_2_face.hh | 2 +-
milena/mln/world/kn/compute_tree_of_shapes.hh | 500 ++++++++++++++++++++
.../mln/world/kn/fill_0_1_faces_internal_border.hh | 22 +-
milena/mln/world/kn/internal/display.hh | 320 +++++++++++++
.../kn/internal/fill_primary_2_faces_from_input.hh | 3 +-
milena/mln/world/kn/safe_cast.hh | 87 ++--
milena/mln/world/kn/un_immerse.hh | 4 +-
17 files changed, 1207 insertions(+), 172 deletions(-)
rename milena/mln/inner_border/internal/{on_frontiere.hh => is_on_frontiere.hh} (68%)
create mode 100644 milena/mln/util/hqueue.hh
copy milena/mln/{inner_border/fill.hh => util/tree_of_shapes.hh} (56%)
create mode 100644 milena/mln/world/kn/compute_tree_of_shapes.hh
create mode 100644 milena/mln/world/kn/internal/display.hh
hooks/post-receive
--
Olena, a generic and efficient image processing platform
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch exp/khalimsky has been updated
via abeebe9d18431d7dfb2f0fb711b3ede92a17ab55 (commit)
via 35287d9cbad815ebbcb5021e697fbe8385cf2b87 (commit)
from fd94360102b88b25a7f6bbed8046fc329871c6b3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
abeebe9 Some fixes.
35287d9 Add inner_border routines.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 26 +++++
milena/mln/core/site_set/box.hh | 33 ++++++-
milena/mln/data/compute_in_inner_border.hh | 95 ++++++-----------
.../mln/{make/pixel.hh => inner_border/extend.hh} | 55 ++++++----
.../extend_and_fill.hh} | 68 ++++++------
.../extend_and_fill_with_inner_border.hh | 99 +++++++++++++++++
milena/mln/{debug/iota.hh => inner_border/fill.hh} | 86 ++++++---------
milena/mln/inner_border/internal/on_frontiere.hh | 113 ++++++++++++++++++++
milena/mln/trait/routine/mean.hh | 12 ++
milena/mln/value/interval.hh | 12 ++-
milena/mln/value/intsub.hh | 9 ++
milena/mln/value/iota.hh | 27 +++++
12 files changed, 459 insertions(+), 176 deletions(-)
copy milena/mln/{make/pixel.hh => inner_border/extend.hh} (55%)
copy milena/mln/{subsampling/gaussian_subsampling.hh => inner_border/extend_and_fill.hh} (52%)
create mode 100644 milena/mln/inner_border/extend_and_fill_with_inner_border.hh
copy milena/mln/{debug/iota.hh => inner_border/fill.hh} (56%)
create mode 100644 milena/mln/inner_border/internal/on_frontiere.hh
hooks/post-receive
--
Olena, a generic and efficient image processing platform
* mln/inner_border/extend.hh,
* mln/inner_border/extend_and_fill.hh,
* mln/inner_border/extend_and_fill_with_inner_border.hh,
* mln/inner_border/fill.hh,
* mln/inner_border/internal/on_frontiere.hh: New.
---
milena/ChangeLog | 10 ++
.../mln/{make/pixel.hh => inner_border/extend.hh} | 55 ++++++----
.../extend_and_fill.hh} | 68 ++++++------
.../extend_and_fill_with_inner_border.hh | 99 +++++++++++++++++
milena/mln/{debug/iota.hh => inner_border/fill.hh} | 86 ++++++---------
milena/mln/inner_border/internal/on_frontiere.hh | 113 ++++++++++++++++++++
6 files changed, 323 insertions(+), 108 deletions(-)
copy milena/mln/{make/pixel.hh => inner_border/extend.hh} (55%)
copy milena/mln/{subsampling/gaussian_subsampling.hh => inner_border/extend_and_fill.hh} (52%)
create mode 100644 milena/mln/inner_border/extend_and_fill_with_inner_border.hh
copy milena/mln/{debug/iota.hh => inner_border/fill.hh} (56%)
create mode 100644 milena/mln/inner_border/internal/on_frontiere.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 2413cb2..1bfdd14 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,13 @@
+2012-10-24 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add inner_border routines.
+
+ * mln/inner_border/extend.hh,
+ * mln/inner_border/extend_and_fill.hh,
+ * mln/inner_border/extend_and_fill_with_inner_border.hh,
+ * mln/inner_border/fill.hh,
+ * mln/inner_border/internal/on_frontiere.hh: New.
+
2012-10-23 Guillaume Lazzara <z(a)lrde.epita.fr>
Add data::compute_in_inner_border.
diff --git a/milena/mln/make/pixel.hh b/milena/mln/inner_border/extend.hh
similarity index 55%
copy from milena/mln/make/pixel.hh
copy to milena/mln/inner_border/extend.hh
index 9f9f776..d5172a2 100644
--- a/milena/mln/make/pixel.hh
+++ b/milena/mln/inner_border/extend.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,54 +23,65 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef MLN_MAKE_PIXEL_HH
-# define MLN_MAKE_PIXEL_HH
+#ifndef MLN_INNER_BORDER_EXTEND_HH
+# define MLN_INNER_BORDER_EXTEND_HH
/// \file
-/// \brief Routine to construct an mln::pixel.
+///
+/// \brief Extend the inner border of an image.
-# include <mln/core/concept/image.hh>
-# include <mln/core/pixel.hh>
+# include <mln/core/image/image2d.hh>
+# include <mln/data/paste.hh>
namespace mln
{
- namespace make
+ namespace inner_border
{
- /// Create a mln::pixel from a constant image \p ima and a point \p p.
+ /// \brief Extend the inner border of an image.
template <typename I>
- mln::pixel<const I> pixel(const Image<I>& ima, const mln_psite(I)& p);
+ mln_concrete(I)
+ extend(const Image<I>& input, unsigned inner_border_size);
- /// Create a mln::pixel from a mutable image \p ima and a point \p p.
+ /// \overload
+ /// inner_border_size is set to 1.
template <typename I>
- mln::pixel<I> pixel(Image<I>& ima, const mln_psite(I)& p);
+ mln_concrete(I)
+ extend(const Image<I>& input);
# ifndef MLN_INCLUDE_ONLY
template <typename I>
- inline
- mln::pixel<const I> pixel(const Image<I>& ima, const mln_psite(I)& p)
+ mln_concrete(I)
+ extend(const Image<I>& input_, unsigned inner_border_size)
{
- mln::pixel<const I> tmp(exact(ima), p);
- return tmp;
+ trace::entering("mln::inner_border::extend");
+ mln_precondition(exact(input).is_valid());
+ const I& input = exact(input_);
+
+ box2d b = input.domain(), bb = b;
+ bb.enlarge(inner_border_size);
+ mln_concrete(I) output(bb);
+ data::paste(input, output);
+
+ trace::exiting("mln::inner_border::extend");
+ return output;
}
template <typename I>
- inline
- mln::pixel<I> pixel(Image<I>& ima, const mln_psite(I)& p)
+ mln_concrete(I)
+ extend(const Image<I>& input)
{
- mln::pixel<I> tmp(exact(ima), p);
- return tmp;
+ return extend(input, 1);
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::make
+ } // end of namespace mln::inner_border
} // end of namespace mln
-
-#endif // ! MLN_MAKE_PIXEL_HH
+#endif // ! MLN_INNER_BORDER_EXTEND_HH
diff --git a/milena/mln/subsampling/gaussian_subsampling.hh b/milena/mln/inner_border/extend_and_fill.hh
similarity index 52%
copy from milena/mln/subsampling/gaussian_subsampling.hh
copy to milena/mln/inner_border/extend_and_fill.hh
index 8855b9c..b2804fc 100644
--- a/milena/mln/subsampling/gaussian_subsampling.hh
+++ b/milena/mln/inner_border/extend_and_fill.hh
@@ -1,5 +1,4 @@
-// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -24,67 +23,64 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef MLN_SUBSAMPLING_GAUSSIAN_SUBSAMPLING_HH
-# define MLN_SUBSAMPLING_GAUSSIAN_SUBSAMPLING_HH
+#ifndef MLN_INNER_BORDER_EXTEND_AND_FILL_HH
+# define MLN_INNER_BORDER_EXTEND_AND_FILL_HH
/// \file
///
-/// Produce a subsampled image
-
-# include <mln/geom/ncols.hh>
-# include <mln/geom/nrows.hh>
-
-
-# include <mln/linear/gaussian.hh>
-# include <mln/subsampling/subsampling.hh>
+/// \brief Extend the inner border of an image.
+# include <mln/inner_border/extend.hh>
+# include <mln/inner_border/fill.hh>
namespace mln
{
- namespace subsampling
+ namespace inner_border
{
- /// Gaussian subsampling FIXME : doxy
+ /// \brief Extend the inner border of an image and fill it with a
+ /// value.
template <typename I>
- inline
mln_concrete(I)
- gaussian_subsampling(const Image<I>& input, float sigma,
- const mln_dpsite(I)& first_p,
- const mln_deduce(I, site, coord)& gap);
+ extend_and_fill(const Image<I>& input, unsigned inner_border_size,
+ const mln_value(I)& value);
-# ifndef MLN_INCLUDE_ONLY
+ /// \overload
+ /// inner_border_size is set to 1.
+ template <typename I>
+ mln_concrete(I)
+ extend_and_fill(const Image<I>& input, const mln_value(I)& value);
+# ifndef MLN_INCLUDE_ONLY
template <typename I>
- inline
mln_concrete(I)
- gaussian_subsampling(const Image<I>& input, float sigma,
- const mln_dpsite(I)& first_p,
- const mln_deduce(I, site, coord)& gap)
+ extend_and_fill(const Image<I>& input, unsigned inner_border_size,
+ const mln_value(I)& value)
{
- trace::entering("subsampling::gaussian_subsampling");
+ trace::entering("mln::inner_border::extend_and_fill");
mln_precondition(exact(input).is_valid());
- (void) sigma;
-
- mln_concrete(I) temp(exact(input).domain());
- mln_concrete(I) output(geom::nrows(input) / gap,
- geom::ncols(input) / gap); //FIXME : image2d only
+ mln_concrete(I) output = inner_border::extend(input, inner_border_size);
+ inner_border::fill(output, inner_border_size, value);
- linear::gaussian(input, 0.1, temp);
- output = impl::subsampling_(exact(temp), first_p, gap);
-
- trace::exiting("subsampling::gaussian_subsampling");
+ trace::exiting("mln::inner_border::extend_and_fill");
return output;
}
+ template <typename I>
+ mln_concrete(I)
+ extend_and_fill(const Image<I>& input, const mln_value(I)& value)
+ {
+ return extend_and_fill(input, 1, value);
+ }
+
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::subsampling
+ } // end of namespace mln::inner_border
} // end of namespace mln
-
-#endif // ! MLN_SUBSAMPLING_GAUSSIAN_SUBSAMPLING_HH
+#endif // ! MLN_INNER_BORDER_EXTEND_AND_FILL_HH
diff --git a/milena/mln/inner_border/extend_and_fill_with_inner_border.hh b/milena/mln/inner_border/extend_and_fill_with_inner_border.hh
new file mode 100644
index 0000000..8c4db27
--- /dev/null
+++ b/milena/mln/inner_border/extend_and_fill_with_inner_border.hh
@@ -0,0 +1,99 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_INNER_BORDER_EXTEND_AND_FILL_WITH_INNER_BORDER_HH
+# define MLN_INNER_BORDER_EXTEND_AND_FILL_WITH_INNER_BORDER_HH
+
+/// \file
+///
+/// \brief Extend the inner border of an image.
+
+# include <mln/data/compute_in_inner_border.hh>
+# include <mln/inner_border/extend.hh>
+# include <mln/inner_border/fill.hh>
+
+
+namespace mln
+{
+
+ namespace inner_border
+ {
+
+ /// \brief Extend the inner border of an image and fill it with a
+ /// value.
+ template <typename I, typename A>
+ mln_concrete(I)
+ extend_and_fill_with_inner_border(const Image<I>& input,
+ unsigned old_inner_border_size,
+ const Accumulator<A>& accu,
+ unsigned inner_border_size_for_accu);
+
+ /// \overload
+ /// old_inner_border_size and inner_border_size_for_accu are set to 1.
+ template <typename I, typename A>
+ mln_concrete(I)
+ extend_and_fill_with_inner_border(const Image<I>& input,
+ const Accumulator<A>& accu);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename I, typename A>
+ mln_concrete(I)
+ extend_and_fill_with_inner_border(const Image<I>& input,
+ unsigned inner_border_size,
+ const Accumulator<A>& accu,
+ unsigned inner_border_size_for_accu)
+ {
+ trace::entering("mln::inner_border::extend_and_fill_with_inner_border");
+// mlc_converts_to(mln_result(A),mln_value(I))::check();
+ mln_precondition(exact(input).is_valid());
+
+ mln_result(A)
+ v = data::compute_in_inner_border(accu,
+ input, inner_border_size_for_accu);
+ mln_concrete(I) output = inner_border::extend(input, inner_border_size);
+ inner_border::fill(output, inner_border_size, static_cast<mln_value(I)>(v));
+
+ trace::exiting("mln::inner_border::extend_and_fill_with_inner_border");
+ return output;
+ }
+
+
+ template <typename I, typename A>
+ mln_concrete(I)
+ extend_and_fill_with_inner_border(const Image<I>& input,
+ const Accumulator<A>& accu)
+ {
+ return extend_and_fill_with_inner_border(input, 1, accu, 1);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::inner_border
+
+} // end of namespace mln
+
+#endif // ! MLN_INNER_BORDER_EXTEND_AND_FILL_WITH_INNER_BORDER_HH
diff --git a/milena/mln/debug/iota.hh b/milena/mln/inner_border/fill.hh
similarity index 56%
copy from milena/mln/debug/iota.hh
copy to milena/mln/inner_border/fill.hh
index 3e569b9..ccee289 100644
--- a/milena/mln/debug/iota.hh
+++ b/milena/mln/inner_border/fill.hh
@@ -1,5 +1,4 @@
-// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -24,81 +23,68 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef MLN_DEBUG_IOTA_HH
-# define MLN_DEBUG_IOTA_HH
+#ifndef MLN_INNER_BORDER_FILL_HH
+# define MLN_INNER_BORDER_FILL_HH
-/*! \file
- *
- * \brief Fill an image with successive values.
- */
-
-# include <mln/core/concept/image.hh>
-
-// Specializations are in:
-# include <mln/debug/iota.spe.hh>
+/// \file
+///
+/// \brief Fill the inner border of an image.
+# include <mln/core/image/image2d.hh>
+# include <mln/data/paste.hh>
+# include <mln/inner_border/internal/on_frontiere.hh>
namespace mln
{
- namespace debug
+ namespace inner_border
{
- /*! Fill the image \p input with successive values.
- *
- * \param[in,out] input The image in which values are
- * assigned.
- */
+ /// \brief Fill the inner border of an image.
template <typename I>
- void iota(Image<I>& input, unsigned base_index);
-
-
-# ifndef MLN_INCLUDE_ONLY
-
- namespace impl
- {
+ void
+ fill(Image<I>& input, unsigned border_size,
+ const mln_value(I)& value);
- template <typename I>
- inline
- void
- iota(trait::image::speed::any, I& input, unsigned base_index)
- {
- unsigned i = base_index;
- mln_piter(I) p(input.domain());
- for_all(p)
- input(p) = ++i % mln_max(mln_value(I));
- }
+ /// \overload
+ /// The border_size is set to 1.
+ template <typename I>
+ void
+ fill(Image<I>& input, const mln_value(I)& value);
- } // end of namespace mln::debug::impl
+# ifndef MLN_INCLUDE_ONLY
template <typename I>
- inline
void
- iota(Image<I>& input)
+ fill(Image<I>& input_, unsigned border_size,
+ const mln_value(I)& value)
{
- iota(input, 0);
- }
+ trace::entering("mln::inner_border::fill");
+ mln_precondition(exact(input).is_valid());
+ I& input = exact(input_);
+ mln_piter(I) p(input.domain());
+ for_all(p)
+ if (internal::on_frontiere(p, input.domain(), border_size))
+ input(p) = value;
+
+ trace::exiting("mln::inner_border::fill");
+ }
template <typename I>
- inline
void
- iota(Image<I>& input, unsigned base_index)
+ fill(Image<I>& input, const mln_value(I)& value)
{
- trace::entering("debug::iota");
- mln_precondition(exact(input).is_valid());
- impl::iota(mln_trait_image_speed(I)(), exact(input), base_index);
- trace::exiting("debug::iota");
+ fill(input, 1, value);
}
-
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::debug
+ } // end of namespace mln::inner_border
} // end of namespace mln
+#endif // ! MLN_INNER_BORDER_FILL_HH
-#endif // ! MLN_DEBUG_IOTA_HH
diff --git a/milena/mln/inner_border/internal/on_frontiere.hh b/milena/mln/inner_border/internal/on_frontiere.hh
new file mode 100644
index 0000000..49430a8
--- /dev/null
+++ b/milena/mln/inner_border/internal/on_frontiere.hh
@@ -0,0 +1,113 @@
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef MLN_INNER_BORDER_ON_FRONTIERE_HH
+# define MLN_INNER_BORDER_ON_FRONTIERE_HH
+
+/// \file
+///
+/// \brief Returns true if a site is included in the inner border of
+/// the image.
+
+# include <mln/core/image/image2d.hh>
+# include <mln/data/paste.hh>
+
+
+namespace mln
+{
+
+ namespace inner_border
+ {
+
+ namespace internal
+ {
+
+ /// \brief Returns true if a site is included in the inner
+ /// border of the image.
+ template <typename P>
+ bool
+ on_frontiere(const mln_site(box<P>)& p, const box<P>& b,
+ def::coord inner_border_size);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ // Implementation
+
+ inline
+ bool
+ on_frontiere_2d(const point2d& p, const box2d& b,
+ def::coord inner_border_size)
+ {
+ for (int d = 0; d < 2; ++d)
+ if ((p[d] >= b.pmin()[d]
+ && p[d] < (b.pmin()[d] + inner_border_size))
+ ||
+ (p[d] <= b.pmax()[d]
+ && p[d] > b.pmax()[d] - inner_border_size))
+ return true;
+ return false;
+ }
+
+ // Dispatch
+
+ inline
+ bool
+ on_frontiere_dispatch(const point2d& p, const box2d& b,
+ def::coord inner_border_size)
+ {
+ return on_frontiere_2d(p, b, inner_border_size);
+ }
+
+ template <typename P>
+ bool
+ on_frontiere_dispatch(const mln_site(box<P>)& p, const box<P>& b,
+ def::coord inner_border_size)
+ {
+ mlc_abort(P)::check(); // Not implemented.
+ return false;
+ }
+
+
+ // Facade
+
+ template <typename P>
+ bool
+ on_frontiere(const mln_site(box<P>)& p, const box<P>& b,
+ def::coord inner_border_size)
+ {
+ return on_frontiere_dispatch(p, b, inner_border_size);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::inner_border::internal
+
+ } // end of namespace mln::inner_border
+
+} // end of namespace mln
+
+#endif // ! MLN_INNER_BORDER_ON_FRONTIERE_HH
+
--
1.7.2.5