Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 9625 discussions
04 Jul '05
2005-07-04 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add 'rawness' characteristic (ability to reference data at p)
to images. Add corresponding attribute access object mechanism.
* oln/funobj/decl_attr.hh: New file.
* oln/funobj/abstract/accessor.hh: New file.
* oln/core/abstract/image_rawness.hh: New file.
* oln/core/gen/mfun.hh: New file.
* oln/core/gen/attr.hh: New file.
* oln/makefile.src: Update.
* oln/core/typedefs.hh: Update.
* oln/core/abstract/image.hh: Update.
* oln/core/abstract/image_entry.hh: Update.
* oln/core/pw/image.hh: Update.
* oln/funobj/abstract/unary.hh:
(munary::operator()): Make it more general.
* oln/core/abstract/image_neighbness.hh (impl_nbh_get()): Move
from class body to default impl.
* oln/core/abstract/data_storage.hh (at): New methods.
* oln/core/abstract/image_with_data.hh (impl_at): Likewise.
* oln/core/abstract/image_by_delegation.hh
(set_props): Add image_constness_type.
(ctors): Accept a box as input.
* oln/core/2d/array2d.hh (impl_at): New methods.
(impl_set, impl_get): Add fixme.
* oln/core/pw/unary_op.hh (ctor): Relax static check.
* oln/core/gen/image_with_nbh.hh: Add fixme.
* oln/core/gen/internal/value_box.hh: Add fixme.
* oln/morpho/dilation.hh (local): Add include.
* oln/morpho/erosion.hh (local): Add include.
(impl::erosion_): Add fixme.
* oln/morpho/thick_gradient.hh (gradient_beucher): Rename as...
(thick_gradient_beucher): ...This.
Index: ChangeLog
===================================================================
--- ChangeLog (revision 225)
+++ ChangeLog (working copy)
@@ -1,3 +1,15 @@
+2005-07-04 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
+
+ Add 'rawness' characteristic (ability to reference data at p)
+ to images. Add corresponding attribute access object mechanism.
+
+ * oln/funobj/decl_attr.hh: New file.
+ * oln/funobj/abstract/accessor.hh: New file.
+ * oln/core/abstract/image_rawness.hh: New file.
+ * oln/core/gen/mfun.hh: New file.
+ * oln/core/gen/attr.hh: New file.
+
+
2005-06-27 Christophe Berger <christophe(a)lrde.epita.fr>
* oln/appli/astro/tree_coherance_checks.hh: Remove.
Index: oln/funobj/decl_attr.hh
===================================================================
--- oln/funobj/decl_attr.hh (revision 0)
+++ oln/funobj/decl_attr.hh (revision 0)
@@ -0,0 +1,174 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_FUNOBJ_DECL_ATTR_HH
+# define OLENA_CORE_FUNOBJ_DECL_ATTR_HH
+
+# include <mlc/is_a.hh>
+# include <oln/funobj/abstract/accessor.hh>
+# include <oln/funobj/abstract/unary.hh>
+# include <oln/core/gen/attr.hh>
+
+
+/// Macro oln_decl_attr.
+
+# define oln_decl_attr(ATTR) \
+ \
+namespace oln \
+{ \
+ \
+ namespace a_ { \
+ \
+ struct ATTR : public f_::abstract::accessor< ATTR > \
+ { \
+ template <typename T> \
+ struct type \
+ { \
+ typedef typename T::ATTR##_type ret; \
+ }; \
+ template <typename T> \
+ typename T::ATTR##_type& operator()(T& t) const \
+ { \
+ return t.ATTR; \
+ } \
+ template <typename T> \
+ const typename T::ATTR##_type& operator()(const T& t) const \
+ { \
+ return t.ATTR; \
+ } \
+ }; \
+ \
+ } \
+ \
+ template <typename I> \
+ attr<a_::ATTR, I> a_##ATTR(abstract::image<I>& input) \
+ { \
+ mlc_is_a(I, abstract::raw_image)::ensure(); \
+ attr<a_::ATTR, I> tmp(input); \
+ return tmp; \
+ } \
+ \
+ template <typename I> \
+ attr<a_::ATTR, const I> a_##ATTR(const abstract::image<I>& input) \
+ { \
+ mlc_is_a(I, abstract::raw_image)::ensure(); \
+ attr<a_::ATTR, const I> tmp(input); \
+ return tmp; \
+ } \
+ \
+} \
+struct e_n_d__w_i_t_h__s_e_m_i_c_o_l_o_n
+
+
+
+
+// Dummy code for testing purpose.
+
+namespace oln
+{
+
+ namespace a_ {
+
+ struct dummy : public f_::abstract::accessor< dummy >
+ {
+ template <typename T>
+ struct type
+ {
+ typedef typename T::dummy_type ret;
+ };
+ template <typename T>
+ typename T::dummy_type& operator()(T& t) const
+ {
+ return t.dummy;
+ }
+ template <typename T>
+ const typename T::dummy_type& operator()(const T& t) const
+ {
+ return t.dummy;
+ }
+ };
+
+ } // end of namespace oln::a_
+
+
+ template <typename I>
+ attr<a_::dummy, I> a_dummy(abstract::image<I>& input)
+ {
+ mlc_is_a(I, abstract::raw_image)::ensure();
+ attr<a_::dummy, I> tmp(input);
+ return tmp;
+ }
+
+ template <typename I>
+ attr<a_::dummy, const I> a_dummy(const abstract::image<I>& input)
+ {
+ mlc_is_a(I, abstract::raw_image)::ensure();
+ attr<a_::dummy, const I> tmp(input);
+ return tmp;
+ }
+
+
+ // f_::a_dummy_<T> as a pure function
+
+ namespace f_ {
+ template <typename T> struct a_dummy_;
+ }
+
+ template <typename T>
+ struct set_super_type < f_::a_dummy_<T> > { typedef f_::abstract::unary< f_::a_dummy_<T> > ret; };
+
+ template <typename T>
+ struct set_props < category::fun1, f_::a_dummy_<T> >
+ {
+ typedef typename T::dummy_type res_type;
+ typedef T arg_type;
+ };
+
+ namespace f_ {
+
+ template <typename T>
+ struct a_dummy_ : public oln_super_of_(f_::a_dummy_<T>)
+ {
+ const typename T::dummy_type impl_unop(const T& t) const
+ {
+ return t.dummy;
+ }
+ };
+
+ } // end of namespace oln::f_
+
+ // f_dummy as a pure meta function
+
+ typedef f_::unary_meta<f_::a_dummy_> fa_dummy_type;
+ static fa_dummy_type fa_dummy;
+
+
+} // end of namespace oln
+
+
+
+#endif // ! OLENA_CORE_FUNOBJ_DECL_ATTR_HH
Index: oln/funobj/abstract/accessor.hh
===================================================================
--- oln/funobj/abstract/accessor.hh (revision 0)
+++ oln/funobj/abstract/accessor.hh (revision 0)
@@ -0,0 +1,56 @@
+// Copyright (C) 2001, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_FUNOBJ_ACCESSOR_HH
+# define OLENA_CORE_FUNOBJ_ACCESSOR_HH
+
+# include <mlc/any.hh>
+
+
+namespace oln {
+
+ namespace f_ {
+
+ namespace abstract {
+
+ /// Accessor.
+
+ template <typename A>
+ struct accessor : public mlc::any<A>
+ {
+ protected:
+ accessor() {}
+ };
+
+ } // end of namespace oln::f_::abstract
+
+ } // end of namespace oln::f_
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_FUNOBJ_ACCESSOR_HH
Index: oln/funobj/abstract/unary.hh
===================================================================
--- oln/funobj/abstract/unary.hh (revision 225)
+++ oln/funobj/abstract/unary.hh (working copy)
@@ -30,10 +30,19 @@
# include <mlc/any.hh>
# include <mlc/contract.hh>
+# include <mlc/if.hh>
+# include <mlc/is_a.hh>
# include <ntg/all.hh>
# include <oln/core/abstract/image.hh>
+# include <oln/core/gen/internal/value_box.hh>
+# include <oln/core/pw/abstract/function.hh>
+// FIXME: break cycling dependance due to...
+// FIXME: ...the recursive classes oln::pw::unary_op and oln::f_::abstract::munary
+// # include <oln/core/pw/unary_op.hh>
+
+
// Macros.
# define oln_fun1_type_of(Fun1Type, Alias) \
@@ -112,23 +121,116 @@
}
};
+
// munary
+ namespace internal {
+
+ // FIXME: move to internal/?
+
+ struct arg_is_a_value_box;
+ struct arg_is_a_point_wise_function;
+ struct arg_is_an_image;
+ struct arg_is_a_value;
+
+ template <typename E, typename Arg, typename arg_kind>
+ struct munary_on;
+
+ // on a value box
+ template <typename E, typename I>
+ struct munary_on <E, oln::value_box<I>, arg_is_a_value_box>
+ {
+ typedef typename munary_result<E, oln_type_of(I, value)>::ret ret;
+ static const ret exec(const E& target, const oln::value_box<I>& arg)
+ {
+ return target.impl_unop(arg.value());
+ }
+ };
+
+ // on a point-wise function
+// template <typename E, typename F>
+// struct munary_on <E, oln::pw::abstract::function<F>, arg_is_a_point_wise_function>
+// {
+// typedef oln::pw::unary_op<E,F> ret;
+// static const ret exec(const E& target, const oln::pw::abstract::function<F>& arg)
+// {
+// oln::pw::unary_op<E,F> tmp(arg);
+// return tmp;
+// }
+// };
+
+ // on a (regular) value
+ template <typename E, typename T>
+ struct munary_on <E, T, arg_is_a_value>
+ {
+ typedef typename munary_result<E, T>::ret ret;
+ static const ret exec(const E& target, const T& arg)
+ {
+ return target.impl_unop(arg);
+ }
+ };
+
+ // on an image
+ template <typename E, typename I>
+ struct munary_on <E, oln::abstract::image<I>, arg_is_an_image>
+ {
+ // FIXME: fake code here
+ typedef int ret;
+ static const ret exec(const E& target, const oln::abstract::image<I>& arg)
+ {
+ return 0;
+ }
+ };
+
+ template <typename E, typename Arg>
+ struct munary_helper
+ {
+ // arg_kind
+ typedef typename
+ mlc::if_< mlc_is_a(Arg, oln::value_box),
+ arg_is_a_value_box, typename
+ mlc::if_< mlc_is_a(Arg, oln::pw::abstract::function),
+ arg_is_a_point_wise_function, typename
+ mlc::if_< mlc_is_a(Arg, oln::abstract::image),
+ arg_is_an_image,
+ arg_is_a_value
+ >::ret
+ >::ret
+ >::ret
+ arg_kind;
+ // ret
+ typedef typename munary_on<E, Arg, arg_kind>::ret ret;
+ // exec
+ static const ret exec(const E& target, const Arg& arg)
+ {
+ return munary_on<E, Arg, arg_kind>::exec(target, arg);
+ }
+ };
+
+ } // end of namespace oln::f_::abstract::internal
+
+
template <typename E>
struct munary : public mlc::any<E>
{
template <typename T>
- const typename munary_result<E,T>::ret
+ struct helper : public internal::munary_helper<E,T>
+ {
+ // using internal::munary_helper<E,T>::ret;
+ // using internal::munary_helper<E,T>::exec;
+ };
+ template <typename T>
+ const typename helper<T>::ret
operator()(const T& arg) const
{
- return this->exact().impl_unop(arg);
+ return helper<T>::exec(this->exact(), arg);
}
protected:
munary() {}
};
- } // end of namespace oln::abstract
+ } // end of namespace oln::f_::abstract
@@ -157,6 +259,7 @@
static F<T> f;
return f(arg);
}
+
};
Index: oln/core/typedefs.hh
===================================================================
--- oln/core/typedefs.hh (revision 225)
+++ oln/core/typedefs.hh (working copy)
@@ -101,6 +101,7 @@
mlc_decl_typedef(image_dimension_type);
mlc_decl_typedef(image_typeness_type);
mlc_decl_typedef(image_valuedness_type);
+ mlc_decl_typedef(image_rawness_type);
// extension in image_operators
mlc_decl_typedef(output_type);
Index: oln/core/abstract/image.hh
===================================================================
--- oln/core/abstract/image.hh (revision 225)
+++ oln/core/abstract/image.hh (working copy)
@@ -48,9 +48,9 @@
{
template <typename I> class image_without_nbh;
template <typename I> class readonly_image;
+ template <typename I> class raw_image;
}
-
namespace category
{
struct image;
@@ -81,6 +81,7 @@
typedef is_a<abstract::image_without_nbh> image_neighbness_type;
typedef is_a<abstract::readonly_image> image_constness_type;
+ typedef mlc::undefined_type image_rawness_type;
typedef mlc::undefined_type image_dimension_type;
//...
@@ -112,6 +113,7 @@
typedef oln_type_of(I, image_neighbness) image_neighbness_type;
typedef oln_type_of(I, image_constness) image_constness_type;
+ typedef oln_type_of(I, image_rawness) image_rawness_type;
typedef oln_type_of(I, image_dimension) image_dimension_type;
//...
@@ -139,6 +141,7 @@
<< "\t image_neighbness_type = " << mlc_to_string(image_neighbness_type) << std::endl
<< "\t image_constness_type = " << mlc_to_string(image_constness_type) << std::endl
+ << "\t image_rawness_type = " << mlc_to_string(image_rawness_type) << std::endl
<< "\t image_dimension_type = " << mlc_to_string(image_dimension_type) << std::endl
<< "}" << std::endl;
@@ -162,6 +165,7 @@
mlc::is_ok< image_neighbness_type >::ensure();
mlc::is_ok< image_constness_type >::ensure();
+ mlc::is_ok< image_rawness_type >::ensure();
mlc::is_ok< image_dimension_type >::ensure();
}
};
Index: oln/core/abstract/image_rawness.hh
===================================================================
--- oln/core/abstract/image_rawness.hh (revision 0)
+++ oln/core/abstract/image_rawness.hh (revision 0)
@@ -0,0 +1,137 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_ABSTRACT_IMAGE_RAWNESS_HH
+# define OLENA_CORE_ABSTRACT_IMAGE_RAWNESS_HH
+
+# include <oln/core/abstract/image.hh>
+
+
+// image
+//
+// ^
+// |
+// ---------------
+// | |
+//
+// raw_image ...
+
+
+
+/*! \namespace oln
+** \brief oln namespace.
+*/
+namespace oln {
+
+
+ /*! \namespace oln::abstract
+ ** \brief oln::abstract namespace.
+ */
+ namespace abstract {
+
+
+
+
+ /*! \class abstract::raw_image<E>
+ **
+ ** Class of images whose data are read-only.
+ */
+
+
+ template <typename E>
+ struct raw_image : public virtual image<E>,
+ public internal::get_image_impl < raw_image<E>, E >
+ {
+ public:
+
+ typedef oln_type_of(E, point) point_type;
+ typedef oln_type_of(E, value_storage) value_storage_type;
+
+ value_storage_type& at(const point_type& p)
+ {
+# ifdef OLNTRACE
+ inc_ncalls("set", *this);
+# endif // ! OLNTRACE
+ return this->exact().impl_at(p);
+ }
+
+ const value_storage_type& at(const point_type& p) const
+ {
+# ifdef OLNTRACE
+ inc_ncalls("get", *this);
+# endif // ! OLNTRACE
+ return this->exact().impl_at(p);
+ }
+
+ protected:
+
+ /*! \brief Constructor (protected, empty).
+ */
+ raw_image() {}
+ };
+
+
+ template <typename E>
+ struct not_raw_image : public virtual image<E>
+ {
+ protected:
+ not_raw_image() {}
+ };
+
+
+
+ namespace internal {
+
+ template <typename E>
+ struct set_image_impl < raw_image<E>, E> : public virtual image_impl<E>
+ {
+ /// typedefs
+ typedef typename image_impl<E>::D D;
+ typedef oln_type_of(D, point) point_type;
+ typedef oln_type_of(D, value_storage) value_storage_type;
+
+ value_storage_type& at(const point_type& p)
+ {
+ return this->delegate().at(p);
+ }
+
+ const value_storage_type& at(const point_type& p) const
+ {
+ return this->delegate().at(p);
+ }
+ };
+
+ } // end of namespace oln::abstract::internal
+
+
+
+ } // end of namespace oln::abstract
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_ABSTRACT_IMAGE_RAWNESS_HH
Index: oln/core/abstract/image_neighbness.hh
===================================================================
--- oln/core/abstract/image_neighbness.hh (revision 225)
+++ oln/core/abstract/image_neighbness.hh (working copy)
@@ -42,30 +42,25 @@
template <typename E>
- struct image_with_nbh : public virtual image<E>
+ struct image_with_nbh : public virtual image<E>,
+ public internal::get_image_impl < image_with_nbh<E>, E >
{
public:
typedef oln_type_of(E, neighb) neighb_type;
- const neighb_type& nbh_get() const // FIXME: rename (?)
+ const neighb_type& nbh_get() const // FIXME: rename
{
return this->exact().impl_nbh_get();
}
- //FIXME: is it the right way ?
- const neighb_type& impl_nbh_get() const
- {
- return this->exact().delegate().nbh_get();
- }
-
protected:
image_with_nbh() {}
~image_with_nbh()
{
-// mlc_check_method_impl(E, const neighb_type&, nbh_get, , const);
+// mlc_check_method_impl(E, const neighb_type&, nbh, , const);
}
};
@@ -78,6 +73,24 @@
};
+
+ namespace internal {
+
+ template <typename E>
+ struct set_image_impl < image_with_nbh<E>, E> : public virtual image_impl<E>
+ {
+ typedef typename image_impl<E>::D D;
+ typedef oln_type_of(D, neighb) neighb_type;
+
+ const neighb_type& impl_nbh_get() const
+ {
+ return this->exact().delegate().nbh_get();
+ }
+ };
+
+ } // end of namespace oln::abstract::internal
+
+
} // end of namespace oln::abstract
} // end of namespace oln
Index: oln/core/abstract/data_storage.hh
===================================================================
--- oln/core/abstract/data_storage.hh (revision 225)
+++ oln/core/abstract/data_storage.hh (working copy)
@@ -140,7 +140,7 @@
return this->exact().impl_hold(p);
}
- const data_type get(const point_type& p) const
+ const data_type get(const point_type& p) const // FIXME: remove (obsolete)
{
precondition(this->has_data());
precondition(this->hold_large(p));
@@ -150,7 +150,7 @@
return this->exact().impl_get(p);
}
- void set(const point_type& p, const data_type& v)
+ void set(const point_type& p, const data_type& v) // FIXME: remove (obsolete)
{
precondition(this->has_data());
precondition(this->hold_large(p));
@@ -160,15 +160,26 @@
this->exact().impl_set(p, v);
}
+ const data_type& at(const point_type& p) const
+ {
+ precondition(this->has_data());
+ precondition(this->hold_large(p));
+# ifdef OLNTRACE
+ inc_ncalls("data_get", *this);
+# endif // ! OLNTRACE
+ return this->exact().impl_at(p);
+ }
- // FIXME: commented below cause unused...
-// void set_data(const data_type& v)
-// {
-// precondition(this->has_data());
-// this->exact().impl_set_data(v);
-// }
+ data_type& at(const point_type& p)
+ {
+ precondition(this->has_data());
+ precondition(this->hold_large(p));
+# ifdef OLNTRACE
+ inc_ncalls("data_set", *this);
+# endif // ! OLNTRACE
+ return this->exact().impl_at(p);
+ }
-
// polymorphic method with default
bool hold_large(const point_type& p) const
@@ -198,7 +209,8 @@
mlc_check_method_impl(E, unsigned long, npoints, , const);
mlc_check_method_impl(E, bool, hold, const point_type&, const);
mlc_check_method_impl(E, const data_type, get, const point_type&, const);
- mlc_check_method_impl(E, void, set_data, const data_type&, );
+ mlc_check_method_impl(E, const data_type&, at, const point_type&, const);
+ mlc_check_method_impl(E, data_type&, at, const point_type&, );
mlc_check_method_impl(E, bool, hold_large, const point_type&, const);
mlc_check_method_impl_2(E, void, resize_border, size_t, bool, );
mlc_check_method_impl_2(E, void, set, const point_type&, const data_type&, );
Index: oln/core/abstract/image_entry.hh
===================================================================
--- oln/core/abstract/image_entry.hh (revision 225)
+++ oln/core/abstract/image_entry.hh (working copy)
@@ -33,6 +33,7 @@
# include <oln/core/abstract/image_neighbness.hh>
# include <oln/core/abstract/image_typeness.hh>
# include <oln/core/abstract/image_valuedness.hh>
+# include <oln/core/abstract/image_rawness.hh>
@@ -58,6 +59,7 @@
public oln_type_of_(E, image_constness) ::template instantiated_with<E>::ret,
public oln_type_of_(E, image_dimension) ::template instantiated_with<E>::ret,
public oln_type_of_(E, image_neighbness) ::template instantiated_with<E>::ret,
+ public oln_type_of_(E, image_rawness) ::template instantiated_with<E>::ret,
// ...
public typeness::inheritance_switch<E>,
public valuedness::inheritance_switch<E>
Index: oln/core/abstract/image_with_data.hh
===================================================================
--- oln/core/abstract/image_with_data.hh (revision 225)
+++ oln/core/abstract/image_with_data.hh (working copy)
@@ -55,6 +55,7 @@
{
// intrusive property:
typedef is_a<abstract::readwrite_image> image_constness_type;
+ typedef is_a<abstract::raw_image> image_rawness_type;
typedef E concrete_type;
};
@@ -84,6 +85,7 @@
typedef oln_type_of(E, size) size_type;
typedef oln_type_of(E, point) point_type;
typedef oln_type_of(E, value) value_type;
+ typedef oln_type_of(E, value_storage) value_storage_type;
typedef oln_type_of(E, storage) storage_type;
@@ -190,6 +192,15 @@
(const_cast<storage_type&>(*this->data_)).resize_border(new_border, copy_border);
}
+ value_storage_type& impl_at(const point_type& p)
+ {
+ return this->data_->at(p);
+ }
+
+ const value_storage_type& impl_at(const point_type& p) const
+ {
+ return this->data_->at(p);
+ }
protected:
Index: oln/core/abstract/image_by_delegation.hh
===================================================================
--- oln/core/abstract/image_by_delegation.hh (revision 225)
+++ oln/core/abstract/image_by_delegation.hh (working copy)
@@ -54,6 +54,7 @@
: public get_props< category::image, I >
{
typedef I delegated_type;
+ // FIXME: what about storage_type?
};
template <typename I, typename E>
@@ -61,6 +62,8 @@
: public get_props< category::image, I >
{
typedef I delegated_type;
+ typedef is_a<abstract::readonly_image> image_constness_type;
+ // FIXME: what about storage_type?
};
@@ -80,12 +83,20 @@
this->exact_ptr = (E*)(void*)(this);
}
+ // FIXME: this ctor should be removed.
image_by_delegation(abstract::image<I>& image) :
image_(image.exact())
{
this->exact_ptr = (E*)(void*)(this);
}
+ /// Ctor with an image (in a box).
+ image_by_delegation(box<I> image) :
+ image_(image)
+ {
+ this->exact_ptr = (E*)(void*)(this);
+ }
+
image_by_delegation(const image_by_delegation& rhs) :
image_(rhs.image_)
{
@@ -122,12 +133,20 @@
this->exact_ptr = (E*)(void*)(this);
}
+ // FIXME: this ctor should be removed.
image_by_delegation(const abstract::image<I>& ima) :
image_(ima.exact())
{
this->exact_ptr = (E*)(void*)(this);
}
+ /// Ctor with an image (in a box).
+ image_by_delegation(box<const I> image) :
+ image_(image)
+ {
+ this->exact_ptr = (E*)(void*)(this);
+ }
+
image_by_delegation(const image_by_delegation& rhs) :
image_(rhs.image())
{
Index: oln/core/2d/array2d.hh
===================================================================
--- oln/core/2d/array2d.hh (revision 225)
+++ oln/core/2d/array2d.hh (working copy)
@@ -201,18 +201,30 @@
p.col() < size_.ncols() + size_.border();
}
- const T impl_get(const point2d& p) const
+ const T impl_get(const point2d& p) const // FIXME: remove (obsolete)
{
invariant_();
return array_[p.row()][p.col()];
}
- void impl_set(const point2d& p, const T& v)
+ void impl_set(const point2d& p, const T& v) // FIXME: remove (obsolete)
{
invariant_();
array_[p.row()][p.col()] = v;
}
+ const T& impl_at(const point2d& p) const
+ {
+ invariant_();
+ return array_[p.row()][p.col()];
+ }
+
+ T& impl_at(const point2d& p)
+ {
+ invariant_();
+ return array_[p.row()][p.col()];
+ }
+
// FIXME: should be impl_ here; and call should be defined in storage_type
template <typename T2, typename A, typename V>
void call(const point2d& p,
Index: oln/core/pw/image.hh
===================================================================
--- oln/core/pw/image.hh (revision 225)
+++ oln/core/pw/image.hh (working copy)
@@ -61,6 +61,8 @@
// FIXME: EXTREMELY AWFUL!!! we do not know if it is 2d...
typedef is_a<abstract::image2d> image_dimension_type;
+ typedef is_a<abstract::readonly_image> image_constness_type;
+ typedef is_a<abstract::not_raw_image> image_rawness_type;
typedef grid2d grid_type;
typedef fwd_piter2d piter_type;
Index: oln/core/pw/unary_op.hh
===================================================================
--- oln/core/pw/unary_op.hh (revision 225)
+++ oln/core/pw/unary_op.hh (working copy)
@@ -68,7 +68,8 @@
super_type(arg),
fun()
{
- mlc_is_a(F, f_::unary_meta)::ensure();
+ mlc_is_a(F, f_::abstract::munary)::ensure();
+// mlc_is_a(F, f_::unary_meta)::ensure();
}
typedef oln_pw_type_of(self_type, point) point_type;
Index: oln/core/gen/image_with_nbh.hh
===================================================================
--- oln/core/gen/image_with_nbh.hh (revision 225)
+++ oln/core/gen/image_with_nbh.hh (working copy)
@@ -149,6 +149,9 @@
return tmp;
}
+ // FIXME: add the 'const' version...
+
+
} // end of namespace oln
Index: oln/core/gen/mfun.hh
===================================================================
--- oln/core/gen/mfun.hh (revision 0)
+++ oln/core/gen/mfun.hh (revision 0)
@@ -0,0 +1,122 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_GEN_MFUN_HH
+# define OLENA_CORE_GEN_MFUN_HH
+
+# include <oln/core/abstract/image_by_delegation.hh>
+# include <oln/core/ch_value_type.hh>
+# include <oln/funobj/abstract/unary.hh>
+# include <oln/utils/record.hh>
+
+
+
+namespace oln {
+
+ // fwd decl
+ template <typename F, typename I> struct mfun;
+
+ // super type
+ template <typename F, typename I>
+ struct set_super_type < mfun<F, I> >
+ {
+ typedef abstract::image_by_delegation< const I, mfun<F, I> > ret;
+ };
+
+ // set props
+ template <typename F, typename I>
+ struct set_props < category::image, mfun<F, I> >
+ {
+ typedef is_a<abstract::not_raw_image> image_rawness_type;
+
+ typedef oln_type_of(I, value) I_value_type;
+ typedef typename f_::munary_result<F, I_value_type>::ret value_type;
+ typedef oln_ch_concrete_type(I, value_type) concrete_type;
+
+ typedef mlc::no_type value_storage_type;
+ typedef mlc::no_type storage_type; // FIXME: senseless?
+ };
+
+
+ template <typename F, typename I>
+ struct mfun : public abstract::image_by_delegation < const I, mfun<F, I> >
+ {
+ typedef mfun<F, I> self_type;
+ typedef abstract::image_by_delegation < const I, self_type > super_type;
+
+ typedef oln_type_of(self_type, point) point_type;
+ typedef oln_type_of(self_type, value) value_type;
+
+ public:
+
+ mfun()
+ {
+ }
+
+ mfun(box<const I> image) :
+ super_type(image)
+ {
+ }
+
+ mfun(box<const I> image, F f) :
+ super_type(image),
+ f(f)
+ {
+ }
+
+ mfun(box<const I> image, const std::string& name) :
+ super_type(image)
+ {
+ registering(*this, name);
+ }
+
+ mfun(box<const I> image, F f, const std::string& name) :
+ super_type(image),
+ f(f)
+ {
+ registering(*this, name);
+ }
+
+ // get
+
+ const value_type impl_get(const point_type& p) const
+ {
+ return f(this->delegate().get(p));
+ }
+
+ // FIXME: what about the methods "call(*)"?
+
+ protected:
+
+ F f;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_GEN_MFUN_HH
Index: oln/core/gen/attr.hh
===================================================================
--- oln/core/gen/attr.hh (revision 0)
+++ oln/core/gen/attr.hh (revision 0)
@@ -0,0 +1,125 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CORE_GEN_ATTR_HH
+# define OLENA_CORE_GEN_ATTR_HH
+
+# include <oln/core/abstract/image_by_delegation.hh>
+# include <oln/core/ch_value_type.hh>
+# include <oln/utils/record.hh>
+
+
+namespace oln {
+
+ // fwd decl
+ template <typename A, typename I> struct attr;
+
+ // super type
+ template <typename A, typename I>
+ struct set_super_type < attr<A, I> >
+ {
+ typedef abstract::image_by_delegation< I, attr<A, I> > ret;
+ };
+
+ // set props
+ template <typename A, typename I>
+ struct set_props < category::image, attr<A, I> >
+ {
+ typedef oln_type_of(I, value_storage) I_value_storage;
+
+ typedef typename A::template type<I_value_storage>::ret value_type;
+ typedef value_type value_storage_type;
+ typedef oln_ch_concrete_type(I, value_type) concrete_type;
+
+ typedef mlc::no_type storage_type; // FIXME: senseless?
+ };
+
+
+ template <typename A, typename I>
+ struct attr : public abstract::image_by_delegation < I, attr<A, I> >
+ {
+ typedef attr<A, I> self_type;
+ typedef abstract::image_by_delegation < I, self_type > super_type;
+
+ typedef oln_type_of(self_type, point) point_type;
+ typedef oln_type_of(self_type, value) value_type;
+ typedef oln_type_of(self_type, value_storage) value_storage_type;
+
+ public:
+
+ attr()
+ {
+ }
+
+ attr(box<I> image) :
+ super_type(image)
+ {
+ mlc_is_a(I, abstract::raw_image)::ensure();
+ }
+
+ attr(box<I> image, const std::string& name) :
+ super_type(image)
+ {
+ registering(*this, name);
+ }
+
+ // .at(p)
+
+ value_storage_type& impl_at(const point_type& p)
+ {
+ return a_of(this->delegate().at(p));
+ }
+
+ const value_storage_type& impl_at(const point_type& p) const
+ {
+ return a_of(this->delegate().at(p));
+ }
+
+ // get/set
+
+ void impl_set(const point_type& p, const value_type& v)
+ {
+ a_of(this->delegate().at(p)) = v;
+ }
+
+ const value_type impl_get(const point_type& p) const
+ {
+ return a_of(this->delegate().get(p));
+ }
+
+ // FIXME: what about the methods "call(*)"?
+
+ protected:
+
+ A a_of;
+ };
+
+
+} // end of namespace oln
+
+
+#endif // ! OLENA_CORE_GEN_ATTR_HH
Index: oln/core/gen/internal/value_box.hh
===================================================================
--- oln/core/gen/internal/value_box.hh (revision 225)
+++ oln/core/gen/internal/value_box.hh (working copy)
@@ -33,6 +33,7 @@
# include <oln/core/abstract/image.hh>
+// FIXME: not coherent cause in internal/ but not internal::
/*! \namespace oln
Index: oln/makefile.src
===================================================================
--- oln/makefile.src (revision 225)
+++ oln/makefile.src (working copy)
@@ -79,6 +79,7 @@
core/abstract/image_like_.hh \
core/abstract/image_neighbness.hh \
core/abstract/image_operator.hh \
+ core/abstract/image_rawness.hh \
core/abstract/image_typeness.hh \
core/abstract/image_valuedness.hh \
core/abstract/image_with_data.hh \
@@ -105,9 +106,11 @@
core/compose.hh \
core/coord.hh \
\
+ core/gen/attr.hh \
core/gen/identity.hh \
core/gen/image_with_nbh.hh \
core/gen/internal/value_box.hh \
+ core/gen/mfun.hh \
core/gen/regular_bkd_niter.hh \
core/gen/regular_bkd_qiter.hh \
core/gen/regular_fwd_niter.hh \
@@ -138,11 +141,13 @@
fancy/iota.hh \
fancy/print.hh \
\
+ funobj/abstract/accessor.hh \
funobj/abstract/binary.hh \
funobj/abstract/unary.hh \
funobj/accum.hh \
funobj/arith.hh \
funobj/cmp.hh \
+ funobj/decl_attr.hh \
funobj/infsup.hh \
funobj/invert.hh \
funobj/logic.hh \
Index: oln/morpho/dilation.hh
===================================================================
--- oln/morpho/dilation.hh (revision 225)
+++ oln/morpho/dilation.hh (working copy)
@@ -32,6 +32,7 @@
# include <oln/utils/record.hh>
# include <oln/basics.hh>
+# include <oln/morpho/local.hh>
# include <oln/core/2d/window2d.hh>
Index: oln/morpho/erosion.hh
===================================================================
--- oln/morpho/erosion.hh (revision 225)
+++ oln/morpho/erosion.hh (working copy)
@@ -32,6 +32,7 @@
# include <oln/utils/record.hh>
# include <oln/basics.hh>
+# include <oln/morpho/local.hh>
# include <oln/core/2d/window2d.hh>
@@ -62,6 +63,8 @@
registering(input, "input");
oln_type_of(I, concrete) output(input.size(), "output");
+ // FIXME: the use of .info() instead of .size() above would allow to create
+ // output with the proper neighborhood if input is an image_with_nbh...
oln_type_of(I, fwd_piter) p(input.size());
for_all_p (p)
Index: oln/morpho/thick_gradient.hh
===================================================================
--- oln/morpho/thick_gradient.hh (revision 225)
+++ oln/morpho/thick_gradient.hh (working copy)
@@ -30,8 +30,6 @@
# include <oln/morpho/dilation.hh>
# include <oln/morpho/erosion.hh>
-# include <oln/morpho/elementary_dilation.hh>
-# include <oln/morpho/elementary_erosion.hh>
# include <oln/morpho/temp.hh>
@@ -43,8 +41,8 @@
/// Beucher thick gradient.
template<typename I, typename W>
- oln_type_of(I, concrete) gradient_beucher(const abstract::image<I>& input,
- const abstract::window<W>& win)
+ oln_type_of(I, concrete) thick_gradient_beucher(const abstract::image<I>& input,
+ const abstract::window<W>& win)
{
mlc::eq<oln_type_of(I, grid), oln_wn_type_of(W, grid)>::ensure();
1
0
Index: ChangeLog
from Christophe Berger <christophe(a)lrde.epita.fr>
* oln/appli/astro/tree_coherance_checks.hh: Remove.
* oln/appli/astro/tree_coherence_check.hh: New.
tree_coherance_checks.hh | 354 -----------------------------------------------
tree_coherence_check.hh | 2
2 files changed, 1 insertion(+), 355 deletions(-)
Index: oln/appli/astro/tree_coherence_check.hh
--- oln/appli/astro/tree_coherence_check.hh (revision 224)
+++ oln/appli/astro/tree_coherence_check.hh (working copy)
@@ -345,7 +345,7 @@
}
- } // end of namespace coherance_check
+ } // end of namespace coherence_check
} // end of namespace maxtree
Index: oln/appli/astro/tree_coherance_checks.hh
--- oln/appli/astro/tree_coherance_checks.hh (revision 224)
+++ oln/appli/astro/tree_coherance_checks.hh (working copy)
@@ -1,354 +0,0 @@
-// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_APPLI_ASTRO_TREE_COHERENCE_CHECKS
-# define OLENA_APPLI_ASTRO_TREE_COHERENCE_CHECKS
-
-# include <mlc/any.hh>
-
-# include <oln/core/abstract/image_entry.hh>
-# include <oln/core/ch_value_type.hh>
-# include <oln/level/fill.hh>
-
-# include <oln/core/pw/check.hh>
-# include <oln/appli/astro/clean.hh>
-# include <oln/basics.hh>
-
-# include <queue>
-
-namespace oln {
-
- namespace maxtree {
-
- namespace coherence_check {
-
- /**
- ** Check if tree starts from an unique root point.
- **
- ** \param I Type of maxtree's image.
- **
- ** \arg tree Maxtree structure to check.
- **
- ** Check if the maxtree built has an unique starting
- ** point (global root point)
- **
- ** \warning Maxtree should have already been computed.
- **
- ** \code
- ** Algorithm used :
- ** The count of points that are parent of themselves
- ** should be exactly one.
- ** \endcode
- **
- ** \return true if tree is ok.
- **
- */
- template<typename I>
- bool
- global_root_unicity(oln::appli::astro::clean<I>& tree)
- {
- typedef oln_type_of(I, point) point_type;
- int count = 0;
- oln_type_of(I, fwd_piter) p(tree.input.size());
- for_all_p(p)
- {
- assert(tree.input.hold(p));
- if (tree.parent[p] == p)
- ++count;
- }
- assert(count == 1);
- if (count == 1)
- return true;
- else
- return false;
- }
-
- /**
- ** Check if parent relashionship is coherent in the tree.
- **
- ** \param I Type of maxtree's image.
- **
- ** \arg tree Maxtree structure to check.
- **
- ** \warning Maxtree should have already been computed.
- **
- ** \code
- ** Algorithm used :
- **
- ** for all points (p) from input
- ** check if children's parent is (p)
- **
- ** \endcode
- **
- ** \return true if relationships are ok.
- **
- */
- template<typename I>
- bool
- parent_relationship_integrity(oln::appli::astro::clean<I>& tree)
- {
- typedef oln_type_of(I, point) point_type;
- oln_type_of(I, fwd_piter) p(tree.input.size());
- for_all_p(p)
- {
- std::vector<point_type> child = tree.children[p];
- typename std::vector<point_type>::const_iterator pchild;
- for (pchild = child.begin();
- pchild != child.end();
- pchild++)
- {
- assert(tree.parent[*pchild] == p);
- if (tree.parent[*pchild] != p)
- return false;
- }
- }
- return true;
- }
-
- /**
- ** Check if children relashionship is coherent in the tree.
- **
- ** \param I Exact type of maxtree's image.
- **
- ** \arg tree maxtree structure to check.
- **
- ** \warning Maxtree should have already been computed.
- **
- ** \code
- ** Algorithm used :
- **
- ** For all points (p) of input
- ** if (p) is not the root
- ** search for parent (par) of p
- ** ensure (p) is contained in children of (par)
- ** else
- ** // nothing, root parent of hitself
- **
- ** \endcode
- **
- ** \return true if relationships are ok.
- **
- */
- template<typename I>
- bool
- children_relationship_integrity(oln::appli::astro::clean<I>& tree)
- {
- typedef oln_type_of(I, point) point_type;
- oln_type_of(I, fwd_piter) p(tree.input.size());
- for_all_p(p)
- {
- point_type par = tree.parent[p];
- bool found = false;
- if (par != p) // special case for the root
- {
- std::vector<point_type> child = tree.children[par];
- typename std::vector<point_type>::const_iterator pchild;
- for (pchild = child.begin();
- pchild != child.end() and not found;
- pchild++)
- {
- if (*pchild == p)
- found = true;
- }
- assert(found == true);
- if (not found)
- return false;
- }
- }
- return true;
- }
-
- /**
- ** Check if there is no recursion between parent and children.
- **
- ** \param I Exact type of maxtree's image.
- **
- ** \arg tree maxtree structure to check.
- **
- ** A node cannot be children of hitelf, this check if this
- ** property is satisfied.
- **
- ** \warning Maxtree should have already been computed.
- **
- ** \code
- ** Algorithm used :
- **
- ** For all points (p) of input
- ** for all children (c) of (p)
- ** ensure (c) is not (p)
- **
- ** \endcode
- **
- ** \return true if there is no recursion.
- **
- */
- template<typename I>
- bool
- no_children_recursion_check(oln::appli::astro::clean<I>& tree)
- {
- typedef oln_type_of(I, point) point_type;
- oln_type_of(I, fwd_piter) p(tree.input.size());
- for_all_p(p)
- {
- std::vector<point_type> child = tree.children[p];
- typename std::vector<point_type>::const_iterator pchild;
- for (pchild = child.begin();
- pchild != child.end();
- pchild++)
- {
- assert(*pchild != p);
- if (*pchild == p)
- return false;
- }
- }
- return true;
- }
-
-
- /**
- ** Check if maxtree construction was well done.
- **
- ** \param I Exact type of maxtree's image.
- **
- ** \arg tree maxtree structure to check.
- **
- ** The maxtree structure is based on Tarjan's Union-Find
- ** algorithm which works on decreasing point levels.
- ** This property guarantees that leafs are seen first in
- ** first pass order. The check exists to ensure this.
- **
- ** \warning Maxtree should have already been computed.
- **
- ** \code
- ** Algorithm used :
- **
- ** For all points (p) in decreasing order
- ** ensure parent of (p) was not seen before
- ** for all children (c) of (p)
- ** ensure they were seen before
- ** mark (p) as seen
- **
- ** \endcode
- **
- ** \return true if tree is good.
- **
- */
- template<typename I>
- bool
- check_child_seen_before_parent(oln::appli::astro::clean<I>& tree)
- {
- typedef oln_type_of(I, point) point_type;
- oln_ch_concrete_type(I, bool) seen(tree.input.size());
- level::fill(seen, false);
- typename std::vector<std::vector<point_type> >::reverse_iterator pvect;
- typename std::vector<point_type>::const_iterator p;
- for (pvect = tree.S.rbegin(); pvect != tree.S.rend(); pvect++)
- {
- for (p = pvect->begin(); p != pvect->end(); p++)
- {
- const std::vector<point_type> children = tree.children_get(*p);
- typename std::vector<point_type>::const_iterator pchild;
- assert(seen[tree.parent[*p]] == false);
- for (pchild = children.begin();
- pchild != children.end();
- pchild++)
- {
- assert(seen[*pchild] == true);
- if (seen[*pchild] != true)
- return false;
- }
- seen[*p] = true;
- }
- }
- return true;
- }
-
- /**
- ** Check if all points of the image are contained
- ** in the maxtree.
- **
- ** \param I Exact type of maxtree's image.
- **
- ** \arg tree maxtree structure to check.
- **
- ** Maxtree should cover the whole area of the base image.
- **
- ** \warning Maxtree should have already been computed.
- **
- ** \code
- ** Algorithm used :
- **
- ** Tree is traversed using breadth-first traversal with a queue.
- ** Every point is marked, at the end all the points must
- ** have been marked.
- **
- ** \endcode
- **
- ** \return True if all points were marked.
- **
- */
- template<typename I>
- bool
- complete_image_coverage(oln::appli::astro::clean<I>& tree)
- {
- typedef oln_type_of(I, point) point_type;
- oln_ch_concrete_type(I, bool) seen(tree.input.size());
- level::fill(seen, false);
- std::queue<point_type> q;
- q.push(tree.find_root(point_type(0,0)));
- while (not q.empty())
- {
- point_type &p = q.front();
- q.pop();
- const std::vector<point_type> children = tree.children_get(p);
- typename std::vector<point_type>::const_iterator pchild;
- assert(seen[p] == false);
- seen[p] = true;
- for (pchild = children.begin();
- pchild != children.end();
- pchild++)
- q.push(*pchild);
- }
-
- // FIXME : real pw::check function
- // return pw::check(pw::value(seen) == true);
- oln_type_of(I, fwd_piter) p(seen.size());
- for_all_p (p)
- if (not seen[p])
- return false;
- return true;
- // end FIXME
- }
-
-
- } // end of namespace coherance_check
-
- } // end of namespace maxtree
-
-} // end of namespace oln
-
-#endif // ! OLENA_APPLI_ASTRO_TREE_COHERENCE_CHECKS
1
0
Index: ChangeLog
from Christophe Berger <christophe(a)lrde.epita.fr>
* oln/makefile.src: Add astro files.
* oln/appli/astro/tree_coherance_checks.hh: Fix typo.
* oln/appli/astro/tree_statistics.hh: Fix typo.
appli/astro/tree_coherance_checks.hh | 12 ++++++------
appli/astro/tree_statistics.hh | 9 +++++----
makefile.src | 2 ++
3 files changed, 13 insertions(+), 10 deletions(-)
Index: oln/appli/astro/tree_statistics.hh
--- oln/appli/astro/tree_statistics.hh (revision 223)
+++ oln/appli/astro/tree_statistics.hh (working copy)
@@ -157,7 +157,7 @@
/**
- ** Makes the children per node average.
+ ** Compute the children per node average.
**
** \param I Type of maxtree's image.
**
@@ -178,7 +178,7 @@
**
*/
template<typename I>
- float children_average(oln::appli::astro::clean<I>& tree)
+ double children_average(oln::appli::astro::clean<I>& tree)
{
typedef oln_type_of(I, point) point_type;
std::queue<point_type> q;
@@ -212,7 +212,7 @@
**
** \warning Maxtree should have already been computed.
**
- ** This algorith is not the best way to compute max depth!
+ ** This algorithm is not the best way to compute max depth!
**
**
** \return Maximal depth of tree.
@@ -257,7 +257,8 @@
**
*/
template<typename I>
- void dotty_output(oln::appli::astro::clean<I>& tree, const std::string& filename)
+ void dotty_output(oln::appli::astro::clean<I>& tree,
+ const std::string& filename)
{
typedef oln_type_of(I, point) point_type;
std::queue<point_type> q;
Index: oln/appli/astro/tree_coherance_checks.hh
--- oln/appli/astro/tree_coherance_checks.hh (revision 223)
+++ oln/appli/astro/tree_coherance_checks.hh (working copy)
@@ -44,7 +44,7 @@
namespace maxtree {
- namespace coherance_check {
+ namespace coherence_check {
/**
** Check if tree starts from an unique root point.
@@ -146,7 +146,7 @@
** search for parent (par) of p
** ensure (p) is contained in children of (par)
** else
- ** // nothing, root parent of hiself
+ ** // nothing, root parent of hitself
**
** \endcode
**
@@ -189,7 +189,7 @@
**
** \arg tree maxtree structure to check.
**
- ** A node cannot be children of hiself, this check if this
+ ** A node cannot be children of hitelf, this check if this
** property is satisfied.
**
** \warning Maxtree should have already been computed.
@@ -236,7 +236,7 @@
**
** \arg tree maxtree structure to check.
**
- ** The maxtree structure is based on Tarjan's union find
+ ** The maxtree structure is based on Tarjan's Union-Find
** algorithm which works on decreasing point levels.
** This property guarantees that leafs are seen first in
** first pass order. The check exists to ensure this.
@@ -303,12 +303,12 @@
** Algorithm used :
**
** Tree is traversed using breadth-first traversal with a queue.
- ** Every points are marked, at the end all the points must
+ ** Every point is marked, at the end all the points must
** have been marked.
**
** \endcode
**
- ** \return True if all points where marked.
+ ** \return True if all points were marked.
**
*/
template<typename I>
Index: oln/makefile.src
--- oln/makefile.src (revision 223)
+++ oln/makefile.src (working copy)
@@ -7,6 +7,8 @@
all.hh \
\
appli/astro/clean.hh \
+ appli/astro/tree_coherance_checks.hh \
+ appli/astro/tree_statistics.hh \
\
basics1d.hh \
basics2d.hh \
1
0
Index: ChangeLog
from Christophe Berger <christophe(a)lrde.epita.fr>
* oln/appli/astro/graphical_interface/filterinterface.hh: Set the default
values at the beginning.
filterinterface.hh | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
Index: oln/appli/astro/graphical_interface/filterinterface.hh
--- oln/appli/astro/graphical_interface/filterinterface.hh (revision 221)
+++ oln/appli/astro/graphical_interface/filterinterface.hh (working copy)
@@ -51,9 +51,24 @@
sprintf(tmp_, "/tmp/olni.XXXXXX");
mkstemp(tmp_);
sprintf(tmp_ + 16, ".pgm");
+
+ Attribute_area();
+ Attribute_level();
+ Attribute_height();
+ Attribute_tower();
+ Attribute_tower();
+ Attribute_center_point();
+ Attribute_circle();
+ Attribute_height();
+ Attribute_level();
+ Attribute_area();
+ UpdateValues();
}
- ~FilterVisualizationWindow() {}
+ ~FilterVisualizationWindow()
+ {
+ unlink(tmp_);
+ }
virtual void UpdateValues()
{
@@ -82,8 +97,6 @@
this->redraw_button->setEnabled(true);
this->save_result_button->setEnabled(true);
this->text_state->setText("Tree computed, please choose attributes'values to draw the result.");
-
- UpdateValues();
}
virtual void DisplayImage()
1
0
Index: ChangeLog
from Christophe Berger <christophe(a)lrde.epita.fr>
* oln/appli/astro/graphical_interface/interface.pro: Modify interface appareance.
* oln/appli/astro/graphical_interface/visualization_window.ui: likewise.
* oln/appli/astro/graphical_interface/filterinterface.hh: likewise.
filterinterface.hh | 11 ----
interface.pro | 2
visualization_window.ui | 117 ++++++++++++++++--------------------------------
3 files changed, 44 insertions(+), 86 deletions(-)
Index: oln/appli/astro/graphical_interface/visualization_window.ui
--- oln/appli/astro/graphical_interface/visualization_window.ui (revision 215)
+++ oln/appli/astro/graphical_interface/visualization_window.ui (working copy)
@@ -272,47 +272,6 @@
</widget>
<widget class="QSpinBox">
<property name="name">
- <cstring>value_area_max</cstring>
- </property>
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>490</x>
- <y>130</y>
- <width>80</width>
- <height>31</height>
- </rect>
- </property>
- <property name="maxValue">
- <number>999999</number>
- </property>
- <property name="lineStep">
- <number>0</number>
- </property>
- <property name="value">
- <number>999999</number>
- </property>
- </widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>area_min_2</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>450</x>
- <y>130</y>
- <width>30</width>
- <height>31</height>
- </rect>
- </property>
- <property name="text">
- <string>max</string>
- </property>
- </widget>
- <widget class="QSpinBox">
- <property name="name">
<cstring>value_level</cstring>
</property>
<property name="enabled">
@@ -365,25 +324,9 @@
<string>%</string>
</property>
</widget>
- <widget class="QLabel">
- <property name="name">
- <cstring>textLabel2</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>440</x>
- <y>280</y>
- <width>20</width>
- <height>30</height>
- </rect>
- </property>
- <property name="text">
- <string>%</string>
- </property>
- </widget>
<widget class="QSpinBox">
<property name="name">
- <cstring>value_center_point</cstring>
+ <cstring>value_circle</cstring>
</property>
<property name="enabled">
<bool>true</bool>
@@ -391,7 +334,7 @@
<property name="geometry">
<rect>
<x>350</x>
- <y>280</y>
+ <y>230</y>
<width>80</width>
<height>31</height>
</rect>
@@ -399,21 +342,24 @@
<property name="maxValue">
<number>100</number>
</property>
+ <property name="value">
+ <number>90</number>
+ </property>
</widget>
<widget class="QLabel">
<property name="name">
- <cstring>textLabel2_2</cstring>
+ <cstring>area_min_2</cstring>
</property>
<property name="geometry">
<rect>
- <x>500</x>
- <y>330</y>
- <width>20</width>
- <height>30</height>
+ <x>440</x>
+ <y>130</y>
+ <width>30</width>
+ <height>31</height>
</rect>
</property>
<property name="text">
- <string>%</string>
+ <string>max</string>
</property>
</widget>
<widget class="QSpinBox">
@@ -422,7 +368,7 @@
</property>
<property name="geometry">
<rect>
- <x>420</x>
+ <x>430</x>
<y>330</y>
<width>70</width>
<height>31</height>
@@ -431,24 +377,49 @@
<property name="maxValue">
<number>100</number>
</property>
+ <property name="value">
+ <number>50</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>510</x>
+ <y>330</y>
+ <width>20</width>
+ <height>30</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>%</string>
+ </property>
</widget>
<widget class="QSpinBox">
<property name="name">
- <cstring>value_circle</cstring>
+ <cstring>value_area_max</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
- <x>350</x>
- <y>230</y>
+ <x>490</x>
+ <y>130</y>
<width>80</width>
<height>31</height>
</rect>
</property>
<property name="maxValue">
- <number>100</number>
+ <number>99999</number>
+ </property>
+ <property name="lineStep">
+ <number>0</number>
+ </property>
+ <property name="value">
+ <number>99999</number>
</property>
</widget>
</widget>
@@ -528,12 +499,6 @@
<slot>UpdateValues()</slot>
</connection>
<connection>
- <sender>value_center_point</sender>
- <signal>valueChanged(int)</signal>
- <receiver>visualisation_window</receiver>
- <slot>UpdateValues()</slot>
- </connection>
- <connection>
<sender>value_height</sender>
<signal>valueChanged(int)</signal>
<receiver>visualisation_window</receiver>
Index: oln/appli/astro/graphical_interface/interface.pro
Index: oln/appli/astro/graphical_interface/filterinterface.hh
--- oln/appli/astro/graphical_interface/filterinterface.hh (revision 215)
+++ oln/appli/astro/graphical_interface/filterinterface.hh (working copy)
@@ -62,7 +62,6 @@
mt_.set_level(value_level->value());
mt_.set_height(value_height->value());
mt_.set_circle(value_circle->value() / 100);
- mt_.set_center_point(value_center_point->value() / 100);
mt_.set_tower(value_tower->value() / 100);
std::string out = "attributes value changed.";// area("
@@ -172,15 +171,9 @@
virtual void Attribute_center_point()
{
if (this->active_center_point->isChecked())
- {
- this->value_center_point->setEnabled(true);
mt_.center_p_tag_ = true;
- }
else
- {
mt_.center_p_tag_ = false;
- this->value_center_point->setEnabled(false);
- }
}
virtual void Attribute_tower()
1
0
27 Jun '05
Index: ChangeLog
from Christophe Berger <christophe(a)lrde.epita.fr>
* oln/appli/astro/tree_coherance_checks.hh: New.
* oln/appli/astro/tree_statistics.hh: New.
* oln/canvas/tree.hh: Put the vector of sorted points in public.
This attribute is needed by checks and statistics functions.
appli/astro/tree_coherance_checks.hh | 354 +++++++++++++++++++++++++++++++++++
appli/astro/tree_statistics.hh | 260 +++++++++++++++++++++++++
canvas/tree.hh | 3
3 files changed, 615 insertions(+), 2 deletions(-)
Index: oln/appli/astro/tree_statistics.hh
--- oln/appli/astro/tree_statistics.hh (revision 0)
+++ oln/appli/astro/tree_statistics.hh (revision 0)
@@ -0,0 +1,260 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_APPLI_ASTRO_TREE_STATISTICS
+# define OLENA_APPLI_ASTRO_TREE_STATISTICS
+
+# include <mlc/any.hh>
+
+# include <oln/core/abstract/image_entry.hh>
+# include <oln/core/ch_value_type.hh>
+# include <oln/level/fill.hh>
+
+# include <oln/core/pw/check.hh>
+# include <oln/appli/astro/clean.hh>
+# include <oln/basics.hh>
+
+# include <queue>
+
+namespace oln {
+
+ namespace maxtree {
+
+ namespace statistics {
+
+ /**
+ ** Counts the number of leafs in the tree.
+ **
+ ** \param I Type of maxtree's image.
+ **
+ ** \arg tree Maxtree structure to check.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** \code
+ ** Algorithm used :
+ **
+ ** Tree is traversed using breadth-first traversal with a queue.
+ ** Increments count on leaf (no children).
+ **
+ ** \endcode
+ **
+ ** \return Number of leafs (terminal nodes).
+ **
+ */
+ template<typename I>
+ int leaf_count(oln::appli::astro::clean<I>& tree)
+ {
+ typedef oln_type_of(I, point) point_type;
+ std::queue<point_type> q;
+ q.push(tree.find_root(point_type(0,0)));
+ int count = 0;
+ while (not q.empty())
+ {
+ point_type &p = q.front();
+ q.pop();
+ const std::vector<point_type> children = tree.children_get(p);
+ typename std::vector<point_type>::const_iterator pchild;
+ if (children.empty())
+ ++count;
+ else
+ for (pchild = children.begin();
+ pchild != children.end();
+ pchild++)
+ q.push(*pchild);
+ }
+ return count;
+ }
+
+ /**
+ ** Counts the number of (internal) nodes in the tree.
+ **
+ ** \param I Type of maxtree's image.
+ **
+ ** \arg tree Maxtree structure to check.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** \code
+ ** Algorithm used :
+ **
+ ** Number of points - leafs count
+ **
+ ** \endcode
+ **
+ ** \return Number of internal nodes.
+ **
+ */
+ template<typename I>
+ int node_count(oln::appli::astro::clean<I>& tree)
+ {
+ return tree.input.width() * tree.input.height()
+ - leaf_count(tree);
+ }
+
+ /**
+ ** Makes the children per node average.
+ **
+ ** \param I Type of maxtree's image.
+ **
+ ** \arg tree Maxtree structure to check.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** \code
+ ** Algorithm used :
+ **
+ ** Tree is traversed using breadth-first traversal with a queue.
+ ** Counts the children and nodes, The average is
+ ** children_count / node_count.
+ **
+ ** \endcode
+ **
+ ** \return Children per node average.
+ **
+ */
+ template<typename I>
+ float children_average(oln::appli::astro::clean<I>& tree)
+ {
+ typedef oln_type_of(I, point) point_type;
+ std::queue<point_type> q;
+ q.push(tree.find_root(point_type(0,0)));
+ double node_count = 0;
+ double children_count = 0;
+ while (not q.empty())
+ {
+ point_type &p = q.front();
+ q.pop();
+ ++node_count;
+ const std::vector<point_type> children = tree.children_get(p);
+ typename std::vector<point_type>::const_iterator pchild;
+ for (pchild = children.begin();
+ pchild != children.end();
+ pchild++)
+ {
+ q.push(*pchild);
+ ++children_count;
+ }
+ }
+ return children_count / node_count;
+ }
+
+ /**
+ ** Max depth of tree.
+ **
+ ** \param I Type of maxtree's image.
+ **
+ ** \arg tree Maxtree structure to check.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** This algorith is not the best way to compute max depth!
+ **
+ **
+ ** \return Maximal depth of tree.
+ **
+ */
+ template<typename I>
+ int depth(oln::appli::astro::clean<I>& tree)
+ {
+ typedef oln_type_of(I, point) point_type;
+ oln_type_of(I, fwd_piter) p(tree.input.size());
+ int max_depth = 0;
+ for_all_p(p)
+ {
+ const std::vector<point_type> children = tree.children_get(p);
+ if (children.empty())
+ {
+ point_type q = p;
+ int depth = 0;
+ while (tree.parent[q] != q)
+ {
+ ++depth;
+ q = tree.parent[q];
+ }
+ max_depth = max_depth < depth ? depth : max_depth;
+ }
+ }
+ return max_depth;
+ }
+
+ /**
+ ** Graphical tree output with Dotty
+ ** (http://www.research.att.com/sw/tools/graphviz/)
+ **
+ ** \param I Type of maxtree's image.
+ **
+ ** \arg tree Maxtree structure to check.
+ ** \arg filename Output will be written to the file.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ **
+ **
+ */
+ template<typename I>
+ void dotty_output(oln::appli::astro::clean<I>& tree, const std::string& filename)
+ {
+ typedef oln_type_of(I, point) point_type;
+ std::queue<point_type> q;
+ q.push(tree.find_root(point_type(0,0)));
+
+
+ std::ofstream out(filename.c_str());
+
+ out << "digraph MaxtreeRepresentation {" << std::endl;
+
+ oln_type_of(I, fwd_piter) p(tree.input.size());
+ for_all_p(p)
+ {
+ out << '"' << p << "\";" << std::endl;
+ }
+ while (not q.empty())
+ {
+ point_type &p = q.front();
+ q.pop();
+ const std::vector<point_type> children = tree.children_get(p);
+ typename std::vector<point_type>::const_iterator pchild;
+ for (pchild = children.begin();
+ pchild != children.end();
+ pchild++)
+ {
+ q.push(*pchild);
+ out << '"' << p << "\" -> \"" << *pchild << "\";" << std::endl;
+ }
+ }
+ out << "}" << std::endl;
+ out.close();
+ }
+
+ } // end of namespace statistics
+
+ } // end of namespace maxtree
+
+} // end of namespace oln
+
+#endif // ! OLENA_APPLI_ASTRO_TREE_STATISTICS
Index: oln/canvas/tree.hh
--- oln/canvas/tree.hh (revision 210)
+++ oln/canvas/tree.hh (working copy)
@@ -182,13 +182,12 @@
// Attributes.
box<const I> input;
oln_type_of(I, concrete) output;
+ std::vector<std::vector<point_type> > S;
protected:
- std::vector<std::vector<point_type> > S;
oln_ch_concrete_type(I, T1) aux_data_;
std::vector<std::vector<T2> > aux_level_data_;
-
// Ctor.
tree(const abstract::image_with_nbh<I>& input) :
input(input),
Index: oln/appli/astro/tree_coherance_checks.hh
--- oln/appli/astro/tree_coherance_checks.hh (revision 0)
+++ oln/appli/astro/tree_coherance_checks.hh (revision 0)
@@ -0,0 +1,354 @@
+// Copyright (C) 2005 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, 59 Temple Place - Suite 330, 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 OLENA_APPLI_ASTRO_TREE_COHERENCE_CHECKS
+# define OLENA_APPLI_ASTRO_TREE_COHERENCE_CHECKS
+
+# include <mlc/any.hh>
+
+# include <oln/core/abstract/image_entry.hh>
+# include <oln/core/ch_value_type.hh>
+# include <oln/level/fill.hh>
+
+# include <oln/core/pw/check.hh>
+# include <oln/appli/astro/clean.hh>
+# include <oln/basics.hh>
+
+# include <queue>
+
+namespace oln {
+
+ namespace maxtree {
+
+ namespace coherance_check {
+
+ /**
+ ** Check if tree starts from an unique root point.
+ **
+ ** \param I Type of maxtree's image.
+ **
+ ** \arg tree Maxtree structure to check.
+ **
+ ** Check if the maxtree built has an unique starting
+ ** point (global root point)
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** \code
+ ** Algorithm used :
+ ** The count of points that are parent of themselves
+ ** should be exactly one.
+ ** \endcode
+ **
+ ** \return true if tree is ok.
+ **
+ */
+ template<typename I>
+ bool
+ global_root_unicity(oln::appli::astro::clean<I>& tree)
+ {
+ typedef oln_type_of(I, point) point_type;
+ int count = 0;
+ oln_type_of(I, fwd_piter) p(tree.input.size());
+ for_all_p(p)
+ {
+ assert(tree.input.hold(p));
+ if (tree.parent[p] == p)
+ ++count;
+ }
+ assert(count == 1);
+ if (count == 1)
+ return true;
+ else
+ return false;
+ }
+
+ /**
+ ** Check if parent relashionship is coherent in the tree.
+ **
+ ** \param I Type of maxtree's image.
+ **
+ ** \arg tree Maxtree structure to check.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** \code
+ ** Algorithm used :
+ **
+ ** for all points (p) from input
+ ** check if children's parent is (p)
+ **
+ ** \endcode
+ **
+ ** \return true if relationships are ok.
+ **
+ */
+ template<typename I>
+ bool
+ parent_relationship_integrity(oln::appli::astro::clean<I>& tree)
+ {
+ typedef oln_type_of(I, point) point_type;
+ oln_type_of(I, fwd_piter) p(tree.input.size());
+ for_all_p(p)
+ {
+ std::vector<point_type> child = tree.children[p];
+ typename std::vector<point_type>::const_iterator pchild;
+ for (pchild = child.begin();
+ pchild != child.end();
+ pchild++)
+ {
+ assert(tree.parent[*pchild] == p);
+ if (tree.parent[*pchild] != p)
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ ** Check if children relashionship is coherent in the tree.
+ **
+ ** \param I Exact type of maxtree's image.
+ **
+ ** \arg tree maxtree structure to check.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** \code
+ ** Algorithm used :
+ **
+ ** For all points (p) of input
+ ** if (p) is not the root
+ ** search for parent (par) of p
+ ** ensure (p) is contained in children of (par)
+ ** else
+ ** // nothing, root parent of hiself
+ **
+ ** \endcode
+ **
+ ** \return true if relationships are ok.
+ **
+ */
+ template<typename I>
+ bool
+ children_relationship_integrity(oln::appli::astro::clean<I>& tree)
+ {
+ typedef oln_type_of(I, point) point_type;
+ oln_type_of(I, fwd_piter) p(tree.input.size());
+ for_all_p(p)
+ {
+ point_type par = tree.parent[p];
+ bool found = false;
+ if (par != p) // special case for the root
+ {
+ std::vector<point_type> child = tree.children[par];
+ typename std::vector<point_type>::const_iterator pchild;
+ for (pchild = child.begin();
+ pchild != child.end() and not found;
+ pchild++)
+ {
+ if (*pchild == p)
+ found = true;
+ }
+ assert(found == true);
+ if (not found)
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ ** Check if there is no recursion between parent and children.
+ **
+ ** \param I Exact type of maxtree's image.
+ **
+ ** \arg tree maxtree structure to check.
+ **
+ ** A node cannot be children of hiself, this check if this
+ ** property is satisfied.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** \code
+ ** Algorithm used :
+ **
+ ** For all points (p) of input
+ ** for all children (c) of (p)
+ ** ensure (c) is not (p)
+ **
+ ** \endcode
+ **
+ ** \return true if there is no recursion.
+ **
+ */
+ template<typename I>
+ bool
+ no_children_recursion_check(oln::appli::astro::clean<I>& tree)
+ {
+ typedef oln_type_of(I, point) point_type;
+ oln_type_of(I, fwd_piter) p(tree.input.size());
+ for_all_p(p)
+ {
+ std::vector<point_type> child = tree.children[p];
+ typename std::vector<point_type>::const_iterator pchild;
+ for (pchild = child.begin();
+ pchild != child.end();
+ pchild++)
+ {
+ assert(*pchild != p);
+ if (*pchild == p)
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+ /**
+ ** Check if maxtree construction was well done.
+ **
+ ** \param I Exact type of maxtree's image.
+ **
+ ** \arg tree maxtree structure to check.
+ **
+ ** The maxtree structure is based on Tarjan's union find
+ ** algorithm which works on decreasing point levels.
+ ** This property guarantees that leafs are seen first in
+ ** first pass order. The check exists to ensure this.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** \code
+ ** Algorithm used :
+ **
+ ** For all points (p) in decreasing order
+ ** ensure parent of (p) was not seen before
+ ** for all children (c) of (p)
+ ** ensure they were seen before
+ ** mark (p) as seen
+ **
+ ** \endcode
+ **
+ ** \return true if tree is good.
+ **
+ */
+ template<typename I>
+ bool
+ check_child_seen_before_parent(oln::appli::astro::clean<I>& tree)
+ {
+ typedef oln_type_of(I, point) point_type;
+ oln_ch_concrete_type(I, bool) seen(tree.input.size());
+ level::fill(seen, false);
+ typename std::vector<std::vector<point_type> >::reverse_iterator pvect;
+ typename std::vector<point_type>::const_iterator p;
+ for (pvect = tree.S.rbegin(); pvect != tree.S.rend(); pvect++)
+ {
+ for (p = pvect->begin(); p != pvect->end(); p++)
+ {
+ const std::vector<point_type> children = tree.children_get(*p);
+ typename std::vector<point_type>::const_iterator pchild;
+ assert(seen[tree.parent[*p]] == false);
+ for (pchild = children.begin();
+ pchild != children.end();
+ pchild++)
+ {
+ assert(seen[*pchild] == true);
+ if (seen[*pchild] != true)
+ return false;
+ }
+ seen[*p] = true;
+ }
+ }
+ return true;
+ }
+
+ /**
+ ** Check if all points of the image are contained
+ ** in the maxtree.
+ **
+ ** \param I Exact type of maxtree's image.
+ **
+ ** \arg tree maxtree structure to check.
+ **
+ ** Maxtree should cover the whole area of the base image.
+ **
+ ** \warning Maxtree should have already been computed.
+ **
+ ** \code
+ ** Algorithm used :
+ **
+ ** Tree is traversed using breadth-first traversal with a queue.
+ ** Every points are marked, at the end all the points must
+ ** have been marked.
+ **
+ ** \endcode
+ **
+ ** \return True if all points where marked.
+ **
+ */
+ template<typename I>
+ bool
+ complete_image_coverage(oln::appli::astro::clean<I>& tree)
+ {
+ typedef oln_type_of(I, point) point_type;
+ oln_ch_concrete_type(I, bool) seen(tree.input.size());
+ level::fill(seen, false);
+ std::queue<point_type> q;
+ q.push(tree.find_root(point_type(0,0)));
+ while (not q.empty())
+ {
+ point_type &p = q.front();
+ q.pop();
+ const std::vector<point_type> children = tree.children_get(p);
+ typename std::vector<point_type>::const_iterator pchild;
+ assert(seen[p] == false);
+ seen[p] = true;
+ for (pchild = children.begin();
+ pchild != children.end();
+ pchild++)
+ q.push(*pchild);
+ }
+
+ // FIXME : real pw::check function
+ // return pw::check(pw::value(seen) == true);
+ oln_type_of(I, fwd_piter) p(seen.size());
+ for_all_p (p)
+ if (not seen[p])
+ return false;
+ return true;
+ // end FIXME
+ }
+
+
+ } // end of namespace coherance_check
+
+ } // end of namespace maxtree
+
+} // end of namespace oln
+
+#endif // ! OLENA_APPLI_ASTRO_TREE_COHERENCE_CHECKS
2
1
ChangeLog | 12 +++++
Makefile.am | 1
img/Makefile.am | 1
img/lena-small.pgm | 5 ++
oln/makefile.src | 4 +
oln/morpho/gradient.hh | 104 ++++++++++++++++++++++++++++++++++++++++++++
tests/morpho/tests/gradient | 48 ++++++++++++++++++++
7 files changed, 175 insertions(+)
Index: olena/ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add morphological gradients.
* oln/morpho/gradient.hh: New file.
* tests/morpho/tests/gradient: New test.
* img/lena-small.pgm: New image.
* img/Makefile.am (SOURCE_IMGS): Add $(srcdir)/lena-small.pgm.
* oln/makefile.src (OLN_DEP): Add convert/abstract/conversion.hh,
convert/conversion.hh, convert/force.hh and morpho/gradient.hh.
* Makefile.am (EXTRA_DIST): Add TODO.
2005-06-23 Roland Levillain <roland(a)lrde.epita.fr>
Index: olena/tests/morpho/tests/gradient
--- olena/tests/morpho/tests/gradient (révision 0)
+++ olena/tests/morpho/tests/gradient (révision 0)
@@ -0,0 +1,48 @@
+ // -*- C++ -*-
+#include "data.hh"
+#include <oln/utils/md5.hh>
+
+#include <ntg/int.hh>
+#include <oln/core/2d/image2d.hh>
+#include <oln/core/gen/image_with_nbh.hh>
+#include <oln/io/read_image.hh>
+#include <oln/io/write_image.hh>
+#include <oln/morpho/gradient.hh>
+
+using namespace oln;
+
+bool check()
+{
+ typedef image2d<ntg::int_u8> ima_type;
+ ima_type input;
+ input = io::read(rdata("lena-small.pgm"));
+
+ // Beucher gradient.
+ utils::key::value_type bg_data_key[16] =
+ {0x89, 0xaa, 0x5b, 0xca, 0x8, 0xec, 0xb3, 0xe7,
+ 0x86, 0xfb, 0x4b, 0x59, 0xf0, 0x8, 0xf5, 0x59};
+ utils::key bg_key(bg_data_key);
+ ima_type bg = morpho::beucher_gradient(input, win_c8p());
+ if (utils::md5(bg) != bg_key)
+ return true;
+
+ // Internal gradient.
+ utils::key::value_type ig_data_key[16] =
+ {0xe7, 0xff, 0x90, 0x2a, 0x50, 0x44, 0x30, 0x65,
+ 0xeb, 0xe3, 0xf2, 0xc4, 0x6f, 0xfe, 0x65, 0x84};
+ utils::key ig_key(ig_data_key);
+ ima_type ig = morpho::internal_gradient(input, win_c8p());
+ if (utils::md5(ig) != ig_key)
+ return true;
+
+ // External gradient.
+ utils::key::value_type eg_data_key[16] =
+ {0xf7, 0xb7, 0x9e, 0x74, 0xe0, 0xd1, 0xe7, 0xd8,
+ 0x5b, 0x0, 0xe8, 0x37, 0x57, 0xdc, 0x2c, 0x27};
+ utils::key eg_key(eg_data_key);
+ ima_type eg = morpho::external_gradient(input, win_c8p());
+ if (utils::md5(eg) != eg_key)
+ return true;
+
+ return false;
+}
Index: olena/oln/makefile.src
--- olena/oln/makefile.src (révision 216)
+++ olena/oln/makefile.src (copie de travail)
@@ -22,6 +22,9 @@
config/pconf.hh \
config/system.hh \
\
+ convert/abstract/conversion.hh \
+ convert/conversion.hh \
+ convert/force.hh \
convert/value_to_point.hh \
\
core/1d/array1d.hh \
@@ -166,6 +169,7 @@
morpho/erosion.hh \
morpho/geodesic_dilation.hh \
morpho/geodesic_erosion.hh \
+ morpho/gradient.hh \
morpho/lower_completion.hh \
morpho/opening.hh \
morpho/reconstruction_by_dilation.hh \
Index: olena/oln/morpho/gradient.hh
--- olena/oln/morpho/gradient.hh (révision 0)
+++ olena/oln/morpho/gradient.hh (révision 0)
@@ -0,0 +1,104 @@
+// Copyright (C) 2001, 2002, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_MORPHO_GRADIENT_HH
+# define OLENA_MORPHO_GRADIENT_HH
+
+# include <oln/morpho/dilation.hh>
+# include <oln/morpho/erosion.hh>
+# include <oln/level/arith.hh>
+# include <oln/convert/force.hh>
+# include <oln/core/ch_value_type.hh>
+
+namespace oln {
+
+ namespace morpho {
+
+ // FIXME: Document! (Get the documentation from Olena 0.10 and
+ // adjust it.)
+
+ template<class C, class B, class I, class W>
+ typename ch_value_type<I, typename convoutput<C, B, oln_type_of(I, value)>::ret>::ret
+ beucher_gradient(const convert::abstract::conversion<C, B>& c,
+ const abstract::scalar_valued_image<I>& input,
+ const abstract::window<W>& win)
+ {
+ return level::minus(c, dilation(input, win), erosion(input, win));
+ }
+
+ template<class I, class W>
+ oln_type_of(I, concrete)
+ beucher_gradient(const abstract::scalar_valued_image<I>& input,
+ const abstract::window<W>& win)
+ {
+ return beucher_gradient(convert::force<oln_type_of(I, value)>(),
+ input, win);
+ }
+
+
+ template<class C, class B, class I, class W>
+ typename ch_value_type<I, typename convoutput<C, B, oln_type_of(I, value)>::ret>::ret
+ internal_gradient(const convert::abstract::conversion<C, B>& c,
+ const abstract::scalar_valued_image<I>& input,
+ const abstract::window<W>& win)
+ {
+ return level::minus(c, input, erosion(input, win));
+ }
+
+ template<class I, class W>
+ oln_type_of(I, concrete)
+ internal_gradient(const abstract::scalar_valued_image<I>& input,
+ const abstract::window<W>& win)
+ {
+ return internal_gradient(convert::force<oln_type_of(I, value)>(),
+ input, win);
+ }
+
+
+ template<class C, class B, class I, class W>
+ typename ch_value_type<I, typename convoutput<C, B, oln_type_of(I, value)>::ret>::ret
+ external_gradient(const convert::abstract::conversion<C, B>& c,
+ const abstract::scalar_valued_image<I>& input,
+ const abstract::window<W>& win)
+ {
+ return level::minus(c, dilation(input, win), input);
+ }
+
+ template<class I, class W>
+ oln_type_of (I, concrete)
+ external_gradient(const abstract::scalar_valued_image<I>& input,
+ const abstract::window<W>& win)
+ {
+ return external_gradient(convert::force<oln_type_of(I, value)>(),
+ input, win);
+ }
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+#endif // OLENA_MORPHO_GRADIENT_HH
Index: olena/Makefile.am
--- olena/Makefile.am (révision 216)
+++ olena/Makefile.am (copie de travail)
@@ -3,3 +3,4 @@
# OLN_SRC_SUBDIRS is set when "configure" is run.
SUBDIRS = img oln $(OLN_SRC_SUBDIRS)
+EXTRA_DIST = TODO
Index: olena/img/Makefile.am
--- olena/img/Makefile.am (révision 216)
+++ olena/img/Makefile.am (copie de travail)
@@ -13,6 +13,7 @@
$(srcdir)/lena.pgm.gz \
$(srcdir)/lena.ppm \
$(srcdir)/lena.ppm.gz \
+ $(srcdir)/lena-small.pgm \
$(srcdir)/marker.pbm \
$(srcdir)/mask.pbm \
$(srcdir)/object.pbm \
1
0
23 Jun '05
ChangeLog | 10 ++++++
oln/level/arith.hh | 34 ++++++++++++++++++++
tests/level/tests/arith_and_conversion | 55 +++++++++++++++++++++++++++++++++
3 files changed, 99 insertions(+)
Index: olena/ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add level::minus taking a conversion function.
* oln/level/arith.hh
(minus (const convert::abstract::conversion<C, B>&,
const abstract::image<I1>&, const abstract::image<I2>& input2)):
New.
* tests/level/tests/arith_and_conversion: New test.
2005-06-23 Roland Levillain <roland(a)lrde.epita.fr>
Index: olena/oln/level/arith.hh
--- olena/oln/level/arith.hh (révision 216)
+++ olena/oln/level/arith.hh (copie de travail)
@@ -35,6 +35,7 @@
# include <oln/core/apply.hh>
# include <oln/ops/arith.hh>
+# include <oln/convert/conversion.hh>
# include <oln/utils/clone.hh>
@@ -169,6 +170,39 @@
return output;
}
+ // Variant taking a conversion function in parameter.
+ template <typename C, typename B, typename I1, typename I2>
+ typename ch_value_type<I1, typename convoutput<C, B, typename arith_output<f_::minus_, I1, I2>::T>::ret>::ret
+ minus (const convert::abstract::conversion<C, B>& conv,
+ const abstract::image<I1>& input1,
+ const abstract::image<I2>& input2)
+ {
+ mlc::eq<oln_type_of(I1, grid), oln_type_of(I2, grid)>::ensure();
+
+ entering("level::minus");
+ registering(input1, "input1");
+ registering(input2, "input2");
+
+ precondition(input1.size() == input2.size());
+
+ typedef oln_type_of(I1, value) T1;
+ typedef oln_type_of(I2, value) T2;
+
+ // The return type, if there were no conversion.
+ typedef typename arith_output<f_::minus_, I1, I2>::T oper_output_type;
+ // The actual return type.
+ typedef typename
+ ch_value_type<I1,
+ typename convoutput<C, B, oper_output_type>::ret>::ret
+ output_type;
+ output_type output("output");
+ output = apply2(convert::compconv2(conv, f_::minus_<T1, T2>()),
+ input1, input2);
+
+ exiting("level::minus");
+ return output;
+ }
+
// times
Index: olena/tests/level/tests/arith_and_conversion
--- olena/tests/level/tests/arith_and_conversion (révision 0)
+++ olena/tests/level/tests/arith_and_conversion (révision 0)
@@ -0,0 +1,55 @@
+ // -*- C++ -*-
+#include <ntg/int.hh>
+#include <oln/basics2d.hh>
+#include <oln/convert/force.hh>
+#include <oln/level/arith.hh>
+#include <oln/level/fill.hh>
+#include <oln/level/compare.hh>
+
+using namespace oln;
+
+
+// FIXME: Not safe, nor generic. Re-introduce static initialization
+// in Olena and use it instead.
+template<typename T>
+image2d<T>
+image_from_array(coord_t nrows, coord_t ncols, T values[])
+{
+ image2d<T> output(nrows, ncols);
+ unsigned i = 0;
+ oln_type_of(image2d<T>, fwd_piter) p(output.size());
+ for_all_p (p)
+ {
+ output[p] = values[i];
+ ++i;
+ }
+ return output;
+}
+
+
+bool check()
+{
+ typedef ntg::int_u8 value_type;
+
+ value_type ima1_values[] = { 2, 8, 2,
+ 3, 4, 5,
+ 6, 7, 8 };
+ image2d<value_type> ima1 = image_from_array<value_type>(3, 3, ima1_values);
+
+ image2d<value_type> ima2(3, 3);
+ level::fill(ima2, 2);
+
+ // Checking level::minus, with convert::force conversion.
+ {
+ image2d<value_type> diff =
+ level::minus(convert::force<value_type>(), ima1, ima2);
+ value_type diff_ref[] = { 0, 6, 0,
+ 1, 2, 3,
+ 4, 5, 6 };
+ if (not level::is_equal(diff,
+ image_from_array<value_type>(3, 3, diff_ref)))
+ return true;
+ }
+
+ return false;
+}
1
0
23 Jun '05
ChangeLog | 16 +
TODO | 17 +
oln/convert/abstract/conversion.hh | 358 +++++++++++++++++++++++++++++++++++++
oln/convert/conversion.hh | 174 +++++++++++++++++
oln/convert/force.hh | 63 ++++++
oln/core/apply.hh | 30 ++-
oln/funobj/compose.hh | 45 ++++
tests/convert/tests/force | 22 ++
8 files changed, 717 insertions(+), 8 deletions(-)
Index: olena/ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add conversion abstractions.
* oln/convert/abstract/conversion.hh, oln/convert/conversion.hh:
New files.
Add convert::force operator.
* oln/convert/force.hh: New file.
* tests/convert/tests/force: New test.
* oln/funobj/compose.hh (f_::identity_): New functor.
* oln/core/apply.hh: Update doxygen comments.
* TODO: New file.
Index: olena/oln/convert/abstract/conversion.hh
--- olena/oln/convert/abstract/conversion.hh (révision 0)
+++ olena/oln/convert/abstract/conversion.hh (révision 0)
@@ -0,0 +1,179 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CONVERT_ABSTRACT_CONVERSION_HH
+# define OLENA_CONVERT_ABSTRACT_CONVERSION_HH
+
+# include <ntg/utils/debug.hh>
+# include <functional>
+
+namespace oln {
+
+ namespace convert {
+ /*!
+ ** \brief Base classes for conversion.
+ */
+ namespace abstract {
+
+ // fwd_decl
+ template <class Exact, class Base>
+ class conversion;
+
+ template<class Result_Type,
+ class Exact, class Base>
+ struct conversion_to_type;
+
+ template<class Argument_Type, class Result_Type,
+ class Exact, class Base>
+ struct conversion_from_type_to_type;
+
+ template<class Conv>
+ struct conversion_traits;
+
+ /*! \brief Internal purpose only.
+ */
+ namespace internal {
+ /// Retrieve the result type of a conversion.
+ template <class Base, class T>
+ struct output {};
+
+ template <class Argument_Type, class Result_Type,
+ class Exact, class Base>
+ struct output<conversion_from_type_to_type<Argument_Type, Result_Type, Exact, Base >, Argument_Type>
+ {
+ typedef Result_Type ret;
+ };
+
+ template <class Result_Type,
+ class Exact, class Base, class T>
+ struct output<conversion_to_type<Result_Type, Exact, Base >, T>
+ {
+ typedef Result_Type ret;
+ };
+
+ } // end of namespace oln::convert::abstract::internal
+
+ } // end of namespace oln::convert::abstract
+
+ namespace abstract {
+
+ /*! Base class for conversion.
+ **
+ ** \note If you write an class derived from this one, you
+ ** must write the specialization of the output trait.
+ */
+ template<class Exact, class Base>
+ struct conversion : public mlc::any< Exact >
+ {
+ static std::string
+ name()
+ {
+ return std::string("conversion<") + Exact::name() + ">";
+ }
+
+ public:
+ template<class T>
+ struct output
+ {
+ typedef typename internal::output<Base, T>::ret ret;
+ };
+
+ /// Call the conversion written in the exact class.
+ template <class T>
+ typename output<T>::ret
+ operator()(const T& in) const
+ {
+ return this->exact().doit(in);
+ }
+
+ protected:
+ conversion() {}
+ };
+
+ /// Base class for the conversion to a specific type.
+ template<class Result_Type, class Exact,
+ class Base = conversion_to_type<Result_Type, Exact, Exact> >
+ struct conversion_to_type :
+ public conversion< Exact, Base >
+ {
+ /* Additionally define result_type. This is not required
+ in a conversion class (generally not possible to define).
+ But it's useful when it's available (like here)
+ because it make the conversion appear almost as Adaptable
+ Unary Function (it will just lack the argument_type, but
+ this typedef is not used very much.) */
+
+ typedef Result_Type result_type;
+
+ static std::string
+ name()
+ {
+ // FIXME: Exact is not an integre type !
+ return std::string("conversion_to_type<")
+ + ntg_name(Result_Type) + ", "
+ + Exact::name() + ">";
+ }
+
+ protected:
+ conversion_to_type() {}
+ };
+
+ /// Base class if both input and output types of the conversion
+ /// are fixed.
+ template<class Argument_Type, class Result_Type, class Exact,
+ class Base = conversion_from_type_to_type<Argument_Type, Result_Type, Exact, Exact> >
+ struct conversion_from_type_to_type:
+ public conversion_to_type< Result_Type, Exact , Base >
+ {
+
+ /* By defining argument_type, and inheriting from result_type,
+ we comply to the STL concept of Adaptable Unary Function. */
+
+ typedef Argument_Type argument_type;
+
+ static std::string
+ name()
+ {
+ // FIXME: Exact is not an integre type !
+ return std::string("conversion_from_type_to_type<")
+ + ntg_name(Argument_Type) + ", "
+ + ntg_name(Result_Type) + ", "
+ + "FIXME: ntg_name(Exact)" + ">";
+ }
+
+ protected :
+ conversion_from_type_to_type() {}
+ };
+
+ } // end of namespace oln::convert::abstract
+
+ } // end of namespace oln::convert
+
+} // end of namespace oln
+
+
+#endif // OLENA_CONVERT_ABSTRACT_CONVERSION_HH
Index: olena/oln/convert/conversion.hh
--- olena/oln/convert/conversion.hh (révision 0)
+++ olena/oln/convert/conversion.hh (révision 0)
@@ -0,0 +1,174 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CONVERT_CONVERSION_HH
+# define OLENA_CONVERT_CONVERSION_HH
+
+# include <oln/core/abstract/image.hh>
+# include <oln/core/ch_value_type.hh>
+# include <oln/funobj/abstract/unary.hh>
+# include <oln/funobj/abstract/binary.hh>
+# include <oln/convert/abstract/conversion.hh>
+
+namespace oln {
+ /*!
+ ** \brief Conversion implementation (for example cast, color, or
+ ** neighborhood to window).
+ */
+ namespace convert {
+
+ /// \brief Internal purpose only.
+ namespace internal {
+ template <typename C, typename UF> struct compconv1_;
+ template <typename C, typename BF> struct compconv2_;
+ } // end of namespace oln::convert::internal
+
+ } // end of namespace oln::convert
+
+ template <typename C, typename UF>
+ struct set_super_type < convert::internal::compconv1_<C, UF> > { typedef f_::abstract::unary< convert::internal::compconv1_<C, UF> > ret; };
+
+ template <typename C, typename BF>
+ struct set_super_type < convert::internal::compconv2_<C, BF> > { typedef f_::abstract::binary< convert::internal::compconv2_<C, BF> > ret; };
+
+ template <typename C, typename UF>
+ struct set_props < category::fun1, convert::internal::compconv1_<C, UF> >
+ {
+ typedef oln_fun1_type_of(UF, arg) arg_type;
+ typedef typename C::template output<oln_fun1_type_of(UF, res)>::ret
+ res_type;
+ };
+
+ template <typename C, typename BF>
+ struct set_props < category::fun2, convert::internal::compconv2_<C, BF> >
+ {
+ typedef oln_fun2_type_of(BF, left) left_type;
+ typedef oln_fun2_type_of(BF, right) right_type;
+ typedef typename C::template output<oln_fun2_type_of(BF, res)>::ret
+ res_type;
+ };
+
+ namespace convert {
+
+ /*! Trait that returns the output of a conversion.
+ **
+ ** convoutput queries the output type of conversion ConvType for
+ ** an input of type InputType. This comes handy when computing
+ ** the return type of a function which takes a conversion function
+ ** in argument.
+ **
+ ** \note convoutput is exported in the namespace oln for convenience.
+ */
+ template<class ConvType, class Base, class InputType>
+ struct convoutput
+ {
+ typedef typename abstract::conversion<ConvType, Base>::template output<InputType>::ret ret;
+ };
+
+ namespace internal {
+
+ /*! Compose a conversion C and an unary functor UF, producing an
+ ** unary functor.
+ */
+ template <class C, class UF>
+ struct compconv1_ : public oln_super2_of_(compconv1_<C, UF>)
+ {
+ typedef compconv1_<C, UF> self_type;
+ typedef oln_fun1_type_of(self_type, arg) arg_type;
+ typedef oln_fun1_type_of(self_type, res) res_type;
+
+ compconv1_(const C& conv, const UF& func) :
+ conv_(conv.exact()), func_(func.exact())
+ {
+ }
+
+ const res_type impl_unop(const arg_type& arg) const
+ {
+ return conv_(func_(arg));
+ }
+
+ private:
+ const C conv_;
+ const UF func_;
+ };
+
+ /*! Compose a conversion C and a binary functor BF, producing
+ ** a binary functor.
+ */
+ template <class C, class BF>
+ struct compconv2_ : public oln_super2_of_(compconv2_<C, BF>)
+ {
+ typedef compconv2_<C, BF> self_type;
+ typedef oln_fun2_type_of(self_type, left) left_type;
+ typedef oln_fun2_type_of(self_type, right) right_type;
+ typedef oln_fun2_type_of(self_type, res) res_type;
+
+ compconv2_(const C& conv, const BF& func) :
+ conv_(conv.exact()), func_(func.exact())
+ {
+ }
+
+ const res_type impl_binop(const left_type& left,
+ const right_type& right) const
+ {
+ return conv_(func_(left, right));
+ }
+
+ private:
+ const C conv_;
+ const BF func_;
+ };
+
+ } // end of namespace oln::convert::internal
+
+ /*! Friendly procedure that build an internal::compconv1_ with
+ ** type deduction.
+ */
+ template <class C, class B, class UF>
+ internal::compconv1_<C, UF>
+ compconv1(const abstract::conversion<C, B>& conv, const UF &func)
+ {
+ return internal::compconv1_<C, UF>(conv.exact(), func);
+ }
+
+ /*! Likewise for compconv2_. */
+ template <class C, class B, class BF>
+ internal::compconv2_<C, BF>
+ compconv2(const abstract::conversion<C, B>& conv, const BF &func)
+ {
+ return internal::compconv2_<C, BF>(conv.exact(), func);
+ }
+
+ } // end of namespace oln::convert
+
+ // Export conversion and convouput into oln:: to simplify the
+ // writing of processings.
+ using convert::convoutput;
+
+} // end of namespace oln
+
+#endif // OLENA_CONVERT_CONVERSION_HH
Index: olena/oln/convert/force.hh
--- olena/oln/convert/force.hh (révision 0)
+++ olena/oln/convert/force.hh (révision 0)
@@ -0,0 +1,63 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CONVERT_FORCE_HH
+# define OLENA_CONVERT_FORCE_HH
+
+# include <oln/convert/abstract/conversion.hh>
+# include <ntg/utils/cast.hh>
+
+namespace oln {
+
+ namespace convert {
+
+ /*! Like cast::force, but as a conversion functor. */
+ template<class Output>
+ struct force : public abstract::conversion_to_type< Output, force<Output> >
+ {
+ template< class Input >
+ Output
+ doit(const Input& v) const
+ {
+ return ntg::cast::force<Output>(v);
+ }
+
+ static std::string
+ name()
+ {
+ // FIXME: Exact is not an integre type !
+ return std::string("force<")
+ + ntg_name(Output) + ">";
+ }
+ };
+
+ } // end of namespace oln::convert
+
+} // end of namespace oln
+
+#endif // OLENA_CONVERT_FORCE_HH
Index: olena/tests/convert/tests/force
--- olena/tests/convert/tests/force (révision 0)
+++ olena/tests/convert/tests/force (révision 0)
@@ -0,0 +1,22 @@
+ // -*- C++ -*-
+#include <ntg/int.hh>
+#include <oln/funobj/arith.hh>
+#include <oln/convert/conversion.hh>
+#include <oln/convert/force.hh>
+
+using namespace oln;
+
+bool check()
+{
+ typedef ntg::int_u8 value_type;
+ f_::plus_<value_type, value_type> f_plus;
+ oln::convert::force<value_type> f_force;
+
+ value_type a = 1;
+ value_type b = 2;
+ value_type c = convert::compconv2(f_force, f_plus)(a, b);
+ if (c != 3)
+ return true;
+
+ return false;
+}
Index: olena/oln/funobj/compose.hh
--- olena/oln/funobj/compose.hh (révision 216)
+++ olena/oln/funobj/compose.hh (copie de travail)
@@ -48,6 +48,11 @@
typedef oln_fun1_type_of(F2, arg) arg_type;
};
+
+ /*-----------------------------------.
+ | Composition of two unary functor. |
+ `-----------------------------------*/
+
namespace f_
{
@@ -87,6 +92,46 @@
return f_::compose_uu_<UF1, UF2>(f1, f2);
}
+
+ /*-------------------.
+ | Identity functor. |
+ `-------------------*/
+
+ namespace f_ {
+ template <typename T> struct identity_;
+ } // end of namespace oln::f_
+
+ template <typename T>
+ struct set_super_type < f_::identity_<T> > { typedef f_::abstract::unary< f_::identity_<T> > ret; };
+
+ template <typename T>
+ struct set_props < category::fun1, f_::identity_<T> >
+ {
+ typedef T res_type;
+ typedef T arg_type;
+ };
+
+ namespace f_
+ {
+
+ /*! \class f_identity
+ **
+ ** This functor returns its argument.
+ */
+ template<class T>
+ struct identity_ : public oln_super_of_(f_::identity_<T>)
+ {
+ const T impl_unop(const T& t) const
+ {
+ return t;
+ }
+ };
+
+ typedef f_::unary_meta<f_::identity_> f_identity_type;
+ static f_identity_type f_identity;
+
+ } // end of namespace oln::f_
+
} // end of namespace oln
#endif // ! OLENA_CORE_FUNOBJ_CONVERSION_HH
Index: olena/oln/core/apply.hh
--- olena/oln/core/apply.hh (révision 216)
+++ olena/oln/core/apply.hh (copie de travail)
@@ -44,7 +44,8 @@
| Unary. |
`--------*/
- /*! \brief Standard unary \a apply procedure.
+ /*! \brief Standard unary \a apply procedure of an
+ ** mlc:abstract::unary_function<F>
**
** Apply a function \a f to each element of \a input, the function
** is passed as a type and is instantiated.
@@ -69,8 +70,12 @@
return output;
}
- // version with oln::f_::abstract::unary<F>
-
+ /*! \brief Standard unary \a apply procedure of an
+ ** oln::f_::abstract::unary
+ **
+ ** Apply a function \a f to each element of \a input, the function
+ ** is passed as a type and is instantiated.
+ */
template <typename F, typename I>
typename ch_value_type<I, oln_fun1_type_of(F, res)>::ret
apply(const oln::f_::abstract::unary<F>& f,
@@ -96,7 +101,8 @@
| Binary. |
`---------*/
- /*! \brief Standard binary \a apply procedure.
+ /*! \brief Standard binary \a apply procedure of a
+ ** mlc:abstract::binary_function<F>
**
** Apply a function \a f to each pair of elements of
** \a input1 x \a input2.
@@ -128,8 +134,12 @@
}
- // version with oln::f_::abstract::binary<F>
-
+ /*! \brief Standard binary \a apply procedure of a
+ ** oln::f_::abstract::binary<F>
+ **
+ ** Apply a function \a f to each pair of elements of
+ ** \a input1 x \a input2.
+ */
template <typename F, typename I1, typename I2>
typename ch_value_type<I1, oln_fun2_type_of(F, res)>::ret
apply2(const oln::f_::abstract::binary<F>& f,
@@ -157,8 +167,12 @@
}
- // version with oln::f_::abstract::mbinary<F>
-
+ /*! \brief Standard binary \a apply procedure of a
+ ** oln::f_::abstract::mbinary<F>
+ **
+ ** Apply a function \a f to each pair of elements of
+ ** \a input1 x \a input2.
+ */
template <typename F, typename I1, typename I2>
typename ch_value_type<I1, typename f_::mbinary_result<F,
oln_type_of(I1, value),
Index: olena/TODO
--- olena/TODO (révision 0)
+++ olena/TODO (révision 0)
@@ -0,0 +1,17 @@
+* Possibly dead code
+
+** oln/core/compose.hh
+Seems to be used nowhere. Morever, redundant with the new
+oln/funobj/compose.hh, which deals with oln/funobj functors (whereas
+the former handles functors à la STL).
+
+
+* Lack of consistency in file naming
+
+** oln/level/compare.hh vs oln/ops/cmp.hh
+
+
+Local Variables:
+mode: outline
+ispell-local-dictionary: "american"
+End:
Index: olena/oln/convert/abstract/conversion.hh
--- olena/oln/convert/abstract/conversion.hh (révision 0)
+++ olena/oln/convert/abstract/conversion.hh (révision 0)
@@ -0,0 +1,179 @@
+// Copyright (C) 2001, 2002, 2003, 2004, 2005 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, 59 Temple Place - Suite 330, 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 OLENA_CONVERT_ABSTRACT_CONVERSION_HH
+# define OLENA_CONVERT_ABSTRACT_CONVERSION_HH
+
+# include <ntg/utils/debug.hh>
+# include <functional>
+
+namespace oln {
+
+ namespace convert {
+ /*!
+ ** \brief Base classes for conversion.
+ */
+ namespace abstract {
+
+ // fwd_decl
+ template <class Exact, class Base>
+ class conversion;
+
+ template<class Result_Type,
+ class Exact, class Base>
+ struct conversion_to_type;
+
+ template<class Argument_Type, class Result_Type,
+ class Exact, class Base>
+ struct conversion_from_type_to_type;
+
+ template<class Conv>
+ struct conversion_traits;
+
+ /*! \brief Internal purpose only.
+ */
+ namespace internal {
+ /// Retrieve the result type of a conversion.
+ template <class Base, class T>
+ struct output {};
+
+ template <class Argument_Type, class Result_Type,
+ class Exact, class Base>
+ struct output<conversion_from_type_to_type<Argument_Type, Result_Type, Exact, Base >, Argument_Type>
+ {
+ typedef Result_Type ret;
+ };
+
+ template <class Result_Type,
+ class Exact, class Base, class T>
+ struct output<conversion_to_type<Result_Type, Exact, Base >, T>
+ {
+ typedef Result_Type ret;
+ };
+
+ } // end of namespace oln::convert::abstract::internal
+
+ } // end of namespace oln::convert::abstract
+
+ namespace abstract {
+
+ /*! Base class for conversion.
+ **
+ ** \note If you write an class derived from this one, you
+ ** must write the specialization of the output trait.
+ */
+ template<class Exact, class Base>
+ struct conversion : public mlc::any< Exact >
+ {
+ static std::string
+ name()
+ {
+ return std::string("conversion<") + Exact::name() + ">";
+ }
+
+ public:
+ template<class T>
+ struct output
+ {
+ typedef typename internal::output<Base, T>::ret ret;
+ };
+
+ /// Call the conversion written in the exact class.
+ template <class T>
+ typename output<T>::ret
+ operator()(const T& in) const
+ {
+ return this->exact().doit(in);
+ }
+
+ protected:
+ conversion() {}
+ };
+
+ /// Base class for the conversion to a specific type.
+ template<class Result_Type, class Exact,
+ class Base = conversion_to_type<Result_Type, Exact, Exact> >
+ struct conversion_to_type :
+ public conversion< Exact, Base >
+ {
+ /* Additionally define result_type. This is not required
+ in a conversion class (generally not possible to define).
+ But it's useful when it's available (like here)
+ because it make the conversion appear almost as Adaptable
+ Unary Function (it will just lack the argument_type, but
+ this typedef is not used very much.) */
+
+ typedef Result_Type result_type;
+
+ static std::string
+ name()
+ {
+ // FIXME: Exact is not an integre type !
+ return std::string("conversion_to_type<")
+ + ntg_name(Result_Type) + ", "
+ + Exact::name() + ">";
+ }
+
+ protected:
+ conversion_to_type() {}
+ };
+
+ /// Base class if both input and output types of the conversion
+ /// are fixed.
+ template<class Argument_Type, class Result_Type, class Exact,
+ class Base = conversion_from_type_to_type<Argument_Type, Result_Type, Exact, Exact> >
+ struct conversion_from_type_to_type:
+ public conversion_to_type< Result_Type, Exact , Base >
+ {
+
+ /* By defining argument_type, and inheriting from result_type,
+ we comply to the STL concept of Adaptable Unary Function. */
+
+ typedef Argument_Type argument_type;
+
+ static std::string
+ name()
+ {
+ // FIXME: Exact is not an integre type !
+ return std::string("conversion_from_type_to_type<")
+ + ntg_name(Argument_Type) + ", "
+ + ntg_name(Result_Type) + ", "
+ + "FIXME: ntg_name(Exact)" + ">";
+ }
+
+ protected :
+ conversion_from_type_to_type() {}
+ };
+
+ } // end of namespace oln::convert::abstract
+
+ } // end of namespace oln::convert
+
+} // end of namespace oln
+
+
+#endif // OLENA_CONVERT_ABSTRACT_CONVERSION_HH
1
0
Please, don't forget to post your latest patches to olena-patches (I
may have missed them because of the news server breakdown).
Index: olena/ChangeLog
===================================================================
--- olena/ChangeLog (révision 216)
+++ olena/ChangeLog (copie de travail)
@@ -1,16 +1,21 @@
2005-06-23 Christophe Berger <christophe(a)lrde.epita.fr>
- * oln/appli/astro/graphical_interface/interface.pro: Modify interface appareance.
- * oln/appli/astro/graphical_interface/visualization_window.ui: likewise.
- * oln/appli/astro/graphical_interface/filterinterface.hh: likewise.
+ * oln/appli/astro/graphical_interface/interface.pro: Modify
+ interface appearance.
+ * oln/appli/astro/graphical_interface/visualization_window.ui:
+ Likewise.
+ * oln/appli/astro/graphical_interface/filterinterface.hh: Likewise.
2005-06-22 Christophe Berger <christophe(a)lrde.epita.fr>
* oln/appli/astro/tree_coherance_checks.hh: Update doc.
* oln/appli/astro/tree_statistics.hh: Add count of local root.
- * oln/appli/astro/graphical_interface/interface.pro: Qmake options to compile without -w -Wall.
- * oln/appli/astro/graphical_interface/visualization_window.ui: Add options in interface.
- * oln/appli/astro/graphical_interface/filterinterface.hh: Handle these options.
+ * oln/appli/astro/graphical_interface/interface.pro: Qmake options
+ to compile without -w -Wall.
+ * oln/appli/astro/graphical_interface/visualization_window.ui: Add
+ options in interface.
+ * oln/appli/astro/graphical_interface/filterinterface.hh: Handle
+ these options.
2005-06-22 Nicolas Widynski <nicolas.widynski(a)lrde.epita.fr>
@@ -49,13 +54,13 @@
2005-06-19 Nicolas Widynski <nicolas.widynski(a)lrde.epita.fr>
- * oln/core/abstract/image.hh: patch for adding method call.
- * oln/core/abstract/image_constness.hh: add method call for
+ * oln/core/abstract/image.hh: Patch for adding method call.
+ * oln/core/abstract/image_constness.hh: Add method call for
readwrite images.
- * oln/core/abstract/image_with_data.hh: likewise.
- * oln/core/2d/array2d.hh: likewise.
- * oln/core/box.hh: likewise.
- * oln/makefile.src: add files.
+ * oln/core/abstract/image_with_data.hh: Likewise.
+ * oln/core/2d/array2d.hh: Likewise.
+ * oln/core/box.hh: Likewise.
+ * oln/makefile.src: Add files.
2005-06-13 Damien Thivolle <damien(a)lrde.epita.fr>
1
0