
* mln/core/image/extension_fun.hh, * mln/core/image/extension_ima.hh, * mln/core/image/extension_val.hh: add extended_with routine. --- milena/ChangeLog | 8 ++++++++ milena/mln/core/image/extension_fun.hh | 14 +++++++++++++- milena/mln/core/image/extension_ima.hh | 13 +++++++++++++ milena/mln/core/image/extension_val.hh | 12 ++++++++++++ 4 files changed, 46 insertions(+), 1 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 5c7fdf4..999d18b 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,13 @@ 2009-02-20 Guillaume Lazzara <z@lrde.epita.fr> + Add extended_with routine. + + * mln/core/image/extension_fun.hh, + * mln/core/image/extension_ima.hh, + * mln/core/image/extension_val.hh: add extended_with routine. + +2009-02-20 Guillaume Lazzara <z@lrde.epita.fr> + Add implicit conversion from algebra::quat to algebra::vec. * mln/algebra/quat.hh: add implicit conversion operator to diff --git a/milena/mln/core/image/extension_fun.hh b/milena/mln/core/image/extension_fun.hh index c140283..0cd09b6 100644 --- a/milena/mln/core/image/extension_fun.hh +++ b/milena/mln/core/image/extension_fun.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -266,6 +267,17 @@ namespace mln target = model.extension(); } + template <typename I, typename F> + extension_fun<I,F> + extended_with(Image<I>& ima, const Function_v2v<F>& f) + { + mlc_not_equal(mln_trait_image_ext_domain(I), + trait::image::ext_domain::none)::check(); + mln_precondition(exact(ima).is_valid()); + extension_fun<I,F> tmp(exact(ima), exact(f)); + return tmp; + } + # endif // ! MLN_INCLUDE_ONLY } // end of namespace mln diff --git a/milena/mln/core/image/extension_ima.hh b/milena/mln/core/image/extension_ima.hh index 91055dd..98360b4 100644 --- a/milena/mln/core/image/extension_ima.hh +++ b/milena/mln/core/image/extension_ima.hh @@ -268,6 +268,19 @@ namespace mln target_ = ext_; } + + template <typename I, typename J> + extension_ima<I,J> + extended_with(Image<I>& ima, const Image<J> ext) + { + mlc_not_equal(mln_trait_image_ext_domain(I), + trait::image::ext_domain::none)::check(); + mln_precondition(exact(ima).is_valid()); + mln_precondition(exact(ext).is_valid()); + extension_ima<I,J> tmp(exact(ima), exact(ext)); + return tmp; + } + # endif // ! MLN_INCLUDE_ONLY } // end of namespace mln diff --git a/milena/mln/core/image/extension_val.hh b/milena/mln/core/image/extension_val.hh index 63dbeb7..45f1926 100644 --- a/milena/mln/core/image/extension_val.hh +++ b/milena/mln/core/image/extension_val.hh @@ -268,6 +268,18 @@ namespace mln target = static_cast<V>(model.extension()); } + template <typename I, typename J> + extension_ima<I,J> + extended_with(Image<I>& ima, const Image<J> ext) + { + mlc_not_equal(mln_trait_image_ext_domain(I), + trait::image::ext_domain::none)::check(); + mln_precondition(exact(ima).is_valid()); + mln_precondition(exact(ext).is_valid()); + extension_ima<I,J> tmp(exact(ima), exact(ext)); + return tmp; + } + # endif // ! MLN_INCLUDE_ONLY } // end of namespace mln -- 1.5.6.5