* mln/core/image/fun_image.hh: add default constructor and refactor
initialization.
---
milena/ChangeLog | 7 +++++++
milena/mln/core/image/fun_image.hh | 20 +++++++++++++++-----
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index f846446..8385bcd 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2009-02-03 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add default constructor to fun_image.
+
+ * mln/core/image/fun_image.hh: add default constructor and refactor
+ initialization.
+
+2009-02-03 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Fix step2 in tutorial.
* doc/tutorial/figures/tuto1_first_image-1.pbm,
diff --git a/milena/mln/core/image/fun_image.hh b/milena/mln/core/image/fun_image.hh
index acf2716..0099dde 100644
--- a/milena/mln/core/image/fun_image.hh
+++ b/milena/mln/core/image/fun_image.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 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
@@ -53,7 +53,7 @@ namespace mln
template <typename F, typename I>
struct data< fun_image<F,I> >
{
- data( I& ima);
+ data(I& ima);
I& ima_;
};
@@ -110,6 +110,9 @@ namespace mln
typedef fun_image< tag::value_<mln_result(F)>, tag::image_<I> >
skeleton;
/// Constructor.
+ fun_image();
+
+ /// Constructor.
fun_image(Image<I>& ima);
/// Initialize an empty image.
@@ -145,10 +148,17 @@ namespace mln
template <typename F, typename I>
inline
+ fun_image<F,I>::fun_image()
+ {
+ this->data_ = 0;
+ }
+
+
+ template <typename F, typename I>
+ inline
fun_image<F,I>::fun_image(Image<I>& ima)
{
- mln_precondition(exact(ima).is_valid());
- this->data_ = new internal::data< fun_image<F,I> >(exact(ima));
+ init_(ima);
}
--
1.5.6.5