
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Bug fixes. * mln/core/image/plain.hh (trait): Fix speed. * mln/morpho/reconstruction/by_dilation/union_find.hh: Fix missing include. (is_proc): Move into code. * tests/io/magick/magick.cc: Rename as... * tests/io/magick/load.cc: ...this since it tests 'load'. (include): Fix missing. Cleanup code. * tests/io/magick/Makefile.am: Update. mln/core/image/plain.hh | 3 +- mln/morpho/reconstruction/by_dilation/union_find.hh | 16 ++++-------- tests/io/magick/Makefile.am | 4 +-- tests/io/magick/load.cc | 26 +++++++------------- 4 files changed, 20 insertions(+), 29 deletions(-) Index: mln/core/image/plain.hh --- mln/core/image/plain.hh (revision 3792) +++ mln/core/image/plain.hh (working copy) @@ -66,8 +66,9 @@ template <typename I> struct image_< plain<I> > : image_< I > // Same as I except... { - // ...this change. + // ...these changes: typedef trait::image::category::identity_morpher category; + typedef mln_internal_trait_image_speed_from(I) speed; // Un-fastest. }; } // end of namespace mln::trait Index: mln/morpho/reconstruction/by_dilation/union_find.hh --- mln/morpho/reconstruction/by_dilation/union_find.hh (revision 3792) +++ mln/morpho/reconstruction/by_dilation/union_find.hh (working copy) @@ -32,6 +32,7 @@ # include <vector> # include <mln/core/concept/image.hh> # include <mln/core/concept/neighborhood.hh> +# include <mln/data/fill.hh> # include <mln/level/compare.hh> # include <mln/level/sort_psites.hh> @@ -90,14 +91,6 @@ -// template <typename P> -// inline -// bool is_proc(const P& n, const P& p) const -// { -// return g(n) > g(p) or (g(n) == g(p) && -// util::ord_strict(n, p)); -// } - template <typename Par> inline mln_site(Par) find_root(Par& parent, mln_site(Par) x) @@ -147,7 +140,7 @@ // Initialization. { initialize(output, f); - data::paste(f, output); + data::fill(output, f); initialize(parent, f); initialize(deja_vu, f); data::fill(deja_vu, false); @@ -165,7 +158,10 @@ for_all(n) { // if (f.domain().has(n)) - // mln_invariant(deja_vu(n) == is_proc(n, p)); +// mln_invariant(deja_vu(n) +// == +// (g(n) > g(p) || (g(n) == g(p) +// && util::ord_strict(n, p)))); if (f.domain().has(n) && deja_vu(n)) { // Do-Union. Index: tests/io/magick/load.cc --- tests/io/magick/load.cc (revision 3792) +++ tests/io/magick/load.cc (working copy) @@ -25,36 +25,30 @@ // reasons why the executable file might be covered by the GNU General // Public License. -/// \file tests/io/magick/magick.cc +/// \file tests/io/magick/load.cc /// -/// Test on mln::io::magick::*. +/// Test on mln::io::magick::load. #include <mln/core/image/image2d.hh> -#include <mln/io/magick/load.hh> -#include <mln/io/ppm/save.hh> - +#include <mln/value/rgb8.hh> +#include <mln/io/ppm/load.hh> #include <mln/level/compare.hh> -#include <mln/value/int_u8.hh> -#include <mln/value/rgb8.hh> +#include <mln/io/magick/load.hh> #include "tests/data.hh" -#include <mln/debug/println.hh> int main() { using namespace mln; - { - image2d<value::rgb8> lena_im; - io::magick::load(lena_im, "lena.png"); + image2d<value::rgb8> lena_ppm; + io::ppm::load(lena_ppm, "lena.ppm"); - image2d<value::rgb8> lena_mln; - io::ppm::load(lena_mln, "lena.ppm"); + image2d<value::rgb8> lena_png; + io::magick::load(lena_png, "lena.png"); - mln_assertion(lena_im.domain() == lena_mln.domain()); - mln_assertion(lena_im == lena_mln); - } + mln_assertion(lena_png == lena_ppm); } Index: tests/io/magick/Makefile.am --- tests/io/magick/Makefile.am (revision 3792) +++ tests/io/magick/Makefile.am (working copy) @@ -3,8 +3,8 @@ include $(top_srcdir)/milena/tests/tests.mk check_PROGRAMS = \ - magick + load -magick_SOURCES = magick.cc +load_SOURCES = load.cc TESTS = $(check_PROGRAMS)