URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-12-21 Simon Nivault <simon.nivault(a)lrde.epita.fr>
Fix for unit tests and moving initialize.
* mln/accu/median_alt.hh,
* mln/core/image2d.hh,
* mln/core/internal/image_base.hh,
* mln/level/was.median.hh,
* mln/linear/gaussian.hh: Fix.
* mln/core/concept/image.hh: Move initialize...
* mln/core/initialize.hh: New. ...here.
---
accu/median_alt.hh | 2 -
core/concept/image.hh | 30 -----------------
core/image2d.hh | 1
core/initialize.hh | 74 ++++++++++++++++++++++++++++++++++++++++++++
core/internal/image_base.hh | 3 -
level/was.median.hh | 7 ++++
linear/gaussian.hh | 5 ++
7 files changed, 88 insertions(+), 34 deletions(-)
Index: trunk/milena/mln/core/initialize.hh
===================================================================
--- trunk/milena/mln/core/initialize.hh (revision 0)
+++ trunk/milena/mln/core/initialize.hh (revision 1624)
@@ -0,0 +1,74 @@
+// Copyright (C) 2007 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_CORE_INITIALIZE_HH
+# define MLN_CORE_INITIALIZE_HH
+
+/*! \file mln/core/initialize.hh
+ *
+ * \brief Definition of function that initialize an image from another
+ * one.
+ */
+
+# include <mln/core/concept/image.hh>
+
+namespace mln
+{
+
+ /*! Initialize the image \p target with data extracted from image \p model.
+ *
+ * \param[in, out] target The image to be initialized.
+ * \param[in] model The image to provide data for the initialization.
+ *
+ * \pre (not target.has_data) and model.has_data
+ */
+ template <typename I, typename J>
+ void initialize(Image<I>& target, const Image<J>& model);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename I, typename J>
+ inline
+ void initialize(Image<I>& target, const Image<J>& model)
+ {
+ trace::entering("core::initialize");
+ mln_precondition(! exact(target).has_data());
+ mln_precondition(exact(model).has_data());
+
+ init_(tag::image, exact(target), exact(model));
+
+ mln_postcondition(exact(target).has_data());
+ trace::exiting("core::initialize");
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_INITIALIZE_HH
Index: trunk/milena/mln/core/internal/image_base.hh
===================================================================
--- trunk/milena/mln/core/internal/image_base.hh (revision 1623)
+++ trunk/milena/mln/core/internal/image_base.hh (revision 1624)
@@ -252,7 +252,4 @@
} // end of namespace mln
-# include <mln/core/init.hh>
-
-
#endif // ! MLN_CORE_INTERNAL_IMAGE_BASE_HH
Index: trunk/milena/mln/core/concept/image.hh
===================================================================
--- trunk/milena/mln/core/concept/image.hh (revision 1623)
+++ trunk/milena/mln/core/concept/image.hh (revision 1624)
@@ -117,19 +117,6 @@
};
-
- /*! Initialize the image \p target with data extracted from image \p model.
- *
- * \param[in, out] target The image to be initialized.
- * \param[in] model The image to provide data for the initialization.
- *
- * \pre (not target.has_data) and model.has_data
- */
- template <typename I, typename J>
- void initialize(Image<I>& target, const Image<J>& model);
-
-
-
# ifndef MLN_INCLUDE_ONLY
template <typename E>
@@ -181,25 +168,10 @@
m8 = 0;
}
- template <typename I, typename J>
- inline
- void initialize(Image<I>& target, const Image<J>& model)
- {
- trace::entering("core::initialize");
- mln_precondition(! exact(target).has_data());
- mln_precondition(exact(model).has_data());
-
- init_(tag::image, exact(target), exact(model));
-
- mln_postcondition(exact(target).has_data());
- trace::exiting("core::initialize");
- }
-
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
-
+# include <mln/core/initialize.hh>
#endif // ! MLN_CORE_CONCEPT_IMAGE_HH
Index: trunk/milena/mln/core/image2d.hh
===================================================================
--- trunk/milena/mln/core/image2d.hh (revision 1623)
+++ trunk/milena/mln/core/image2d.hh (revision 1624)
@@ -36,6 +36,7 @@
# include <mln/core/internal/image_primary.hh>
# include <mln/core/internal/fixme.hh>
# include <mln/core/box2d.hh>
+# include <mln/core/init.hh>
# include <mln/border/thickness.hh>
# include <mln/value/set.hh>
Index: trunk/milena/mln/level/was.median.hh
===================================================================
--- trunk/milena/mln/level/was.median.hh (revision 1623)
+++ trunk/milena/mln/level/was.median.hh (revision 1624)
@@ -35,6 +35,13 @@
# include <mln/geom/shift.hh>
# include <mln/core/window2d.hh>
+# include <mln/geom/min_col.hh>
+# include <mln/geom/max_col.hh>
+# include <mln/geom/max_row.hh>
+# include <mln/geom/min_row.hh>
+# include <mln/set/diff.hh>
+# include <mln/accu/median.hh>
+# include <mln/win/hline2d.hh>
namespace mln
{
Index: trunk/milena/mln/linear/gaussian.hh
===================================================================
--- trunk/milena/mln/linear/gaussian.hh (revision 1623)
+++ trunk/milena/mln/linear/gaussian.hh (revision 1624)
@@ -35,10 +35,13 @@
*/
# include <mln/core/concept/image.hh>
+# include <mln/core/point2d.hh>
# include <mln/level/paste.hh>
+# include <mln/geom/ncols.hh>
+# include <mln/geom/nrows.hh>
# include <vector>
-
+# include <cmath>
namespace mln
{
Index: trunk/milena/mln/accu/median_alt.hh
===================================================================
--- trunk/milena/mln/accu/median_alt.hh (revision 1623)
+++ trunk/milena/mln/accu/median_alt.hh (revision 1624)
@@ -71,7 +71,7 @@
protected:
- histo_on_set<S> h_;
+ histo<S> h_;
const S& s_; // derived from h_
std::size_t sum_minus_, sum_plus_;