* mln/core/routine/mutable_extend.hh: New.
* headers.mk: Regen.
---
milena/ChangeLog | 7 +++
milena/headers.mk | 1 +
.../max_sli.hh => core/routine/mutable_extend.hh} | 47 ++++++++++----------
3 files changed, 31 insertions(+), 24 deletions(-)
copy milena/mln/{geom/max_sli.hh => core/routine/mutable_extend.hh} (59%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index eb4f2da..b95813a 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2010-09-09 Roland Levillain <roland(a)lrde.epita.fr>
+ Introduce a helper to build an mln::mutable_extension_ima.
+
+ * mln/core/routine/mutable_extend.hh: New.
+ * headers.mk: Regen.
+
+2010-09-09 Roland Levillain <roland(a)lrde.epita.fr>
+
Introduce an extension-by-mutable-image morpher.
* mln/core/image/dmorph/mutable_extension_ima.hh: New.
diff --git a/milena/headers.mk b/milena/headers.mk
index 7929341..9a33d4e 100644
--- a/milena/headers.mk
+++ b/milena/headers.mk
@@ -371,6 +371,7 @@ mln/core/routine/extend.hh \
mln/core/routine/init.hh \
mln/core/routine/init.hxx \
mln/core/routine/initialize.hh \
+mln/core/routine/mutable_extend.hh \
mln/core/routine/ops.hh \
mln/core/routine/primary.hh \
mln/core/site_set/all.hh \
diff --git a/milena/mln/geom/max_sli.hh b/milena/mln/core/routine/mutable_extend.hh
similarity index 59%
copy from milena/mln/geom/max_sli.hh
copy to milena/mln/core/routine/mutable_extend.hh
index cf4fc51..73f2672 100644
--- a/milena/mln/geom/max_sli.hh
+++ b/milena/mln/core/routine/mutable_extend.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -24,45 +24,44 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef MLN_GEOM_MAX_SLI_HH
-# define MLN_GEOM_MAX_SLI_HH
+#ifndef MLN_CORE_ROUTINE_MUTABLE_EXTEND_HH
+# define MLN_CORE_ROUTINE_MUTABLE_EXTEND_HH
/// \file
///
-/// Give the maximum sli of an image.
+/// Routine to extend a mutable image with a mutable extension.
+///
+/// \todo Use the 'instant' mechanism.
+/// \todo Deal with ambiguities.
+/// \todo Check that there is no extension yet (except "mutable_extendable").
+
+# include <mln/core/image/dmorph/mutable_extension_ima.hh>
-# include <mln/core/concept/image.hh>
-# include <mln/geom/bbox.hh>
namespace mln
{
- namespace geom
- {
-
- /// Give the maximum sli of an image.
- template <typename I>
- mln_deduce(I, site, coord) max_sli(const Image<I>& ima);
+ /// Extend a mutable image with a mutable image.
+ template <typename I, typename J>
+ mutable_extension_ima<I, J>
+ mutable_extend(Image<I>& ima, Image<J>& ext);
# ifndef MLN_INCLUDE_ONLY
- template <typename I>
- inline
- mln_deduce(I, site, coord) max_sli(const Image<I>& ima)
- {
- mln_precondition(exact(ima).is_valid());
- mln_deduce(I, site, coord) maxsli = geom::bbox(ima).pmax().sli();
-
- return maxsli;
- }
+ template <typename I, typename J>
+ mutable_extension_ima<I, J>
+ mutable_extend(Image<I>& ima, Image<J>& ext)
+ {
+ mlc_converts_to(mln_value(J), mln_value(I))::check();
+ mutable_extension_ima<I, J> tmp(exact(ima), exact(ext));
+ return tmp;
+ }
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::geom
-
} // end of namespace mln
-#endif // ! MLN_GEOM_MAX_SLI_HH
+#endif // ! MLN_CORE_ROUTINE_MUTABLE_EXTEND_HH
--
1.5.6.5