URL:
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
ChangeLog:
2008-10-28 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Update gaussian facade.
* mln/linear/gaussian.hh: Return the output image.
* tests/linear/gaussian.cc: Update.
---
mln/linear/gaussian.hh | 20 +++++++++++---------
tests/linear/gaussian.cc | 5 +----
2 files changed, 12 insertions(+), 13 deletions(-)
Index: branches/cleanup-2008/milena/tests/linear/gaussian.cc
===================================================================
--- branches/cleanup-2008/milena/tests/linear/gaussian.cc (revision 2707)
+++ branches/cleanup-2008/milena/tests/linear/gaussian.cc (revision 2708)
@@ -53,10 +53,7 @@
image2d< value::int_u8 > lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
- image2d<float> tmp(lena.domain());
- linear::gaussian(lena, 5.1f, tmp);
+ image2d< value::int_u8 > out = linear::gaussian(lena, 5.1f);
- image2d< value::int_u_sat<8> > out(lena.domain());
- level::transform(tmp, math::round<int>(), out);
io::pgm::save(out, "out.pgm");
}
Index: branches/cleanup-2008/milena/mln/linear/gaussian.hh
===================================================================
--- branches/cleanup-2008/milena/mln/linear/gaussian.hh (revision 2707)
+++ branches/cleanup-2008/milena/mln/linear/gaussian.hh (revision 2708)
@@ -55,10 +55,9 @@
*
* \pre output.domain = input.domain
*/
- template <class I, class O>
- void
- gaussian(const Image<I>& input, float sigma,
- Image<O>& output);
+ template <class I>
+ mln_concrete(I)
+ gaussian(const Image<I>& input, float sigma);
# ifndef MLN_INCLUDE_ONLY
@@ -323,14 +322,15 @@
// Facade.
- template <class I, class O>
+ template <class I>
inline
- void
- gaussian(const Image<I>& input, float sigma,
- Image<O>& output)
+ mln_concrete(I)
+ gaussian(const Image<I>& input, float sigma)
{
mln_precondition(exact(input).has_data());
- mln_precondition(exact(output).has_data());
+
+ mln_concrete(I) output;
+ initialize(output, input);
impl::recursivefilter_coef_
coef(1.68f, 3.735f,
@@ -340,6 +340,8 @@
sigma);
impl::gaussian_common_(mln_trait_value_nature(mln_value(I))(),
input, coef, sigma, output);
+
+ return output;
}
# endif // ! MLN_INCLUDE_ONLY