cleanup-2008 2506: Replace the inplace routine by the rw method.

https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Replace the inplace routine by the rw method. Get rid of the old inplace/instant files. * sandbox/geraud/dead: New directory. * mln/core/image/instant.hh: Move... * sandbox/geraud/dead/instant.hh: ...here. * mln/core/image/inplace.hh: Move... * sandbox/geraud/dead/inplace.hh: ...here. Add the rw method to do the job. * mln/core/internal/image_morpher.hh (rw): New. Update other files. * tools/seed2tiling.cc, * tests/core/site_set/p_image.cc, * tests/core/image/sub_image.cc, * tests/draw/line.cc, * tests/level/memcpy_.cc, * tests/convert/to_p_set.cc, * tests/convert/to_window.cc, * tests/display/show.cc, * tests/display/save_and_show.cc, * tests/display/color_pretty.cc, * tests/canvas/chamfer.cc, * doc/oldies/2008__tour1.cc, * doc/oldies/2008__tour3.cc, * doc/tutorial/examples/sub_image.cc, * doc/tutorial/examples/p_line2d.cc, * doc/tutorial/examples/for_Z.cc, * doc/examples/tuto_bis.cc, * mln/core/image/status.txt, * mln/core/image/all.hh, * mln/core/image/hexa_piter.hh, * mln/core/image/sub_image.hh, * mln/level/fill_with_image.hh, * mln/level/paste.spe.hh, * mln/level/replace.hh, * mln/level/paste.hh, * mln/level/fill_with_value.hh, * mln/accu/rank.hh, * mln/accu/rank_high_quant.hh, * mln/accu/rank_bool.hh, * mln/geom/chamfer.hh, * sandbox/duhamel/slow_seed2tiling.cc, * sandbox/duhamel/color_sub.cc, * sandbox/duhamel/chamfer.cc, * sandbox/duhamel/chamfer.hh, * sandbox/geraud/fllt.svg.6.cc, * sandbox/geraud/cs2d/tuto.cc, * sandbox/geraud/fllt/fllt_tree_to_image.hh, * sandbox/geraud/fllt/fllt.svg.3.cc, * sandbox/geraud/fllt/fllt.svg.4.cc, * sandbox/geraud/fllt/fllt.svg.5.cc, * sandbox/geraud/fllt/fllt.svg.6.cc, * sandbox/geraud/fllt/fllt_test.hh, * sandbox/geraud/Rd/debase.union_find.hh, * sandbox/vigouroux/yuv/get_blue.hh, * sandbox/vigouroux/yuv/get_red.hh, * sandbox/vigouroux/yuv/rgb_to_yuv.hh, * sandbox/vigouroux/yuv/get_green.hh, * sandbox/vigouroux/hsi/get_blue.hh, * sandbox/vigouroux/hsi/get_red.hh, * sandbox/vigouroux/hsi/rgb_to_hsi.hh, * sandbox/vigouroux/hsi/get_green.hh, * sandbox/vigouroux/function.hh, * sandbox/vigouroux/tests.cc, * sandbox/vigouroux/cmy/rgb_to_cmy.hh, * sandbox/vigouroux/cmy/get_blue.hh, * sandbox/vigouroux/cmy/fun.hh, * sandbox/vigouroux/cmy/get_green.hh, * sandbox/vigouroux/xyz/rgb_to_xyz.hh, * sandbox/vigouroux/xyz/get_blue.hh, * sandbox/vigouroux/xyz/get_red.hh, * sandbox/vigouroux/xyz/get_green.hh, * sandbox/vigouroux/yiq/get_blue.hh, * sandbox/vigouroux/yiq/get_red.hh, * sandbox/vigouroux/yiq/rgb_to_yiq.hh, * sandbox/vigouroux/yiq/get_green.hh, * sandbox/vigouroux/conv/getred.hh, * sandbox/vigouroux/conv/tored.hh, * sandbox/vigouroux/conv/torgb.hh, * sandbox/vigouroux/conv/rgbto.hh, * sandbox/vigouroux/color/rgb_to_hsl.hh, * sandbox/vigouroux/color/rgb_to_cmy.hh, * sandbox/vigouroux/color/rgb_to_xyz.hh, * sandbox/vigouroux/color/tests.cc, * sandbox/vigouroux/color/rgb_to_hsv.hh, * sandbox/vigouroux/color/rgb_to_yiq.hh, * sandbox/vigouroux/color/rgb_to_hsi.hh, * sandbox/vigouroux/color/rgb_to_yuv.hh, * sandbox/garrigues/level_set.hh, * sandbox/garrigues/fllt/fllt_simple.svg.1.cc, * sandbox/garrigues/fllt/fllt_simple.svg.3.cc, * sandbox/garrigues/fllt/fllt_simple.cc, * sandbox/garrigues/fllt/compute_level_set_fast2.hh, * sandbox/garrigues/fllt/debug.hh, * sandbox/garrigues/fllt/compute_level_set_fast.hh, * sandbox/garrigues/fllt/fllt_simple.svg.2.cc, * sandbox/garrigues/fllt/fllt.hh, * sandbox/garrigues/fllt/compute_level_set.hh, * sandbox/garrigues/tiled_image2d/tiled_image2d.hh, * sandbox/garrigues/factures/extract_array_highlight.cc, * sandbox/garrigues/factures/extract_array.cc, * sandbox/ballas/test.cc: Update. doc/examples/tuto_bis.cc | 2 - doc/oldies/2008__tour1.cc | 21 ++++++------ doc/oldies/2008__tour3.cc | 7 ++-- doc/tutorial/examples/for_Z.cc | 2 - doc/tutorial/examples/p_line2d.cc | 13 ------- doc/tutorial/examples/sub_image.cc | 7 ---- mln/accu/rank.hh | 2 - mln/accu/rank_bool.hh | 2 - mln/accu/rank_high_quant.hh | 5 +- mln/core/image/all.hh | 1 mln/core/image/hexa_piter.hh | 2 - mln/core/image/status.txt | 3 - mln/core/image/sub_image.hh | 31 +----------------- mln/core/internal/image_morpher.hh | 21 ++++++++++++ mln/geom/chamfer.hh | 8 ++-- mln/level/fill_with_image.hh | 2 - mln/level/fill_with_value.hh | 18 +--------- mln/level/paste.hh | 2 - mln/level/paste.spe.hh | 5 ++ mln/level/replace.hh | 2 - sandbox/ballas/test.cc | 26 +++++++-------- sandbox/duhamel/chamfer.cc | 2 - sandbox/duhamel/chamfer.hh | 4 +- sandbox/duhamel/color_sub.cc | 8 ++-- sandbox/duhamel/slow_seed2tiling.cc | 2 - sandbox/garrigues/factures/extract_array.cc | 6 +-- sandbox/garrigues/factures/extract_array_highlight.cc | 4 +- sandbox/garrigues/fllt/compute_level_set.hh | 2 - sandbox/garrigues/fllt/compute_level_set_fast.hh | 2 - sandbox/garrigues/fllt/compute_level_set_fast2.hh | 2 - sandbox/garrigues/fllt/debug.hh | 6 +-- sandbox/garrigues/fllt/fllt.hh | 2 - sandbox/garrigues/fllt/fllt_simple.cc | 2 - sandbox/garrigues/fllt/fllt_simple.svg.1.cc | 2 - sandbox/garrigues/fllt/fllt_simple.svg.2.cc | 2 - sandbox/garrigues/fllt/fllt_simple.svg.3.cc | 2 - sandbox/garrigues/level_set.hh | 2 - sandbox/garrigues/tiled_image2d/tiled_image2d.hh | 2 - sandbox/geraud/Rd/debase.union_find.hh | 6 +-- sandbox/geraud/cs2d/tuto.cc | 8 ++-- sandbox/geraud/fllt.svg.6.cc | 4 +- sandbox/geraud/fllt/fllt.svg.3.cc | 2 - sandbox/geraud/fllt/fllt.svg.4.cc | 6 +-- sandbox/geraud/fllt/fllt.svg.5.cc | 6 +-- sandbox/geraud/fllt/fllt.svg.6.cc | 4 +- sandbox/geraud/fllt/fllt_test.hh | 2 - sandbox/geraud/fllt/fllt_tree_to_image.hh | 2 - sandbox/vigouroux/cmy/fun.hh | 2 - sandbox/vigouroux/cmy/get_blue.hh | 2 - sandbox/vigouroux/cmy/get_green.hh | 2 - sandbox/vigouroux/cmy/rgb_to_cmy.hh | 2 - sandbox/vigouroux/color/rgb_to_cmy.hh | 2 - sandbox/vigouroux/color/rgb_to_hsi.hh | 2 - sandbox/vigouroux/color/rgb_to_hsl.hh | 2 - sandbox/vigouroux/color/rgb_to_hsv.hh | 2 - sandbox/vigouroux/color/rgb_to_xyz.hh | 2 - sandbox/vigouroux/color/rgb_to_yiq.hh | 2 - sandbox/vigouroux/color/rgb_to_yuv.hh | 2 - sandbox/vigouroux/color/tests.cc | 2 - sandbox/vigouroux/conv/getred.hh | 2 - sandbox/vigouroux/conv/rgbto.hh | 2 - sandbox/vigouroux/conv/tored.hh | 2 - sandbox/vigouroux/conv/torgb.hh | 2 - sandbox/vigouroux/function.hh | 2 - sandbox/vigouroux/hsi/get_blue.hh | 2 - sandbox/vigouroux/hsi/get_green.hh | 2 - sandbox/vigouroux/hsi/get_red.hh | 2 - sandbox/vigouroux/hsi/rgb_to_hsi.hh | 2 - sandbox/vigouroux/tests.cc | 2 - sandbox/vigouroux/xyz/get_blue.hh | 2 - sandbox/vigouroux/xyz/get_green.hh | 2 - sandbox/vigouroux/xyz/get_red.hh | 2 - sandbox/vigouroux/xyz/rgb_to_xyz.hh | 2 - sandbox/vigouroux/yiq/get_blue.hh | 2 - sandbox/vigouroux/yiq/get_green.hh | 2 - sandbox/vigouroux/yiq/get_red.hh | 2 - sandbox/vigouroux/yiq/rgb_to_yiq.hh | 2 - sandbox/vigouroux/yuv/get_blue.hh | 2 - sandbox/vigouroux/yuv/get_green.hh | 2 - sandbox/vigouroux/yuv/get_red.hh | 2 - sandbox/vigouroux/yuv/rgb_to_yuv.hh | 2 - tests/canvas/chamfer.cc | 2 - tests/convert/to_p_set.cc | 6 +-- tests/convert/to_window.cc | 4 +- tests/core/image/sub_image.cc | 8 ++-- tests/core/site_set/p_image.cc | 2 - tests/display/color_pretty.cc | 6 +-- tests/display/save_and_show.cc | 4 +- tests/display/show.cc | 4 +- tests/draw/line.cc | 6 +-- tests/level/memcpy_.cc | 7 ++-- tools/seed2tiling.cc | 2 - 92 files changed, 182 insertions(+), 211 deletions(-) Index: tools/seed2tiling.cc --- tools/seed2tiling.cc (revision 2505) +++ tools/seed2tiling.cc (working copy) @@ -49,7 +49,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/image/sub_image.hh> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/make/win_chamfer.hh> Index: tests/core/site_set/p_image.cc --- tests/core/site_set/p_image.cc (revision 2505) +++ tests/core/site_set/p_image.cc (working copy) @@ -54,7 +54,7 @@ mln_assertion(ps.nsites() == 0); mln_assertion(ps.is_empty()); - mln_fwd_piter_(box2d) p(inplace(make::box2d(13,13,19,15))); + mln_fwd_piter_(box2d) p(make::box2d(13,13,19,15)); for_all(p) { ps.insert(p); Index: tests/core/image/sub_image.cc --- tests/core/image/sub_image.cc (revision 2505) +++ tests/core/image/sub_image.cc (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 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 @@ -32,7 +32,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/image/sub_image.hh> -#include <mln/core/image/inplace.hh> + #include <mln/level/fill.hh> #include <mln/debug/println.hh> @@ -46,8 +46,8 @@ level::fill(ima, 0); debug::println(ima); - level::fill(inplace(ima | make::box2d(1,1, 3,3)), 5); - level::fill(inplace(ima | make::box2d(4,4, 6,6)), 1); + level::fill((ima | make::box2d(1,1, 3,3)).rw(), 5); + level::fill((ima | make::box2d(4,4, 6,6)).rw(), 1); debug::println(ima); } Index: tests/draw/line.cc --- tests/draw/line.cc (revision 2505) +++ tests/draw/line.cc (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 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 @@ -34,7 +34,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/image/sub_image.hh> -#include <mln/core/image/inplace.hh> + #include <mln/level/fill.hh> #include <mln/level/compare.hh> @@ -62,7 +62,7 @@ image2d<bool> ima3(10,10); level::fill(ima3, false); - level::fill(inplace(ima3 | l), true); + level::fill((ima3 | l).rw(), true); mln_assertion(ima3 == ima); } Index: tests/level/memcpy_.cc --- tests/level/memcpy_.cc (revision 2505) +++ tests/level/memcpy_.cc (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 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 @@ -33,7 +33,7 @@ */ #include <mln/core/image/image2d.hh> -#include <mln/core/image/inplace.hh> + #include <mln/debug/iota.hh> #include <mln/level/memcpy_.hh> @@ -50,7 +50,8 @@ src = point2d(0, 2), dest = point2d(1, 2); - level::memcpy_(inplace(make::pixel(ima, dest)), + pixel<I> pix = make::pixel(ima, dest); + level::memcpy_(pix, make::pixel(ima, src), 2 + 2 * ima.border()); Index: tests/convert/to_p_set.cc --- tests/convert/to_p_set.cc (revision 2505) +++ tests/convert/to_p_set.cc (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007. 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 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 @@ -36,7 +36,7 @@ #include <mln/core/alias/window2d.hh> #include <mln/core/alias/box2d.hh> #include <mln/core/alias/neighb2d.hh> -#include <mln/core/image/inplace.hh> + #include <mln/level/fill.hh> @@ -75,7 +75,7 @@ // Image : image2d<bool> ima(make::box2d(-6, -6, 6, 6)); level::fill(ima, false); - level::fill(inplace(ima | ref), true); + level::fill((ima | ref).rw(), true); p_set<point2d> test_ima = convert::to_p_set(ima); test(ref, test_ima); Index: tests/convert/to_window.cc --- tests/convert/to_window.cc (revision 2505) +++ tests/convert/to_window.cc (working copy) @@ -36,7 +36,7 @@ #include <mln/core/alias/window2d.hh> #include <mln/core/alias/box2d.hh> #include <mln/core/alias/neighb2d.hh> -#include <mln/core/image/inplace.hh> + #include <mln/level/fill.hh> @@ -77,7 +77,7 @@ // Image : image2d<bool> ima(make::box2d(-6, -6, 6, 6)); level::fill(ima, false); - level::fill(inplace(ima | convert::to_p_set(ref)), true); + level::fill((ima | convert::to_p_set(ref)).rw(), true); window2d test_ima = convert::to_window(ima); test(ref, test_ima); Index: tests/display/show.cc --- tests/display/show.cc (revision 2505) +++ tests/display/show.cc (working copy) @@ -37,7 +37,7 @@ #include <mln/value/rgb8.hh> #include <mln/core/image/sub_image.hh> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/display/save.hh> @@ -69,7 +69,7 @@ // Call color_pretty for sub_image. for (unsigned i = 2; i < 6; i += 2) { - image_if_value<image2d<unsigned> > t = inplace (tmp | i); + image_if_value<image2d<unsigned> > t = tmp | i; display::save (t); display::show (t, "display", 1); } Index: tests/display/save_and_show.cc --- tests/display/save_and_show.cc (revision 2505) +++ tests/display/save_and_show.cc (working copy) @@ -37,7 +37,7 @@ #include <mln/value/rgb8.hh> #include <mln/core/image/sub_image.hh> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> @@ -67,7 +67,7 @@ // Call color_pretty for sub_image. for (unsigned i = 2; i < 6; i += 2) { - image_if_value<image2d<unsigned> > t = inplace (tmp | i); + image_if_value<image2d<unsigned> > t = tmp | i; display::save_and_show (t, "display", 1); } Index: tests/display/color_pretty.cc --- tests/display/color_pretty.cc (revision 2505) +++ tests/display/color_pretty.cc (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 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 @@ -35,7 +35,7 @@ # include <mln/level/fill.hh> # include <mln/core/site_set/p_set.hh> # include <mln/core/image/sub_image.hh> -# include <mln/core/image/inplace.hh> + # include <mln/value/rgb8.hh> # include <mln/display/color_pretty.hh> # include <mln/level/compare.hh> @@ -55,7 +55,7 @@ s.insert(point2d(0, 0)); s.insert(point2d(1, 1)); - sub_image<image2d<int_u8>, p_set<point2d > > input = inplace(ima | s); + sub_image<image2d<int_u8>, p_set<point2d > > input = ima | s; image2d<value::rgb8> out = display::color_pretty(input); value::rgb8 vs[2][2] = { Index: tests/canvas/chamfer.cc --- tests/canvas/chamfer.cc (revision 2505) +++ tests/canvas/chamfer.cc (working copy) @@ -32,7 +32,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/image/sub_image.hh> -#include <mln/core/image/inplace.hh> + #include <mln/level/fill.hh> #include <mln/debug/println.hh> Index: doc/oldies/2008__tour1.cc --- doc/oldies/2008__tour1.cc (revision 2505) +++ doc/oldies/2008__tour1.cc (working copy) @@ -1,4 +1,5 @@ -// Copyright (C) 2001, 2007 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2007, 2008 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 @@ -165,7 +166,7 @@ // Memory has been allocated so data can be stored but pixel values // have not been initialized yet. So we fill img3a, that is, all // pixels of img3a, with the value 'a': - level::fill(inplace(img3a), 'a'); + level::fill(img3a, 'a'); // The "fill" algorithm is located in the sub-namespace "level" // since this algorithm deals with the "level" of pixel values. @@ -183,12 +184,14 @@ // Most algorithms in Olena are constructed following the classical // scheme: "output algo(input)", where the input image is only read. // However some few algorithms take an input image in order to - // modify it. To enforce this particular feature, the user shall - // explicitly state that the image is provided so that its data is - // modified "inplace". + // modify it. - // The algorithm call shall be "level::fill(inplace(ima), val)". - // When forgetting the "inplace(..)" statement it does not compile. + // Obsolete: To enforce this particular feature, the user shall + // Obsolete: explicitly state that the image is provided so that its data is + // Obsolete: modified "inplace". + + // Obsolete: The algorithm call shall be "level::fill(inplace(ima), val)". + // Obsolete: When forgetting the "inplace(..)" statement it does not compile. // We then define below a second image to play with. As you can see @@ -198,10 +201,10 @@ image1d<char> img3b(5, 14); // We initialize the image values. - level::fill(inplace(img3b), 'b'); + level::fill(img3b, 'b'); // Last we now paste the contents of img3b in img3a... - level::paste(img3b, inplace(img3a)); + level::paste(img3b, img3a); // ...and print the result. debug::println(img3a); Index: doc/oldies/2008__tour3.cc --- doc/oldies/2008__tour3.cc (revision 2505) +++ doc/oldies/2008__tour3.cc (working copy) @@ -1,4 +1,5 @@ -// Copyright (C) 2001, 2007 EPITA Research and Development Laboratory +// Copyright (C) 2001, 2007, 2008 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 @@ -76,7 +77,7 @@ 0, 1, 1 }; // ...the debug::fill routine allows for manually initializing // image data: - debug::fill(inplace(img), vals); + debug::fill(img, vals); std::cout << "img = " << std::endl; debug::println(img); // img = @@ -137,7 +138,7 @@ // And now for a little test: what is the result of this code? { image2d<int> test(ima.points()); - level::fill(inplace(test), ima); + level::fill(test, ima); (test + c4).at(1, 1) = 9; debug::println(test); } Index: doc/tutorial/examples/sub_image.cc --- doc/tutorial/examples/sub_image.cc (revision 2505) +++ doc/tutorial/examples/sub_image.cc (working copy) @@ -22,13 +22,8 @@ debug::println(sub); debug::println(morpho::gradient_elementary(sub, c4())); - level::fill_with_value(ima | box2d(2,3), 0); + level::fill_with_value((ima | box2d(2,3)).rw(), 0); debug::println(ima); trait::image::print(sub); - - - { - instant_<I> tmp(ima); - } } Index: doc/tutorial/examples/p_line2d.cc --- doc/tutorial/examples/p_line2d.cc (revision 2505) +++ doc/tutorial/examples/p_line2d.cc (working copy) @@ -10,10 +10,6 @@ -# include <mln/core/image/instant.hh> - - - int main() { using namespace mln; @@ -25,7 +21,7 @@ point2d(1,1)); std::cout << line << std::endl; - level::fill(inplace(ima | line), 'x'); + level::fill((ima | line).rw(), 'x'); debug::println(ima); p_set<point2d> s; @@ -35,11 +31,4 @@ debug::println(pw::cst('o') | line); // ... - - - { - typedef image2d<char> I; - instant_<I> ima_(ima); - debug::println(ima_); - } } Index: doc/tutorial/examples/for_Z.cc --- doc/tutorial/examples/for_Z.cc (revision 2505) +++ doc/tutorial/examples/for_Z.cc (working copy) @@ -207,7 +207,7 @@ // image2d<rgb8> cool(ima.domain()); // level::fill(cool, literal::black); -// level::fill( inplace(cool | (pw::value(lab) == 1u)), +// level::fill( (cool | (pw::value(lab) == 1u)).rw(), // literal::red ); // debug::println(cool); Index: doc/examples/tuto_bis.cc --- doc/examples/tuto_bis.cc (revision 2505) +++ doc/examples/tuto_bis.cc (working copy) @@ -227,7 +227,7 @@ - mln_VAR(edge, extend(inplace(ima | is_edge), + mln_VAR(edge, extend((ima | is_edge).rw(), pw::value(ima))); level::paste(morpho::gradient(edge, e2c), edge); // ^^^ Index: mln/core/image/status.txt --- mln/core/image/status.txt (revision 2505) +++ mln/core/image/status.txt (working copy) @@ -45,7 +45,7 @@ ** domain morpher ok image_if -... sub_image = 1st attempt to use the 'instant' mechanism... +ok sub_image rm image_if_interval rm image_if_value @@ -56,7 +56,6 @@ ** identity morpher -new instant new extension_ima new extension_fun new extension_val Index: mln/core/image/all.hh --- mln/core/image/all.hh (revision 2505) +++ mln/core/image/all.hh (working copy) @@ -36,7 +36,6 @@ */ -# include <mln/core/image/instant.hh> // FIXME: Complete... Index: mln/core/image/hexa_piter.hh --- mln/core/image/hexa_piter.hh (revision 2505) +++ mln/core/image/hexa_piter.hh (working copy) @@ -37,7 +37,7 @@ # include <mln/core/alias/box2d.hh> # include <mln/core/alias/box2d_h.hh> -# include <mln/core/image/inplace.hh> + namespace mln { Index: mln/core/image/sub_image.hh --- mln/core/image/sub_image.hh (revision 2505) +++ mln/core/image/sub_image.hh (working copy) @@ -39,7 +39,7 @@ */ # include <mln/core/internal/image_domain_morpher.hh> -# include <mln/core/image/instant.hh> + namespace mln @@ -129,27 +129,11 @@ operator|(const Image<I>& ima, const Site_Set<S>& pset); -// template <typename I, typename S> -// sub_image<I, S> -// operator|(Image<I>& ima, const Site_Set<S>& pset); - - -// REPLACEMENT: - template <typename I, typename S> - instant_< sub_image<I, S> > + sub_image<I, S> operator|(Image<I>& ima, const Site_Set<S>& pset); -// NEW: - - template <typename I, typename S> - sub_image<I, S> - operator|(instant_<I> ima, const Site_Set<S>& pset) - { - return ima.un_instant() | pset; - } - template <typename I, typename S, typename J> void init_(tag::image_t, sub_image<I,S>& target, const J& model); @@ -241,18 +225,9 @@ return tmp; } -// template <typename I, typename S> -// inline -// sub_image<I, S> -// operator|(Image<I>& ima, const Site_Set<S>& pset) -// { -// sub_image<I, S> tmp(exact(ima), exact(pset)); -// return tmp; -// } - template <typename I, typename S> inline - instant_< sub_image<I, S> > + sub_image<I, S> operator|(Image<I>& ima, const Site_Set<S>& pset) { sub_image<I, S> tmp(exact(ima), exact(pset)); Index: mln/core/internal/image_morpher.hh --- mln/core/internal/image_morpher.hh (revision 2505) +++ mln/core/internal/image_morpher.hh (working copy) @@ -31,11 +31,14 @@ /*! \file mln/core/internal/image_morpher.hh * * \brief Definition of a base class for image morphers. + * + * \todo Add the appropriate checks in .rw(). */ # include <mln/core/internal/image_base.hh> # include <mln/metal/const.hh> # include <mln/metal/is_const.hh> +# include <mln/metal/is_not_const.hh> namespace mln @@ -77,6 +80,12 @@ /// Conversion to the underlying (morphed) image. operator I() const; // FIXME: Very dangerous? Remove? + + /// State that the morpher is writable. This allows for C++ to + /// use it as a mutable object even if it is a temporary object. + E& rw(); + + protected: image_morpher(); }; @@ -162,6 +171,18 @@ this->delegatee_()->has_data(); } + template <typename I, typename T, typename S, typename E> + inline + E& + image_morpher<I, T, S, E>::rw() + { + mlc_is_not_const(I)::check(); + mlc_equal(mln_trait_image_value_io(I), + mln::trait::image::value_io::read_write)::check(); + // FIXME Nicolas: pw_io == read_write OR vw_io == read_write... + return exact(*this); + } + } // end of namespace mln::internal Index: mln/level/fill_with_image.hh --- mln/level/fill_with_image.hh (revision 2505) +++ mln/level/fill_with_image.hh (working copy) @@ -36,7 +36,7 @@ */ # include <mln/core/concept/image.hh> -# include <mln/core/image/inplace.hh> + // Specializations are in: # include <mln/level/fill_with_image.spe.hh> Index: mln/level/paste.spe.hh --- mln/level/paste.spe.hh (revision 2505) +++ mln/level/paste.spe.hh (working copy) @@ -73,9 +73,12 @@ // typename I::line_piter p(data.domain()); // FIXME: Alias mln_line_piter! // // mln_line_piter(I) p(data.domain()); // for_all(p) -// memcpy_(inplace(make::pixel(destination, p)), +// { +// FIXME: TYPE pix = make::pixel(destination, p); +// memcpy_(pix, // make::pixel(data, p), // n); +// } // trace::exiting("level::impl::paste_lines_"); // } Index: mln/level/replace.hh --- mln/level/replace.hh (revision 2505) +++ mln/level/replace.hh (working copy) @@ -72,7 +72,7 @@ const mln_value(I)& new_value) { trace::entering("level::impl::generic::replace"); - level::fill(inplace(exact(input_) | pw::value(input_) == pw::cst(old_value)), new_value); + level::fill((exact(input_) | pw::value(input_) == pw::cst(old_value)).rw(), new_value); trace::exiting("level::impl::generic::replace"); } Index: mln/level/paste.hh --- mln/level/paste.hh (revision 2505) +++ mln/level/paste.hh (working copy) @@ -35,7 +35,7 @@ */ # include <mln/core/concept/image.hh> -# include <mln/core/image/inplace.hh> + // Specializations are in: Index: mln/level/fill_with_value.hh --- mln/level/fill_with_value.hh (revision 2505) +++ mln/level/fill_with_value.hh (working copy) @@ -44,8 +44,8 @@ # include <cstdlib> # include <mln/core/concept/image.hh> -# include <mln/core/image/inplace.hh> -# include <mln/core/image/instant.hh> + + // Specializations are in: # include <mln/level/fill_with_value.spe.hh> @@ -68,11 +68,6 @@ void fill_with_value(Image<I>& ima, const V& val); - // Case of instant images. - template <typename I, typename V> - void fill_with_value(const Image< instant_<I> >& ima, const V& val); - - # ifndef MLN_INCLUDE_ONLY @@ -138,15 +133,6 @@ } - // Un-instant. - - template <typename I, typename V> - void fill_with_value(const Image< instant_<I> >& ima, const V& val) - { - fill_with_value(exact(ima).un_instant_(), val); - } - - # endif // ! MLN_INCLUDE_ONLY } // end of namespace mln::level Index: mln/accu/rank.hh --- mln/accu/rank.hh (revision 2505) +++ mln/accu/rank.hh (working copy) @@ -39,7 +39,7 @@ # include <mln/core/concept/meta_accumulator.hh> # include <mln/trait/value_.hh> # include <mln/util/pix.hh> -# include <mln/core/image/inplace.hh> + namespace mln { Index: mln/accu/rank_high_quant.hh --- mln/accu/rank_high_quant.hh (revision 2505) +++ mln/accu/rank_high_quant.hh (working copy) @@ -38,7 +38,7 @@ # include <mln/core/concept/meta_accumulator.hh> # include <mln/trait/value_.hh> # include <mln/util/pix.hh> -# include <mln/core/image/inplace.hh> + namespace mln { @@ -149,8 +149,7 @@ T rank_<T>::to_result() const { - // Fixme : Call to inplace to unconst (*this). - inplace(*this).sort(); + const_cast<rank_<T>&>(*this).sort(); if (n_ == elts_.size()) return elts_[k_]; Index: mln/accu/rank_bool.hh --- mln/accu/rank_bool.hh (revision 2505) +++ mln/accu/rank_bool.hh (working copy) @@ -38,7 +38,7 @@ # include <mln/core/concept/meta_accumulator.hh> # include <mln/trait/value_.hh> # include <mln/util/pix.hh> -# include <mln/core/image/inplace.hh> + namespace mln { Index: mln/geom/chamfer.hh --- mln/geom/chamfer.hh (revision 2505) +++ mln/geom/chamfer.hh (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 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 @@ -37,7 +37,7 @@ # include <mln/core/alias/w_window2d_int.hh> # include <mln/core/alias/w_window2d_float.hh> # include <mln/core/image/sub_image.hh> -# include <mln/core/image/inplace.hh> + # include <mln/core/image/image_if.hh> # include <mln/canvas/chamfer.hh> @@ -83,8 +83,8 @@ inline void init() { initialize(output, exact(input)); - level::fill(inplace(output | (input | pw::cst(true)).domain()), 0); - level::fill(inplace(output | (input | pw::cst(false)).domain()), max); } + level::fill((output | (input | pw::cst(true)).domain()).rw(), 0); + level::fill((output | (input | pw::cst(false)).domain()).rw(), max); } inline bool handles(const P& p) const { return input(p) == false; } Index: sandbox/duhamel/slow_seed2tiling.cc --- sandbox/duhamel/slow_seed2tiling.cc (revision 2505) +++ sandbox/duhamel/slow_seed2tiling.cc (working copy) @@ -50,7 +50,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/image/sub_image.hh> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/make/win_chamfer.hh> Index: sandbox/duhamel/color_sub.cc --- sandbox/duhamel/color_sub.cc (revision 2505) +++ sandbox/duhamel/color_sub.cc (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 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 @@ -32,7 +32,7 @@ # include <mln/core/image2d_b.hh> # include <mln/core/image/sub_image.hh> -# include <mln/core/image/inplace.hh> + # include <mln/value/int_u8.hh> # include <mln/value/rgb8.hh> # include <mln/level/fill.hh> @@ -43,7 +43,7 @@ # include <mln/core/image_if_value.hh> # include <mln/core/image/sub_image.hh> # include <mln/core/image_if_value.hh> -# include <mln/core/image/inplace.hh> + # include <mln/debug/println.hh> # include <mln/core/alias/w_window2d_int.hh> @@ -64,7 +64,7 @@ image2d_b<bool> input = io::pbm::load("../../img/toto.pbm"); const w_window2d_int& w_win = win_chamfer::mk_chamfer_3x3_int<2, 0> (); image2d_b<unsigned> tmp = geom::chamfer(input, w_win, max); - image2d_b<value::rgb8> out = display::color_pretty(inplace (tmp | 4)); + image2d_b<value::rgb8> out = display::color_pretty(tmp | 4); io::ppm::save(out, "out.ppm"); std::cout << "out.ppm generate" << std::endl; } Index: sandbox/duhamel/chamfer.cc --- sandbox/duhamel/chamfer.cc (revision 2505) +++ sandbox/duhamel/chamfer.cc (working copy) @@ -1,7 +1,7 @@ #include <mln/core/image2d_b.hh> #include <mln/core/image/sub_image.hh> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/level/fill.hh> # include <mln/debug/println.hh> Index: sandbox/duhamel/chamfer.hh --- sandbox/duhamel/chamfer.hh (revision 2505) +++ sandbox/duhamel/chamfer.hh (working copy) @@ -76,8 +76,8 @@ unsigned max; void init() { initialize(output, exact(input)); - level::fill(inplace(output | (input | true).domain()), 0); - level::fill(inplace(output | (input | false).domain()), max); } + level::fill((output | (input | true).domain()).rw(), 0); + level::fill((output | (input | false).domain()).rw(), max); } bool handles(const P& p) const { return input(p) == false; } // end of requirements Index: sandbox/geraud/fllt.svg.6.cc --- sandbox/geraud/fllt.svg.6.cc (revision 2505) +++ sandbox/geraud/fllt.svg.6.cc (working copy) @@ -1003,7 +1003,7 @@ fllt_tree(P, V) subtree(node); fllt_branch_iter_ind(P, V) s(fllt_branch(P, V)(subtree, *node)); for_all(s) - level::fill(inplace(output | (*s).elt().points), (*s).elt().value); + level::fill(output | (*s).elt().points), (*s).elt().value); } void area_filter(image2d<value::int_u8>& output, @@ -1037,7 +1037,7 @@ } accu += (*node).elt().nsites; - level::fill(inplace(output | (*node).elt().points), g); + level::fill(output | (*node).elt().points), g); for (int i = 0; i < node->children().size();i++) area_filter_min(output, node->children()[i], min_area, g, accu); Index: sandbox/geraud/cs2d/tuto.cc --- sandbox/geraud/cs2d/tuto.cc (revision 2505) +++ sandbox/geraud/cs2d/tuto.cc (working copy) @@ -66,9 +66,9 @@ // // o o o - level::fill(inplace(ima | is_cell), 'c'); - level::fill(inplace(ima | is_edge), 'e'); - level::fill(inplace(ima | is_point), 'p'); + level::fill((ima | is_cell).rw(), 'c'); + level::fill((ima | is_edge).rw(), 'e'); + level::fill((ima | is_point).rw(), 'p'); debug::println(ima); // c e c e c @@ -85,7 +85,7 @@ // 0 0 0 0 0 // 0 0 0 0 0 - level::fill(inplace(ima | is_cell), fun::p2v::iota); + level::fill((ima | is_cell).rw(), fun::p2v::iota); debug::println(ima | is_cell); // 1 2 3 // Index: sandbox/geraud/fllt/fllt_tree_to_image.hh --- sandbox/geraud/fllt/fllt_tree_to_image.hh (revision 2505) +++ sandbox/geraud/fllt/fllt_tree_to_image.hh (working copy) @@ -9,7 +9,7 @@ void fllt_tree_to_image_(I& output, fllt_node(point2d, value::int_u8)* node) { - level::fill(inplace(output | node->elt().points), node->elt().value); + level::fill((output | node->elt().points).rw(), node->elt().value); for (int i = 0; i < node->children().size(); i++) fllt_tree_to_image_(output, node->children()[i]); Index: sandbox/geraud/fllt/fllt.svg.3.cc --- sandbox/geraud/fllt/fllt.svg.3.cc (revision 2505) +++ sandbox/geraud/fllt/fllt.svg.3.cc (working copy) @@ -189,7 +189,7 @@ { // R <- 0 and N <- 0 if (N_box.is_valid() != 0) - level::fill(inplace(is | N_box.to_result()), in_O); + level::fill((is | N_box.to_result()).rw(), in_O); clear_N(N); N_box.init(); Index: sandbox/geraud/fllt/fllt.svg.4.cc --- sandbox/geraud/fllt/fllt.svg.4.cc (revision 2505) +++ sandbox/geraud/fllt/fllt.svg.4.cc (working copy) @@ -195,8 +195,8 @@ // R <- 0 and N <- 0 if (N_box.is_valid() != 0) { -// level::fill(inplace(is | N_box.to_result()), in_O); - level::fill(inplace(deja_vu | N_box.to_result()), false); +// level::fill((is | N_box.to_result()).rw(), in_O); + level::fill(deja_vu | N_box.to_result()), false); } clear_N(N); N_box.init(); @@ -296,7 +296,7 @@ for (unsigned i = 0; i < 256; ++i) if (N[i].nsites()) - level::fill(inplace(deja_vu | N[i]), false); + level::fill(deja_vu | N[i]), false); // { // mln_piter(arr_t) p(N[i]); // for_all(p) Index: sandbox/geraud/fllt/fllt.svg.5.cc --- sandbox/geraud/fllt/fllt.svg.5.cc (revision 2505) +++ sandbox/geraud/fllt/fllt.svg.5.cc (working copy) @@ -197,8 +197,8 @@ // R <- 0 and N <- 0 if (N_box.is_valid() != 0) { -// level::fill(inplace(is | N_box.to_result()), in_O); - level::fill(inplace(deja_vu | N_box.to_result()), false); +// level::fill((is | N_box.to_result()).rw(), in_O); + level::fill(deja_vu | N_box.to_result()), false); } clear_N(N); N_box.init(); @@ -302,7 +302,7 @@ for (unsigned i = 0; i < 256; ++i) if (N[i]->nsites()) - level::fill(inplace(deja_vu | *N[i]), false); + level::fill(deja_vu | *N[i]), false); // mln_invariant(deja_vu == ((pw::value(is) == pw::cst(in_R)) | input.domain())); Index: sandbox/geraud/fllt/fllt.svg.6.cc --- sandbox/geraud/fllt/fllt.svg.6.cc (revision 2505) +++ sandbox/geraud/fllt/fllt.svg.6.cc (working copy) @@ -1003,7 +1003,7 @@ fllt_tree(P, V) subtree(node); fllt_branch_iter_ind(P, V) s(fllt_branch(P, V)(subtree, *node)); for_all(s) - level::fill(inplace(output | (*s).elt().points), (*s).elt().value); + level::fill(output | (*s).elt().points), (*s).elt().value); } void area_filter(image2d<value::int_u8>& output, @@ -1037,7 +1037,7 @@ } accu += (*node).elt().nsites; - level::fill(inplace(output | (*node).elt().points), g); + level::fill(output | (*node).elt().points), g); for (int i = 0; i < node->children().size();i++) area_filter_min(output, node->children()[i], min_area, g, accu); Index: sandbox/geraud/fllt/fllt_test.hh --- sandbox/geraud/fllt/fllt_test.hh (revision 2505) +++ sandbox/geraud/fllt/fllt_test.hh (working copy) @@ -474,7 +474,7 @@ fllt_branch_iter(P, V) n(*child); for_all(n) - level::fill(inplace(ima | (*n).elt().points), true); + level::fill((ima | (*n).elt().points).rw(), true); tmp.append((*n).elt().points); Index: sandbox/geraud/Rd/debase.union_find.hh --- sandbox/geraud/Rd/debase.union_find.hh (revision 2505) +++ sandbox/geraud/Rd/debase.union_find.hh (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 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 @@ -70,7 +70,7 @@ // init std::cout << "0 "; - level::fill(inplace(is_proc), false); + level::fill(is_proc, false); S = histo_reverse_sort(g); // first pass @@ -91,7 +91,7 @@ // second pass std::cout << "2 "; - level::fill(inplace(is_proc), false); + level::fill(is_proc, false); for (int i = S.size() - 1; i >= 0; --i) { point p = S[i]; Index: sandbox/vigouroux/yuv/get_blue.hh --- sandbox/vigouroux/yuv/get_blue.hh (revision 2505) +++ sandbox/vigouroux/yuv/get_blue.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/yuv/get_red.hh --- sandbox/vigouroux/yuv/get_red.hh (revision 2505) +++ sandbox/vigouroux/yuv/get_red.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/yuv/rgb_to_yuv.hh --- sandbox/vigouroux/yuv/rgb_to_yuv.hh (revision 2505) +++ sandbox/vigouroux/yuv/rgb_to_yuv.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/yuv/get_green.hh --- sandbox/vigouroux/yuv/get_green.hh (revision 2505) +++ sandbox/vigouroux/yuv/get_green.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/hsi/get_blue.hh --- sandbox/vigouroux/hsi/get_blue.hh (revision 2505) +++ sandbox/vigouroux/hsi/get_blue.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/hsi/get_red.hh --- sandbox/vigouroux/hsi/get_red.hh (revision 2505) +++ sandbox/vigouroux/hsi/get_red.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/hsi/rgb_to_hsi.hh --- sandbox/vigouroux/hsi/rgb_to_hsi.hh (revision 2505) +++ sandbox/vigouroux/hsi/rgb_to_hsi.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/hsi/get_green.hh --- sandbox/vigouroux/hsi/get_green.hh (revision 2505) +++ sandbox/vigouroux/hsi/get_green.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/function.hh --- sandbox/vigouroux/function.hh (revision 2505) +++ sandbox/vigouroux/function.hh (working copy) @@ -1,5 +1,5 @@ #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/tests.cc --- sandbox/vigouroux/tests.cc (revision 2505) +++ sandbox/vigouroux/tests.cc (working copy) @@ -1,5 +1,5 @@ #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/cmy/rgb_to_cmy.hh --- sandbox/vigouroux/cmy/rgb_to_cmy.hh (revision 2505) +++ sandbox/vigouroux/cmy/rgb_to_cmy.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/cmy/get_blue.hh --- sandbox/vigouroux/cmy/get_blue.hh (revision 2505) +++ sandbox/vigouroux/cmy/get_blue.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/cmy/fun.hh --- sandbox/vigouroux/cmy/fun.hh (revision 2505) +++ sandbox/vigouroux/cmy/fun.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/cmy/get_green.hh --- sandbox/vigouroux/cmy/get_green.hh (revision 2505) +++ sandbox/vigouroux/cmy/get_green.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/xyz/rgb_to_xyz.hh --- sandbox/vigouroux/xyz/rgb_to_xyz.hh (revision 2505) +++ sandbox/vigouroux/xyz/rgb_to_xyz.hh (working copy) @@ -2,7 +2,7 @@ # define OLENA_CONVERT_RGBXYZ_HH # include <mln/core/image_if_value.hh> -# include <mln/core/image/inplace.hh> + # include <mln/core/alias/w_window2d_int.hh> # include <mln/display/show.hh> # include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/xyz/get_blue.hh --- sandbox/vigouroux/xyz/get_blue.hh (revision 2505) +++ sandbox/vigouroux/xyz/get_blue.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/xyz/get_red.hh --- sandbox/vigouroux/xyz/get_red.hh (revision 2505) +++ sandbox/vigouroux/xyz/get_red.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/xyz/get_green.hh --- sandbox/vigouroux/xyz/get_green.hh (revision 2505) +++ sandbox/vigouroux/xyz/get_green.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/yiq/get_blue.hh --- sandbox/vigouroux/yiq/get_blue.hh (revision 2505) +++ sandbox/vigouroux/yiq/get_blue.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/yiq/get_red.hh --- sandbox/vigouroux/yiq/get_red.hh (revision 2505) +++ sandbox/vigouroux/yiq/get_red.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/yiq/rgb_to_yiq.hh --- sandbox/vigouroux/yiq/rgb_to_yiq.hh (revision 2505) +++ sandbox/vigouroux/yiq/rgb_to_yiq.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/yiq/get_green.hh --- sandbox/vigouroux/yiq/get_green.hh (revision 2505) +++ sandbox/vigouroux/yiq/get_green.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/conv/getred.hh --- sandbox/vigouroux/conv/getred.hh (revision 2505) +++ sandbox/vigouroux/conv/getred.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/conv/tored.hh --- sandbox/vigouroux/conv/tored.hh (revision 2505) +++ sandbox/vigouroux/conv/tored.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/conv/torgb.hh --- sandbox/vigouroux/conv/torgb.hh (revision 2505) +++ sandbox/vigouroux/conv/torgb.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/conv/rgbto.hh --- sandbox/vigouroux/conv/rgbto.hh (revision 2505) +++ sandbox/vigouroux/conv/rgbto.hh (working copy) @@ -1,7 +1,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/color/rgb_to_hsl.hh --- sandbox/vigouroux/color/rgb_to_hsl.hh (revision 2505) +++ sandbox/vigouroux/color/rgb_to_hsl.hh (working copy) @@ -2,7 +2,7 @@ # define OLENA_CONVERT_NRGBHSL_HH # include <mln/core/image_if_value.hh> -# include <mln/core/image/inplace.hh> + # include <mln/core/alias/w_window2d_int.hh> # include <mln/display/show.hh> # include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/color/rgb_to_cmy.hh --- sandbox/vigouroux/color/rgb_to_cmy.hh (revision 2505) +++ sandbox/vigouroux/color/rgb_to_cmy.hh (working copy) @@ -1,5 +1,5 @@ #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/color/rgb_to_xyz.hh --- sandbox/vigouroux/color/rgb_to_xyz.hh (revision 2505) +++ sandbox/vigouroux/color/rgb_to_xyz.hh (working copy) @@ -2,7 +2,7 @@ # define OLENA_CONVERT_RGBXYZ_HH # include <mln/core/image_if_value.hh> -# include <mln/core/image/inplace.hh> + # include <mln/core/alias/w_window2d_int.hh> # include <mln/display/show.hh> # include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/color/tests.cc --- sandbox/vigouroux/color/tests.cc (revision 2505) +++ sandbox/vigouroux/color/tests.cc (working copy) @@ -1,5 +1,5 @@ #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/color/rgb_to_hsv.hh --- sandbox/vigouroux/color/rgb_to_hsv.hh (revision 2505) +++ sandbox/vigouroux/color/rgb_to_hsv.hh (working copy) @@ -2,7 +2,7 @@ # define OLENA_CONVERT_NRGBHSV_HH # include <mln/core/image_if_value.hh> -# include <mln/core/image/inplace.hh> + # include <mln/core/alias/w_window2d_int.hh> # include <mln/display/show.hh> # include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/color/rgb_to_yiq.hh --- sandbox/vigouroux/color/rgb_to_yiq.hh (revision 2505) +++ sandbox/vigouroux/color/rgb_to_yiq.hh (working copy) @@ -1,5 +1,5 @@ #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/color/rgb_to_hsi.hh --- sandbox/vigouroux/color/rgb_to_hsi.hh (revision 2505) +++ sandbox/vigouroux/color/rgb_to_hsi.hh (working copy) @@ -2,7 +2,7 @@ #include <cmath> #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/vigouroux/color/rgb_to_yuv.hh --- sandbox/vigouroux/color/rgb_to_yuv.hh (revision 2505) +++ sandbox/vigouroux/color/rgb_to_yuv.hh (working copy) @@ -1,5 +1,5 @@ #include <mln/core/image_if_value.hh> -#include <mln/core/image/inplace.hh> + #include <mln/core/alias/w_window2d_int.hh> #include <mln/display/show.hh> #include <mln/io/ppm/save.hh> Index: sandbox/garrigues/level_set.hh --- sandbox/garrigues/level_set.hh (revision 2505) +++ sandbox/garrigues/level_set.hh (working copy) @@ -43,7 +43,7 @@ # include <mln/core/alias/point2d.hh> # include <mln/core/site_set/p_set.hh> -# include <mln/core/image/inplace.hh> + # include <mln/core/alias/neighb2d.hh> # include <mln/core/clock_neighb2d.hh> # include <mln/core/p_if_piter.hh> Index: sandbox/garrigues/fllt/fllt_simple.svg.1.cc --- sandbox/garrigues/fllt/fllt_simple.svg.1.cc (revision 2505) +++ sandbox/garrigues/fllt/fllt_simple.svg.1.cc (working copy) @@ -192,7 +192,7 @@ std::cout << "Step 2" << std::endl; #endif if (N_box.is_valid()) - level::fill(inplace(is | N_box.to_result()), in_O); + level::fill((is | N_box.to_result()).rw(), in_O); N_box.init(); R_box.init(); Index: sandbox/garrigues/fllt/fllt_simple.svg.3.cc --- sandbox/garrigues/fllt/fllt_simple.svg.3.cc (revision 2505) +++ sandbox/garrigues/fllt/fllt_simple.svg.3.cc (working copy) @@ -387,7 +387,7 @@ std::cout << "Step 2" << std::endl; #endif if (N_box.is_valid()) - level::fill(inplace(is | N_box.to_result()), in_O); + level::fill((is | N_box.to_result()).rw(), in_O); N_box.init(); R_box.init(); Index: sandbox/garrigues/fllt/fllt_simple.cc --- sandbox/garrigues/fllt/fllt_simple.cc (revision 2505) +++ sandbox/garrigues/fllt/fllt_simple.cc (working copy) @@ -505,7 +505,7 @@ std::cout << "Step 2" << std::endl; #endif if (N_box.is_valid()) - level::fill(inplace(is | N_box.to_result()), in_O); + level::fill((is | N_box.to_result()).rw(), in_O); N_box.init(); R_box.init(); Index: sandbox/garrigues/fllt/compute_level_set_fast2.hh --- sandbox/garrigues/fllt/compute_level_set_fast2.hh (revision 2505) +++ sandbox/garrigues/fllt/compute_level_set_fast2.hh (working copy) @@ -244,7 +244,7 @@ // static image2d<bool> border_ima(tmp.domain()); // level::fill(border_ima, false); -// // level::fill(inplace(border_ima | N), true); +// // level::fill((border_ima | N).rw(), true); // // std::cout << "tmp border = " << tmp.border () << std::endl; // // std::cout << "ima border = " << border_ima.border () << std::endl; // mln_piter(p_image2d<P>) z(N); Index: sandbox/garrigues/fllt/debug.hh --- sandbox/garrigues/fllt/debug.hh (revision 2505) +++ sandbox/garrigues/fllt/debug.hh (working copy) @@ -187,11 +187,11 @@ level::fill(out, literal::white); if (R.nsites() != 0) - level::fill(inplace(out | R), literal::green); + level::fill((out | R).rw(), literal::green); if (A.nsites() != 0) - level::fill(inplace(out | A), literal::blue); + level::fill((out | A).rw(), literal::blue); if (N.nsites() != 0) - level::fill(inplace(out | N), literal::red); + level::fill((out | N).rw(), literal::red); io::ppm::save(out, filename.str()); } Index: sandbox/garrigues/fllt/compute_level_set_fast.hh --- sandbox/garrigues/fllt/compute_level_set_fast.hh (revision 2505) +++ sandbox/garrigues/fllt/compute_level_set_fast.hh (working copy) @@ -238,7 +238,7 @@ // static image2d<bool> border_ima(tmp.domain()); // level::fill(border_ima, false); -// // level::fill(inplace(border_ima | N), true); +// // level::fill((border_ima | N).rw(), true); // // std::cout << "tmp border = " << tmp.border () << std::endl; // // std::cout << "ima border = " << border_ima.border () << std::endl; // mln_piter(p_image2d<P>) z(N); Index: sandbox/garrigues/fllt/fllt_simple.svg.2.cc --- sandbox/garrigues/fllt/fllt_simple.svg.2.cc (revision 2505) +++ sandbox/garrigues/fllt/fllt_simple.svg.2.cc (working copy) @@ -209,7 +209,7 @@ std::cout << "Step 2" << std::endl; #endif if (N_box.is_valid()) - level::fill(inplace(is | N_box.to_result()), in_O); + level::fill((is | N_box.to_result()).rw(), in_O); N_box.init(); R_box.init(); Index: sandbox/garrigues/fllt/fllt.hh --- sandbox/garrigues/fllt/fllt.hh (revision 2505) +++ sandbox/garrigues/fllt/fllt.hh (working copy) @@ -37,7 +37,7 @@ # include <mln/core/image/image2d.hh> # include <mln/core/site_set/p_set.hh> -# include <mln/core/image/inplace.hh> + # include <mln/core/alias/neighb2d.hh> # include <mln/core/p_if_piter.hh> # include <mln/core/site_set/p_if.hh> Index: sandbox/garrigues/fllt/compute_level_set.hh --- sandbox/garrigues/fllt/compute_level_set.hh (revision 2505) +++ sandbox/garrigues/fllt/compute_level_set.hh (working copy) @@ -179,7 +179,7 @@ static image2d<bool> border_ima(tmp.domain()); level::fill(border_ima, false); - // level::fill(inplace(border_ima | N), true); + // level::fill((border_ima | N).rw(), true); // std::cout << "tmp border = " << tmp.border () << std::endl; // std::cout << "ima border = " << border_ima.border () << std::endl; mln_piter(p_set<P>) z(N); Index: sandbox/garrigues/tiled_image2d/tiled_image2d.hh --- sandbox/garrigues/tiled_image2d/tiled_image2d.hh (revision 2505) +++ sandbox/garrigues/tiled_image2d/tiled_image2d.hh (working copy) @@ -36,7 +36,7 @@ # include <mln/core/internal/image_primary.hh> # include <mln/core/internal/fixme.hh> # include <mln/core/alias/box2d.hh> -# include <mln/core/image/inplace.hh> + # include <mln/core/routine/init.hh> # include <mln/core/line_piter.hh> Index: sandbox/garrigues/factures/extract_array_highlight.cc --- sandbox/garrigues/factures/extract_array_highlight.cc (revision 2505) +++ sandbox/garrigues/factures/extract_array_highlight.cc (working copy) @@ -37,7 +37,7 @@ #include <mln/win/disk2d.hh> #include <mln/pw/all.hh> -#include <mln/core/image/inplace.hh> + #include <mln/level/stretch.hh> #include <mln/level/median.hh> #include <mln/morpho/gradient.hh> @@ -150,7 +150,7 @@ // Binarisation. ima2d_bool bin(in.domain()); - level::paste(inplace(pw::value(in) > pw::cst(50) | in.domain()), bin); + level::paste(pw::value(in) > pw::cst(50) | in.domain(), bin); image2d<value::rgb8> output_h = highlight_hlines(bin); image2d<value::rgb8> output_v = highlight_vlines(bin); Index: sandbox/garrigues/factures/extract_array.cc --- sandbox/garrigues/factures/extract_array.cc (revision 2505) +++ sandbox/garrigues/factures/extract_array.cc (working copy) @@ -35,7 +35,7 @@ #include <mln/win/rectangle2d.hh> #include <mln/pw/all.hh> -#include <mln/core/image/inplace.hh> + #include <mln/level/stretch.hh> #include <mln/labeling/level.hh> #include <mln/literal/all.hh> @@ -63,7 +63,7 @@ // Binarisation. ima2d_bool bin(small.domain()); - level::paste(inplace(pw::value(small) > pw::cst(50) | small.domain()), bin); + level::paste(pw::value(small) > pw::cst(50) | small.domain(), bin); // Labeling. unsigned nlabels; @@ -108,7 +108,7 @@ // Draw the bounding boxes. for (int i = 0; i < nlabels; i++) if (is_array[i]) - draw::box(output, inplace(caracteristics[i].to_result().first), inplace(value::rgb8(literal::green))); + draw::box(output, caracteristics[i].to_result().first, value::rgb8(literal::green)); io::ppm::save(output, "array.ppm"); } Index: sandbox/ballas/test.cc --- sandbox/ballas/test.cc (revision 2505) +++ sandbox/ballas/test.cc (working copy) @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008 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 @@ -40,30 +40,30 @@ image1d<float> ima1d3(5); image1d<double> ima1d4(5); - level::fill(inplace(ima1d1), 5); - level::fill(inplace(ima1d2), 5); - level::fill(inplace(ima1d3), 5); - level::fill(inplace(ima1d4), 5); + level::fill(ima1d1, 5); + level::fill(ima1d2, 5); + level::fill(ima1d3, 5); + level::fill(ima1d4, 5); image2d<char> ima2d1(5, 5); image2d<int> ima2d2(5, 5); image2d<float> ima2d3(5, 5); image2d<double> ima2d4(5, 5); - level::fill(inplace(ima2d1), 5); - level::fill(inplace(ima2d2), 5); - level::fill(inplace(ima2d3), 5); - level::fill(inplace(ima2d4), 5); + level::fill(ima2d1, 5); + level::fill(ima2d2, 5); + level::fill(ima2d3, 5); + level::fill(ima2d4, 5); image3d<char> ima3d1(5, 5, 5); image3d<int> ima3d2(5, 5, 5); image3d<float> ima3d3(5, 5, 5); image3d<double> ima3d4(5, 5, 5); - level::fill(inplace(ima3d1), 5); - level::fill(inplace(ima3d2), 5); - level::fill(inplace(ima3d3), 5); - level::fill(inplace(ima3d4), 5); + level::fill(ima3d1, 5); + level::fill(ima3d2, 5); + level::fill(ima3d3, 5); + level::fill(ima3d4, 5); return 0; }
participants (1)
-
Thierry Geraud