Commit bec6f7e0 authored by Thierry Geraud's avatar Thierry Geraud
Browse files

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.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3793 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent b0e7fdd4
2009-05-15 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.
2009-05-14 Guillaume Sadegh <sadegh@lrde.epita.fr> 2009-05-14 Guillaume Sadegh <sadegh@lrde.epita.fr>
   
Add breadth first search canvas for graphs. Add breadth first search canvas for graphs.
...@@ -66,8 +66,9 @@ namespace mln ...@@ -66,8 +66,9 @@ namespace mln
template <typename I> template <typename I>
struct image_< plain<I> > : image_< I > // Same as I except... struct image_< plain<I> > : image_< I > // Same as I except...
{ {
// ...this change. // ...these changes:
typedef trait::image::category::identity_morpher category; typedef trait::image::category::identity_morpher category;
typedef mln_internal_trait_image_speed_from(I) speed; // Un-fastest.
}; };
} // end of namespace mln::trait } // end of namespace mln::trait
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
# include <vector> # include <vector>
# include <mln/core/concept/image.hh> # include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh> # include <mln/core/concept/neighborhood.hh>
# include <mln/data/fill.hh>
# include <mln/level/compare.hh> # include <mln/level/compare.hh>
# include <mln/level/sort_psites.hh> # include <mln/level/sort_psites.hh>
...@@ -89,14 +90,6 @@ namespace mln ...@@ -89,14 +90,6 @@ namespace mln
} }
// 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> template <typename Par>
inline inline
...@@ -147,7 +140,7 @@ namespace mln ...@@ -147,7 +140,7 @@ namespace mln
// Initialization. // Initialization.
{ {
initialize(output, f); initialize(output, f);
data::paste(f, output); data::fill(output, f);
initialize(parent, f); initialize(parent, f);
initialize(deja_vu, f); initialize(deja_vu, f);
data::fill(deja_vu, false); data::fill(deja_vu, false);
...@@ -164,8 +157,11 @@ namespace mln ...@@ -164,8 +157,11 @@ namespace mln
mln_niter(N) n(nbh, p); mln_niter(N) n(nbh, p);
for_all(n) for_all(n)
{ {
// if (f.domain().has(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)) if (f.domain().has(n) && deja_vu(n))
{ {
// Do-Union. // Do-Union.
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
include $(top_srcdir)/milena/tests/tests.mk include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \ check_PROGRAMS = \
magick load
magick_SOURCES = magick.cc load_SOURCES = load.cc
TESTS = $(check_PROGRAMS) TESTS = $(check_PROGRAMS)
...@@ -25,36 +25,30 @@ ...@@ -25,36 +25,30 @@
// reasons why the executable file might be covered by the GNU General // reasons why the executable file might be covered by the GNU General
// Public License. // 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/core/image/image2d.hh>
#include <mln/io/magick/load.hh> #include <mln/value/rgb8.hh>
#include <mln/io/ppm/save.hh> #include <mln/io/ppm/load.hh>
#include <mln/level/compare.hh> #include <mln/level/compare.hh>
#include <mln/value/int_u8.hh> #include <mln/io/magick/load.hh>
#include <mln/value/rgb8.hh>
#include "tests/data.hh" #include "tests/data.hh"
#include <mln/debug/println.hh>
int main() int main()
{ {
using namespace mln; using namespace mln;
{ image2d<value::rgb8> lena_ppm;
image2d<value::rgb8> lena_im; io::ppm::load(lena_ppm, "lena.ppm");
io::magick::load(lena_im, "lena.png");
image2d<value::rgb8> lena_mln; image2d<value::rgb8> lena_png;
io::ppm::load(lena_mln, "lena.ppm"); io::magick::load(lena_png, "lena.png");
mln_assertion(lena_im.domain() == lena_mln.domain()); mln_assertion(lena_png == lena_ppm);
mln_assertion(lena_im == lena_mln);
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment