---
milena/ChangeLog | 5 +++++
milena/mln/data/convert.hh | 24 ++++++++++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 3f29bbc..f25eaf7 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,10 @@
2013-04-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * mln/data/convert.hh: Introduce a new overload taking a
+ conversion function as parameter.
+
+2013-04-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add references to from_to_ overloads in documentation.
* mln/algebra/h_mat.hh,
diff --git a/milena/mln/data/convert.hh b/milena/mln/data/convert.hh
index 260baac..f004076 100644
--- a/milena/mln/data/convert.hh
+++ b/milena/mln/data/convert.hh
@@ -55,6 +55,18 @@ namespace mln
mln_ch_value(I, V)
convert(const V& v, const Image<I>& input);
+ /*!
+ \brief Convert the image \p input by changing the value type.
+ \overload
+
+ This overload allows to specify a specific conversion function
+ thanks to parameter \p convert_function.
+
+ \ingroup mlndata convert
+ */
+ template <typename F, typename I>
+ mln_ch_value(I, mln_result(F))
+ convert(const Function_v2v<F>& convert_function, const Image<I>&
input);
# ifndef MLN_INCLUDE_ONLY
@@ -163,6 +175,18 @@ namespace mln
return output;
}
+ template <typename F, typename I>
+ mln_ch_value(I, mln_result(F))
+ convert(const Function_v2v<F>& convert_function, const Image<I>&
input)
+ {
+ mln_trace("data::convert");
+ typedef mln_result(F) V;
+ internal::convert_tests(V(), input);
+
+ mln_ch_value(I, V) output = data::transform(input, convert_function);
+
+ return output;
+ }
# endif // ! MLN_INCLUDE_ONLY
--
1.7.2.5