
* mln/core/complex_iter.hh: More documentation. * mln/core/image/complex_image.hh (mln::internal::data< complex_image<D, P, V> >): Update properties. (mln::complex_image<D, P, V>): Fix access to members. (mln::complex_image<D, P, V>::super_): Remove typedef. * tests/core/image/complex_image.: Catch up with the current interfaces of mln::complex_psite and mln::faces_psite. * tests/core/image/Makefile.am (check_PROGRAMS): Re-enable complex_image. (complex_image_SOURCES): Re-enable. --- milena/ChangeLog | 16 +++++++++++ milena/mln/core/complex_iter.hh | 9 ++++++ milena/mln/core/image/complex_image.hh | 42 +++++++++++++++++------------ milena/tests/core/image/Makefile.am | 4 +- milena/tests/core/image/complex_image.cc | 8 +++--- 5 files changed, 56 insertions(+), 23 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index ee684ea..ba324e4 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,21 @@ 2008-09-22 Roland Levillain <roland@lrde.epita.fr> + Update complex-based image. + + * mln/core/complex_iter.hh: More documentation. + * mln/core/image/complex_image.hh + (mln::internal::data< complex_image<D, P, V> >): + Update properties. + (mln::complex_image<D, P, V>): Fix access to members. + (mln::complex_image<D, P, V>::super_): Remove typedef. + * tests/core/image/complex_image.: Catch up with the current + interfaces of mln::complex_psite and mln::faces_psite. + * tests/core/image/Makefile.am (check_PROGRAMS): Re-enable + complex_image. + (complex_image_SOURCES): Re-enable. + +2008-09-22 Roland Levillain <roland@lrde.epita.fr> + Update iterators on p_complex. * mln/core/internal/p_complex_piter_base.hh diff --git a/milena/mln/core/complex_iter.hh b/milena/mln/core/complex_iter.hh index ba2731e..1e60fe0 100644 --- a/milena/mln/core/complex_iter.hh +++ b/milena/mln/core/complex_iter.hh @@ -33,6 +33,9 @@ # include <mln/core/internal/complex_iter_base.hh> +// FIXME: Factor a bit more? (Using complex_iter_base_.) + + namespace mln { @@ -52,7 +55,10 @@ namespace mln complex_fwd_iter_<D> > { public: + /// Type of associated face. typedef any_face_handle<D> face; + // FIXME: Rename as dim? + /// Dimension of the complex. static const unsigned complex_dim = D; private: @@ -103,7 +109,10 @@ namespace mln complex_bkd_iter_<D> > { public: + /// Type of associated face. typedef any_face_handle<D> face; + // FIXME: Rename as dim? + /// Dimension of the complex. static const unsigned complex_dim = D; private: diff --git a/milena/mln/core/image/complex_image.hh b/milena/mln/core/image/complex_image.hh index 3923454..6dbc522 100644 --- a/milena/mln/core/image/complex_image.hh +++ b/milena/mln/core/image/complex_image.hh @@ -50,8 +50,8 @@ namespace mln { - // Fwd decl. - template <unsigned D, typename P, typename V> struct complex_image; + // Forward declaration. + template <unsigned D, typename P, typename V> class complex_image; namespace internal { @@ -80,16 +80,25 @@ namespace mln typedef trait::image::category::primary category; // FIXME: Is that right? - typedef trait::image::access::random access; - typedef typename trait::image::space_from_point<P>::ret space; - typedef trait::image::size::regular size; - typedef trait::image::support::irregular support; - - typedef trait::image::border::none border; - typedef trait::image::data::stored data; - typedef trait::image::io::read_write io; + typedef trait::image::speed::fast speed; + typedef trait::image::size::regular size; + + // Value. + typedef trait::image::value_access::direct value_access; // FIXME: Is that right? - typedef trait::image::speed::fast speed; + typedef trait::image::value_storage::one_block value_storage; + typedef trait::image::value_browsing::site_wise_only value_browsing; + typedef trait::image::value_io::read_write value_io; + + // Site / domain. + typedef trait::image::localization::space localization; + // FIXME: Likewise. + typedef typename trait::image::space_from_point<P>::ret dimension; + + // Extended domain. + typedef trait::image::ext_domain::none ext_domain; + typedef trait::image::ext_value::irrelevant ext_value; + typedef trait::image::ext_io::irrelevant ext_io; }; } // end of namespace mln::trait @@ -99,13 +108,11 @@ namespace mln /// /// Values are stored on the vertices of the graph. template <unsigned D, typename P, typename V> - struct complex_image : - public internal::image_primary_< V, p_complex<D, P>, complex_image<D,P,V> > + class complex_image + : public internal::image_primary< V, p_complex<D, P>, + complex_image<D, P, V> > { - /// Super type. - typedef mln::internal::image_base_< p_complex<D, P>, - complex_image<D, P, V> > super_; - + public: /// Value associated type. typedef V value; @@ -123,6 +130,7 @@ namespace mln /// Skeleton. typedef complex_image< D, tag::psite_<P>, tag::value_<V> > skeleton; + public: /// Constructors. /// \{ complex_image(); diff --git a/milena/tests/core/image/Makefile.am b/milena/tests/core/image/Makefile.am index 5c7e6ac..583cbba 100644 --- a/milena/tests/core/image/Makefile.am +++ b/milena/tests/core/image/Makefile.am @@ -5,7 +5,7 @@ include $(top_srcdir)/milena/tests/tests.mk check_PROGRAMS = \ ## bgraph_image \ cast_image \ -## complex_image \ + complex_image \ decorated_image \ flat_image \ ## hexa \ @@ -33,7 +33,7 @@ check_PROGRAMS = \ ##bgraph_image_SOURCES = bgraph_image.cc cast_image_SOURCES = cast_image.cc -##complex_image_SOURCES = complex_image.cc +complex_image_SOURCES = complex_image.cc decorated_image_SOURCES = decorated_image.cc ##graph_image_SOURCES = graph_image.cc ##graph_image_wst_SOURCES = graph_image_wst.cc diff --git a/milena/tests/core/image/complex_image.cc b/milena/tests/core/image/complex_image.cc index 44a62f0..7711f38 100644 --- a/milena/tests/core/image/complex_image.cc +++ b/milena/tests/core/image/complex_image.cc @@ -146,7 +146,7 @@ int main() face_handle<1, D> e0_(pc.cplx(), 0); any_face_handle<D> af(e0_); // An associated psite. - complex_psite<D, point2d> cs(af); + complex_psite<D, point2d> cs(pc, af); /*--------------------. @@ -161,9 +161,9 @@ int main() p_faces<2, D, point2d> pf2(c); // Some psites on faces. - faces_psite<0, D, point2d> fs0(v0); - faces_psite<1, D, point2d> fs1(e0); - faces_psite<2, D, point2d> fs2(t0); + faces_psite<0, D, point2d> fs0(pf0, v0); + faces_psite<1, D, point2d> fs1(pf1, e0); + faces_psite<2, D, point2d> fs2(pf2, t0); /*----------------------. -- 1.6.0.1