
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Nicolas Ballas <ballas@lrde.epita.fr> Replace calls of the method .at by the function opt::at. * mln/debug/println.spe.hh, * mln/core/pixter2d.hh, * mln/core/pixter3d.hh, * mln/level/was.median.hh, * mln/make/image.hh, * sandbox/duhamel/chamfer.cc, * sandbox/scribo/demat.hh, * sandbox/aroumougame/skeleton/miscellenous.hh, * sandbox/aroumougame/skeleton/sedt.hh, * sandbox/jardonnet/n_cmpt/fused_filter.cc, * sandbox/jardonnet/n_cmpt/ref_filter.cc, * sandbox/garrigues/ocr/skeleton.old.hh, * sandbox/garrigues/ocr/enlarge.hh, * sandbox/abraham/tests/transform/fft_.cc, * sandbox/abraham/mln/transform/fft.hh, * sandbox/inim/classif/src/proj.hh, * sandbox/inim/binarization/proof-of-concept/src/gradient.cc, * sandbox/inim/binarization/binarization.hh, * sandbox/nature/nature.cc, * sandbox/nature/co_occurence.hh, * sandbox/nature/proj.hh, * sandbox/ballas/color/min_tree_volume_filter.cc, * sandbox/ballas/color/reference.cc, * sandbox/ballas/color/min_tree_area_filter.cc, * sandbox/ballas/color/min_tree_height_filter.cc, * sandbox/ballas/color/min_tree_color.cc, * sandbox/ballas/color/reference2.cc, * sandbox/ballas/color/min_tree_color_v2.cc, * sandbox/ballas/color/laplacien.cc, * sandbox/geraud/wst_edge.cc, * sandbox/geraud/fllt.svg.6.cc, * sandbox/geraud/browsing/fwd.cc, * sandbox/geraud/fllt/fllt.hh, * sandbox/geraud/fllt/fllt.svg.7.hh, * sandbox/geraud/fllt/fllt.svg.2.cc, * 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_test.hh, * sandbox/geraud/fllt.svg.7.hh, * sandbox/geraud/dmap.cc, * sandbox/geraud/tufa_2008/steps.0.cc, * sandbox/geraud/tufa_2008/steps.1.cc, * sandbox/geraud/tufa_2008/steps.2.cc, * sandbox/geraud/tufa_2008/steps.3.cc, * sandbox/geraud/tufa_2008/steps.2b.cc, * sandbox/geraud/tufa_2008/compute_a.cc, * sandbox/geraud/tufa_2008/fz_count.cc, * sandbox/geraud/tufa_2008/regmin_count.cc, * tests/debug/println_with_border.cc, * tests/debug/println.cc, * tests/histo/compute.cc, * tests/core/other/pixel.cc, * tests/level/convert.cc, * tests/level/memset_.cc, * tests/transform/distance_geodesic.cc, * tests/transform/distance_front.cc, * tests/make/dual_neighb.cc, * tests/morpho/artificial_line_graph_image_wst.cc, * tests/canvas/chamfer.cc, * doc/tutorial/samples/ima2d-3.cc, * doc/tutorial/examples/image_plain.cc, * doc/benchmark/image2d.cc, * doc/examples/labeling_algo.cc: Replace .at by opt::add. * tests/opt/Makefile.am: New Makefile.am for opt test dir. * tests/Makefile.am: Add opt subdir. doc/benchmark/image2d.cc | 5 doc/examples/labeling_algo.cc | 4 doc/tutorial/examples/image_plain.cc | 9 - doc/tutorial/samples/ima2d-3.cc | 8 - mln/core/pixter2d.hh | 5 mln/core/pixter3d.hh | 9 - mln/debug/println.spe.hh | 5 mln/level/was.median.hh | 12 + mln/make/image.hh | 5 sandbox/abraham/mln/transform/fft.hh | 27 ++-- sandbox/abraham/tests/transform/fft_.cc | 5 sandbox/aroumougame/skeleton/miscellenous.hh | 7 - sandbox/aroumougame/skeleton/sedt.hh | 81 ++++++------ sandbox/ballas/color/laplacien.cc | 3 sandbox/ballas/color/min_tree_area_filter.cc | 16 +- sandbox/ballas/color/min_tree_color.cc | 15 +- sandbox/ballas/color/min_tree_color_v2.cc | 15 +- sandbox/ballas/color/min_tree_height_filter.cc | 15 +- sandbox/ballas/color/min_tree_volume_filter.cc | 15 +- sandbox/ballas/color/reference.cc | 31 ++-- sandbox/ballas/color/reference2.cc | 18 +- sandbox/duhamel/chamfer.cc | 8 - sandbox/garrigues/ocr/enlarge.hh | 85 ++++++------- sandbox/garrigues/ocr/skeleton.old.hh | 7 - sandbox/geraud/browsing/fwd.cc | 37 ++--- sandbox/geraud/dmap.cc | 3 sandbox/geraud/fllt.svg.6.cc | 4 sandbox/geraud/fllt.svg.7.hh | 3 sandbox/geraud/fllt/fllt.hh | 3 sandbox/geraud/fllt/fllt.svg.2.cc | 4 sandbox/geraud/fllt/fllt.svg.3.cc | 4 sandbox/geraud/fllt/fllt.svg.4.cc | 4 sandbox/geraud/fllt/fllt.svg.5.cc | 4 sandbox/geraud/fllt/fllt.svg.7.hh | 4 sandbox/geraud/fllt/fllt_test.hh | 4 sandbox/geraud/tufa_2008/compute_a.cc | 5 sandbox/geraud/tufa_2008/fz_count.cc | 5 sandbox/geraud/tufa_2008/regmin_count.cc | 6 sandbox/geraud/tufa_2008/steps.0.cc | 5 sandbox/geraud/tufa_2008/steps.1.cc | 5 sandbox/geraud/tufa_2008/steps.2.cc | 5 sandbox/geraud/tufa_2008/steps.2b.cc | 5 sandbox/geraud/tufa_2008/steps.3.cc | 6 sandbox/geraud/wst_edge.cc | 18 +- sandbox/inim/binarization/binarization.hh | 7 - sandbox/inim/binarization/proof-of-concept/src/gradient.cc | 3 sandbox/inim/classif/src/proj.hh | 7 - sandbox/jardonnet/n_cmpt/fused_filter.cc | 6 sandbox/jardonnet/n_cmpt/ref_filter.cc | 6 sandbox/nature/co_occurence.hh | 3 sandbox/nature/nature.cc | 14 +- sandbox/nature/proj.hh | 3 sandbox/scribo/demat.hh | 11 - tests/Makefile.am | 1 tests/canvas/chamfer.cc | 8 - tests/core/other/pixel.cc | 5 tests/debug/println.cc | 3 tests/debug/println_with_border.cc | 29 ++-- tests/histo/compute.cc | 4 tests/level/convert.cc | 9 - tests/level/memset_.cc | 5 tests/make/dual_neighb.cc | 5 tests/morpho/artificial_line_graph_image_wst.cc | 4 tests/opt/Makefile.am | 10 + tests/transform/distance_front.cc | 3 tests/transform/distance_geodesic.cc | 3 66 files changed, 395 insertions(+), 298 deletions(-) Index: mln/debug/println.spe.hh --- mln/debug/println.spe.hh (revision 3062) +++ mln/debug/println.spe.hh (working copy) @@ -46,6 +46,7 @@ # include <mln/debug/put_word.hh> # include <mln/level/fill.hh> # include <mln/accu/max.hh> +# include <mln/opt/at.hh> //FIXME: do not include all these headers # include <mln/core/alias/box2d.hh> @@ -86,7 +87,7 @@ for (int row = b.min_row(); row <= b.max_row(); ++row) { for (int col = b.min_col(); col <= b.max_col(); ++col) - std::cout << input.at(row, col) << ' '; + std::cout << opt::at(input, row, col) << ' '; std::cout << std::endl; } std::cout << std::endl; @@ -122,7 +123,7 @@ for (unsigned row = 0; row < b.nrows(); ++row) { for (unsigned col = 0; col < b.ncols() * len; ++col) - std::cout << output.at(row, col); + std::cout << opt::at(output, row, col); std::cout << std::endl; } std::cout << std::endl; Index: mln/core/pixter2d.hh --- mln/core/pixter2d.hh (revision 3062) +++ mln/core/pixter2d.hh (working copy) @@ -35,6 +35,7 @@ # include <mln/core/internal/pixel_iterator_base.hh> # include <mln/core/alias/point2d.hh> # include <mln/geom/size2d.hh> +# include <mln/opt/at.hh> namespace mln { @@ -117,7 +118,7 @@ : super_(image), border_x2_(2 * image.border()), row_offset_(image.bbox().ncols() + border_x2_), - eor_(& image.at(geom::min_row(image), geom::max_col(image)) + 1) + eor_(& opt::at(image, geom::min_row(image), geom::max_col(image)) + 1) { mln_precondition(image.has_data()); } @@ -146,7 +147,7 @@ : super_(image), border_x2_(2 * image.border()), row_offset_(image.bbox().ncols() + border_x2_), - bor_(& image.at(geom::max_row(image), geom::min_col(image)) - 1) + bor_(& opt::at(image, geom::max_row(image), geom::min_col(image)) - 1) { mln_precondition(image.has_data()); } Index: mln/core/pixter3d.hh --- mln/core/pixter3d.hh (revision 3062) +++ mln/core/pixter3d.hh (working copy) @@ -35,6 +35,7 @@ # include <mln/core/internal/pixel_iterator_base.hh> # include <mln/core/alias/point3d.hh> # include <mln/geom/size3d.hh> +# include <mln/opt/at.hh> namespace mln { @@ -133,14 +134,14 @@ : super_(image), border_x2_(2 * image.border()), row_offset_(image.bbox().ncols() + border_x2_), - eor_(& image.at(geom::min_sli(image), + eor_(& opt::at(image, geom::min_sli(image), geom::min_row(image), geom::max_col(image)) + 1), next_sli_offset_(row_offset_ * border_x2_ + border_x2_), next_srow_offset_(next_sli_offset_ + image.bbox().ncols()), sli_offset_((image.bbox().ncols() + border_x2_) * (image.bbox().nrows() + border_x2_)), - eos_(& image.at(geom::min_sli(image), + eos_(& opt::at(image, geom::min_sli(image), geom::max_row(image), geom::max_col(image)) + 1) { @@ -177,14 +178,14 @@ : super_(image), border_x2_(2 * image.border()), row_offset_(image.bbox().ncols() + border_x2_), - bor_(& image.at(geom::max_sli(image), + bor_(& opt::at(image, geom::max_sli(image), geom::max_row(image), geom::min_col(image)) - 1), next_sli_offset_(row_offset_ * border_x2_ + border_x2_), next_srow_offset_(next_sli_offset_ + image.bbox().ncols()), sli_offset_((image.bbox().ncols() + border_x2_) * (image.bbox().nrows() + border_x2_)), - bos_(& image.at(geom::max_sli(image), + bos_(& opt::at(image, geom::max_sli(image), geom::min_row(image), geom::min_col(image)) - 1) { Index: mln/level/was.median.hh --- mln/level/was.median.hh (revision 3062) +++ mln/level/was.median.hh (working copy) @@ -47,6 +47,8 @@ # include <mln/level/median.hh> # include <mln/win/hline2d.hh> +# include <mln/opt/at.hh> + namespace mln { @@ -167,12 +169,12 @@ // initialization (before first point of the row) med.init(); for (ct = min_col; ct < min_col + half; ++ct) - med.take(input.at(row, ct)); + med.take(opt::at(input, row, ct)); // left columns (just take new points) for (col = min_col; col <= min_col + half; ++col, ++ct) { - med.take(input.at(row, ct)); + med.take(opt::at(input, row, ct)); output(p) = med; } @@ -180,15 +182,15 @@ cu = min_col; for (; col <= max_col - half; ++cu, ++col, ++ct) { - med.take(input.at(row, ct)); - med.untake(input.at(row, cu)); + med.take(opt::at(input, row, ct)); + med.untake(opt::at(input, row, cu)); output(p) = med; } // right columns (now just untake old points) for (; col <= max_col; ++cu, ++col) { - med.untake(input.at(row, cu)); + med.untake(opt::at(input, row, cu)); output(p) = med; } } Index: mln/make/image.hh --- mln/make/image.hh (revision 3062) +++ mln/make/image.hh (working copy) @@ -36,6 +36,7 @@ # include <mln/core/image/image1d.hh> # include <mln/core/image/image2d.hh> # include <mln/core/image/image3d.hh> +# include <mln/opt/at.hh> @@ -97,7 +98,7 @@ mln::image2d<V> tmp(R, C); for (unsigned row = 0; row < R; ++row) for (unsigned col = 0; col < C; ++col) - tmp.at(row, col) = values[row][col]; + opt::at(tmp, row, col) = values[row][col]; return tmp; } @@ -110,7 +111,7 @@ for (unsigned sli = 0; sli < S; ++sli) for (unsigned row = 0; row < R; ++row) for (unsigned col = 0; col < C; ++col) - tmp.at(sli, row, col) = values[sli][row][col]; + opt::at(tmp, sli, row, col) = values[sli][row][col]; return tmp; } Index: sandbox/duhamel/chamfer.cc --- sandbox/duhamel/chamfer.cc (revision 3062) +++ sandbox/duhamel/chamfer.cc (working copy) @@ -9,6 +9,8 @@ # include <mln/core/alias/w_window2d_float.hh> # include <mln/core/image_if_interval.hh> +# include <mln/opt/at.hh> + # include "win_chamfer.hh" # include "chamfer.hh" @@ -21,7 +23,7 @@ { level::fill(ima, false); - ima.at(4,4) = true; + opt::at(ima, 4,4) = true; const w_window2d_int& w_win = win_chamfer::mk_chamfer_3x3_int<2, 0> (); image2d_b<unsigned> out = geom::chamfer(ima, w_win, max); debug::println(out | value::interval(0, 8)); @@ -29,7 +31,7 @@ { level::fill(ima, false); - ima.at(4,4) = true; + opt::at(ima, 4,4) = true; const w_window2d_int& w_win = win_chamfer::mk_chamfer_3x3_int<2, 3> (); image2d_b<unsigned> out = geom::chamfer(ima, w_win, max); debug::println(out | value::interval(0, 8)); @@ -37,7 +39,7 @@ { level::fill(ima, false); - ima.at(4,4) = true; + opt::at(ima, 4,4) = true; const w_window2d_int& w_win = win_chamfer::mk_chamfer_5x5_int<4, 6, 9> (); image2d_b<unsigned> out = geom::chamfer(ima, w_win, max); image2d_b<unsigned>::fwd_piter p(out.domain()); Index: sandbox/scribo/demat.hh --- sandbox/scribo/demat.hh (revision 3062) +++ sandbox/scribo/demat.hh (working copy) @@ -50,6 +50,7 @@ # include <mln/make/graph.hh> # include <mln/util/graph.hh> # include <mln/util/line_graph.hh> +# include <mln/opt/at.hh> # include <mln/canvas/browsing/depth_first_search.hh> @@ -337,7 +338,7 @@ level::fill(l, -1); for_all_elements(i, aligned_lines) - l.at(aligned_lines[i]) = i; + opt::at(l, aligned_lines[i]) = i; for (unsigned i = 0; i < settings.max_dist_lines; ++i) l = morpho::elementary::dilation(l, c2()); @@ -345,10 +346,10 @@ for_all_components(i, boxes) { std::pair<point2d, point2d> cp = central_sites(boxes[i], dim); - if (l.at(cp.first[dim]) != -1) - boxes[i].pmin()[dim] = aligned_lines[l.at(cp.first[dim])]; - if (l.at(cp.second[dim]) != -1) - boxes[i].pmax()[dim] = aligned_lines[l.at(cp.second[dim])]; + if (opt::at(l, cp.first[dim]) != -1) + boxes[i].pmin()[dim] = aligned_lines[opt::at(l, cp.first[dim])]; + if (opt::at(l, cp.second[dim]) != -1) + boxes[i].pmax()[dim] = aligned_lines[opt::at(l, cp.second[dim])]; } } Index: sandbox/aroumougame/skeleton/miscellenous.hh --- sandbox/aroumougame/skeleton/miscellenous.hh (revision 3062) +++ sandbox/aroumougame/skeleton/miscellenous.hh (working copy) @@ -1,6 +1,7 @@ #include <mln/core/site_set/p_set.hh> #include <mln/core/image/image2d.hh> #include <mln/value/int_u.hh> +#include <mln/opt/at.hh> #include <vector> using namespace mln; @@ -78,10 +79,10 @@ for(int i=0; i<w; i++) for(int j=0; j<h; j++) { - if(pic.at(j,i)) - out.at(j,i) = 1; + if(opt::at(pic, j,i)) + opt::at(out, j,i) = 1; else - out.at(j,i) = 0; + opt::at(out, j,i) = 0; } return out; } Index: sandbox/aroumougame/skeleton/sedt.hh --- sandbox/aroumougame/skeleton/sedt.hh (revision 3062) +++ sandbox/aroumougame/skeleton/sedt.hh (working copy) @@ -15,6 +15,7 @@ #include <mln/geom/max_col.hh> #include <mln/geom/max_ind.hh> #include <mln/debug/println.hh> +#include <mln/opt/at.hh> using namespace mln; @@ -31,31 +32,31 @@ for(int j=0; j<h; j++) { - if(!pic.at(j,0)) + if(!opt::at(pic, j,0)) { - g.at(j,0)=0; + opt::at(g, j,0)=0; } else { - g.at(j,0)=1023; + opt::at(g, j,0)=1023; } for(int i=1; i<w; i++) { - if(!pic.at(j,i)) + if(!opt::at(pic, j,i)) { - g.at(j,i)=0; + opt::at(g, j,i)=0; } else { - g.at(j,i)=g.at(j,i-1)+1; + opt::at(g, j,i)=opt::at(g, j,i-1)+1; } } for(int i=w-2; i>=0; i--) { - if(g.at(j,i+1)<g.at(j,i)) - g.at(j,i)=1+g.at(j,i+1); + if(opt::at(g, j,i+1)<opt::at(g, j,i)) + opt::at(g, j,i)=1+opt::at(g, j,i+1); } } @@ -76,13 +77,13 @@ for(int j=1; j<h; j++) { - tmp1 = g.at(s[q],i)*g.at(s[q],i)+(t[q]-s[q])*(t[q]-s[q]); - tmp2 = g.at(j,i)*g.at(j,i)+(t[q]-j)*(t[q]-j); + tmp1 = opt::at(g, s[q],i)*opt::at(g, s[q],i)+(t[q]-s[q])*(t[q]-s[q]); + tmp2 = opt::at(g, j,i)*opt::at(g, j,i)+(t[q]-j)*(t[q]-j); while((q>=0)&&( tmp1>tmp2 )) { q--; - tmp1 = g.at(s[q],i)*g.at(s[q],i)+(t[q]-s[q])*(t[q]-s[q]); - tmp2 = g.at(j,i)*g.at(j,i)+(t[q]-j)*(t[q]-j); + tmp1 = opt::at(g, s[q],i)*opt::at(g, s[q],i)+(t[q]-s[q])*(t[q]-s[q]); + tmp2 = opt::at(g, j,i)*opt::at(g, j,i)+(t[q]-j)*(t[q]-j); } if(q<0) { @@ -91,7 +92,7 @@ } else { - v=1+(j*j-s[q]*s[q]+g.at(j,i)*g.at(j,i)-g.at(s[q],i)*g.at(s[q],i))/(2*(j-s[q])); + v=1+(j*j-s[q]*s[q]+g.at(j,i)*g.at(j,i)-g.at(s[q],i)*opt::at(g, s[q],i))/(2*(j-s[q])); if(v<h) { q++; @@ -103,7 +104,7 @@ for(int j= h-1; j>=0; j--) { - dt.at(j,i)= g.at(s[q],i)*g.at(s[q],i)+(j-s[q])*(j-s[q]); + dt.at(j,i)= opt::at(g, s[q],i)*opt::at(g, s[q],i)+(j-s[q])*(j-s[q]); if(j==t[q]) q--; } @@ -125,7 +126,7 @@ image2d<int> DTg(L, L); /* compute bound xM[ and verify that xM < L */ - for (xM = 0; xM < L; xM++) if (CTg.at(0,xM) > R) break; + for (xM = 0; xM < L; xM++) if (opt::at(CTg, 0,xM) > R) break; if (xM >= L) printf ("WARNING xM is not < L\n"); /* First scan: x++, y-- */ @@ -134,11 +135,11 @@ k = 0; propag = 0; for (y = x; y >= 0; y--) { - if (CTg.at(y,x) > R) /* outside the ball : background */ + if (opt::at(CTg, y,x) > R) /* outside the ball : background */ propag = 1; else if (propag) /* inside the ball, mark to dist. k*k from bg */ - { k++; DTg.at(y,x) = k*k; } - else DTg.at(y,x) = -1; /* inside the ball, no distance propagated */ + { k++; opt::at(DTg, y,x) = k*k; } + else opt::at(DTg, y,x) = -1; /* inside the ball, no distance propagated */ } } @@ -150,11 +151,11 @@ /* Compute stacks indices Si[Sn]=x and values Sv[Sn]=DTg[x,y] */ for (x = y; x <= xM; x++) { - dp = DTg.at(y,x); + dp = opt::at(DTg, y,x); if (dp < 0) continue; /* Non propagated value */ /* To speedup algorithm, stop at the second consecutive 0 */ - if (dp == 0 && x > y && DTg.at(y,x-1)==0) break; + if (dp == 0 && x > y && opt::at(DTg, y,x-1)==0) break; while (Sn >= 2 && D_Intersec (Si[Sn-1], Sv[Sn-1], x, dp) < Sr[Sn-1]) Sn--; /* pop */ @@ -170,11 +171,11 @@ /* Compute new DTg values using stacks */ for (x = xM; x >= y; x--) { - if (DTg.at(y,x)==0) continue; + if (opt::at(DTg, y,x)==0) continue; while (Sn >= 2 && x < Sr[Sn-1]) Sn--; /* pop */ - DTg.at(y,x) = (x-Si[Sn-1])*(x-Si[Sn-1]) + Sv[Sn-1]; + opt::at(DTg, y,x) = (x-Si[Sn-1])*(x-Si[Sn-1]) + Sv[Sn-1]; } } @@ -183,7 +184,7 @@ { for( int j=0; j<L; j++) { - dt.at(i,j) = DTg.at(i,j); + dt.at(i,j) = opt::at(DTg, i,j); } } return dt; @@ -197,7 +198,7 @@ { for(int j=0; j <= i; j++) { - CTg.at(j,i) = i*i + j*j; + opt::at(CTg, j,i) = i*i + j*j; } } @@ -230,9 +231,9 @@ for (y = 0; y <= x; y++) { - r1 = CTg.at(y,x) +1; + r1 = opt::at(CTg, y,x) +1; - r2 = CTg.at(y+Mlut[ind][1], x+Mlut[ind][0]) +1; + r2 = opt::at(CTg, y+Mlut[ind][1], x+Mlut[ind][0]) +1; if (r1 <= Rmax && r2 > Lut[ind][r1]) Lut[ind][r1] = r2; } @@ -252,7 +253,7 @@ { int xx, yy, val; - val = DTg.at(y, x); + val = opt::at(DTg, y, x); for (uint i = 0; i < Mlut.size(); i++) { @@ -261,7 +262,7 @@ if (0 <= yy && yy <= xx) { - if ( DTg.at(yy, xx) >= Lut[i][val] ) + if ( opt::at(DTg, yy, xx) >= Lut[i][val] ) return false; } } @@ -288,7 +289,7 @@ { for(int y=0; y<=x; y++) { - if(DTg.at(y,x) > 0 && isMAg(x, y, Mgl, DTg, Lut)) + if(opt::at(DTg, y,x) > 0 && isMAg(x, y, Mgl, DTg, Lut)) { std::vector<int> tmp(3); tmp[0] = x; @@ -314,7 +315,7 @@ { int Vx, Vy, val, h, w; - val = DTg.at(y, x); + val = opt::at(DTg, y, x); h = geom::nrows(DTg); w = geom::ncols(DTg); @@ -325,42 +326,42 @@ if((0 <= y-Vy) && (0 <= x-Vx)) { - if ( DTg.at(y-Vy, x-Vx) >= Lut[i][val] ) + if ( opt::at(DTg, y-Vy, x-Vx) >= Lut[i][val] ) return false; } if((y+Vy < h) && (x+Vx < w)) { - if ( DTg.at(y+Vy, x+Vx) >= Lut[i][val] ) + if ( opt::at(DTg, y+Vy, x+Vx) >= Lut[i][val] ) return false; } if((0 <= y-Vy) && (x+Vx < w)) { - if ( DTg.at(y-Vy, x+Vx) >= Lut[i][val] ) + if ( opt::at(DTg, y-Vy, x+Vx) >= Lut[i][val] ) return false; } if((y+Vy < h) && (0 <= x-Vx)) { - if ( DTg.at(y+Vy, x-Vx) >= Lut[i][val] ) + if ( opt::at(DTg, y+Vy, x-Vx) >= Lut[i][val] ) return false; } if((0 <= x-Vy) && (0 <= y-Vx)) { - if ( DTg.at(y-Vx, x-Vy) >= Lut[i][val] ) + if ( opt::at(DTg, y-Vx, x-Vy) >= Lut[i][val] ) return false; } if((x+Vy < w) && (y+Vx < h)) { - if ( DTg.at(y+Vx, x+Vy) >= Lut[i][val] ) + if ( opt::at(DTg, y+Vx, x+Vy) >= Lut[i][val] ) return false; } if((0 <= x-Vy) && (y+Vx < h)) { - if ( DTg.at(y+Vx, x-Vy) >= Lut[i][val] ) + if ( opt::at(DTg, y+Vx, x-Vy) >= Lut[i][val] ) return false; } if((x+Vy < w) && (0 <= y-Vx)) { - if ( DTg.at(y-Vx, x+Vy) >= Lut[i][val] ) + if ( opt::at(DTg, y-Vx, x+Vy) >= Lut[i][val] ) return false; } @@ -378,11 +379,11 @@ { for(int j=0; j<h; j++) { - if(pic.at(j,i)) + if(opt::at(pic, j,i)) { if(!isMA(i, j, Mgl, dt, Lut)) { - pic.at(j,i) = false; + opt::at(pic, j,i) = false; } } } Index: sandbox/jardonnet/n_cmpt/fused_filter.cc --- sandbox/jardonnet/n_cmpt/fused_filter.cc (revision 3062) +++ sandbox/jardonnet/n_cmpt/fused_filter.cc (working copy) @@ -21,6 +21,8 @@ #include <mln/pw/all.hh> #include <mln/core/image/image_if.hh> +#include <mln/opt/at.hh> + namespace mln { @@ -31,10 +33,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (mln::opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << mln::opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: sandbox/jardonnet/n_cmpt/ref_filter.cc --- sandbox/jardonnet/n_cmpt/ref_filter.cc (revision 3062) +++ sandbox/jardonnet/n_cmpt/ref_filter.cc (working copy) @@ -16,6 +16,8 @@ #include <mln/morpho/closing_area.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> + namespace mln { @@ -27,10 +29,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: sandbox/garrigues/ocr/skeleton.old.hh --- sandbox/garrigues/ocr/skeleton.old.hh (revision 3062) +++ sandbox/garrigues/ocr/skeleton.old.hh (working copy) @@ -33,6 +33,7 @@ #include <mln/core/site_set/p_set.hh> #include <mln/math/sqrt.hh> +#include <mln/opt/at.hh> namespace mln { @@ -486,10 +487,10 @@ for(int i=0; i<w; i++) for(int j=0; j<h; j++) { - if(pic.at(j,i)) - out.at(j,i) = 1; + if(opt::at(pic, j,i)) + opt::at(out, j,i) = 1; else - out.at(j,i) = 0; + opt::at(out, j,i) = 0; } return out; } Index: sandbox/garrigues/ocr/enlarge.hh --- sandbox/garrigues/ocr/enlarge.hh (revision 3062) +++ sandbox/garrigues/ocr/enlarge.hh (working copy) @@ -9,6 +9,7 @@ # include <mln/pw/image.hh> # include <mln/pw/cst.hh> # include <mln/pw/value.hh> +# include <mln/opt/at.hh> # include <mln/core/routine/clone.hh> @@ -38,29 +39,29 @@ // row 0 - output.at(0, 0) = do_threshold(input.at(0, 0)); + opt::at(output, 0, 0) = do_threshold(opt::at(input, 0, 0)); for (int col = 2; col < output.ncols(); col += 2) { - value = val(input.at(0, col / 2)); - value += val(input.at(0, col / 2 - 1)); - output.at(0, col) = do_threshold(value / 2); + value = val(opt::at(input, 0, col / 2)); + value += val(opt::at(input, 0, col / 2 - 1)); + opt::at(output, 0, col) = do_threshold(value / 2); } for (int col = 1; col < output.ncols(); col += 2) - output.at(0, col) = do_threshold(input.at(0, col / 2)); + opt::at(output, 0, col) = do_threshold(opt::at(input, 0, col / 2)); // col 0 for (int row = 2; row < output.nrows(); row += 2) { - value = val(input.at(row / 2, 0)); - value += val(input.at(row / 2 - 1, 0)); - output.at(row, 0) = do_threshold(value / 2); + value = val(opt::at(input, row / 2, 0)); + value += val(opt::at(input, row / 2 - 1, 0)); + opt::at(output, row, 0) = do_threshold(value / 2); } for (int row = 1; row < output.nrows(); row += 2) - output.at(row, 0) = do_threshold(input.at(row / 2, 0)); + opt::at(output, row, 0) = do_threshold(opt::at(input, row / 2, 0)); // others @@ -68,17 +69,17 @@ { for (int col = 2; col < output.ncols(); col += 2) { - value = val(input.at(row / 2, col / 2)); - value += val(input.at(row / 2 - 1, col / 2)); - value += val(input.at(row / 2, col / 2 - 1)); - value += val(input.at(row / 2 - 1, col / 2 - 1)); - output.at(row, col) = do_threshold(value / 4); + value = val(opt::at(input, row / 2, col / 2)); + value += val(opt::at(input, row / 2 - 1, col / 2)); + value += val(opt::at(input, row / 2, col / 2 - 1)); + value += val(opt::at(input, row / 2 - 1, col / 2 - 1)); + opt::at(output, row, col) = do_threshold(value / 4); } for (int col = 1; col < output.ncols(); col += 2) { - value = val(input.at(row / 2, col / 2)); - value += val(input.at(row / 2 - 1, col / 2)); - output.at(row, col) = do_threshold(value / 2); + value = val(opt::at(input, row / 2, col / 2)); + value += val(opt::at(input, row / 2 - 1, col / 2)); + opt::at(output, row, col) = do_threshold(value / 2); } } @@ -86,12 +87,12 @@ { for (int col = 2; col < output.ncols(); col += 2) { - value = val(input.at(row / 2, col / 2)); - value += val(input.at(row / 2, col / 2 - 1)); - output.at(row, col) = do_threshold(value / 2); + value = val(opt::at(input, row / 2, col / 2)); + value += val(opt::at(input, row / 2, col / 2 - 1)); + opt::at(output, row, col) = do_threshold(value / 2); } for (int col = 1; col < output.ncols(); col += 2) - output.at(row, col) = do_threshold(input.at(row / 2, col / 2)); + opt::at(output, row, col) = do_threshold(opt::at(input, row / 2, col / 2)); } return output; @@ -114,29 +115,29 @@ // row 0 - output.at(0, 0) = (input.at(0, 0)); + opt::at(output, 0, 0) = (opt::at(input, 0, 0)); for (int col = 2; col < output.ncols(); col += 2) { - value = (input.at(0, col / 2)); - value += (input.at(0, col / 2 - 1)); - output.at(0, col) = (value / 2); + value = (opt::at(input, 0, col / 2)); + value += (opt::at(input, 0, col / 2 - 1)); + opt::at(output, 0, col) = (value / 2); } for (int col = 1; col < output.ncols(); col += 2) - output.at(0, col) = (input.at(0, col / 2)); + opt::at(output, 0, col) = (opt::at(input, 0, col / 2)); // col 0 for (int row = 2; row < output.nrows(); row += 2) { - value = (input.at(row / 2, 0)); - value += (input.at(row / 2 - 1, 0)); - output.at(row, 0) = (value / 2); + value = (opt::at(input, row / 2, 0)); + value += (opt::at(input, row / 2 - 1, 0)); + opt::at(output, row, 0) = (value / 2); } for (int row = 1; row < output.nrows(); row += 2) - output.at(row, 0) = (input.at(row / 2, 0)); + opt::at(output, row, 0) = (opt::at(input, row / 2, 0)); // others @@ -144,17 +145,17 @@ { for (int col = 2; col < output.ncols(); col += 2) { - value = (input.at(row / 2, col / 2)); - value += (input.at(row / 2 - 1, col / 2)); - value += (input.at(row / 2, col / 2 - 1)); - value += (input.at(row / 2 - 1, col / 2 - 1)); - output.at(row, col) = ((unsigned(value)+2) / 4); + value = (opt::at(input, row / 2, col / 2)); + value += (opt::at(input, row / 2 - 1, col / 2)); + value += (opt::at(input, row / 2, col / 2 - 1)); + value += (opt::at(input, row / 2 - 1, col / 2 - 1)); + opt::at(output, row, col) = ((unsigned(value)+2) / 4); } for (int col = 1; col < output.ncols(); col += 2) { - value = (input.at(row / 2, col / 2)); - value += (input.at(row / 2 - 1, col / 2)); - output.at(row, col) = (value / 2); + value = (opt::at(input, row / 2, col / 2)); + value += (opt::at(input, row / 2 - 1, col / 2)); + opt::at(output, row, col) = (value / 2); } } @@ -162,12 +163,12 @@ { for (int col = 2; col < output.ncols(); col += 2) { - value = (input.at(row / 2, col / 2)); - value += (input.at(row / 2, col / 2 - 1)); - output.at(row, col) = (value / 2); + value = (opt::at(input, row / 2, col / 2)); + value += (opt::at(input, row / 2, col / 2 - 1)); + opt::at(output, row, col) = (value / 2); } for (int col = 1; col < output.ncols(); col += 2) - output.at(row, col) = (input.at(row / 2, col / 2)); + opt::at(output, row, col) = (opt::at(input, row / 2, col / 2)); } return output; Index: sandbox/abraham/tests/transform/fft_.cc --- sandbox/abraham/tests/transform/fft_.cc (revision 3062) +++ sandbox/abraham/tests/transform/fft_.cc (working copy) @@ -30,6 +30,7 @@ #include <mln/value/int_u8.hh> #include <mln/io/pgm/load.hh> #include <mln/io/pgm/save.hh> +#include <mln/opt/at.hh> #include <mln/debug/println.hh> #define CHECK(Condition) \ @@ -77,11 +78,11 @@ for (int row = 40; row < im2.nrows() - 40; ++row) for (int col = 0; col < im2.ncols(); ++col) - im2.at(row, col) = 0; + opt::at(im2, row, col) = 0; for (int row = 0; row < im2.nrows(); ++row) for (int col = 40; col < im2.ncols() - 40; ++col) - im2.at(row, col) = 0; + opt::at(im2, row, col) = 0; out = fourier.transform_inv<int_u8>(); Index: sandbox/abraham/mln/transform/fft.hh --- sandbox/abraham/mln/transform/fft.hh (revision 3062) +++ sandbox/abraham/mln/transform/fft.hh (working copy) @@ -30,6 +30,7 @@ # include <mln/core/image/image2d.hh> # include <mln/estim/min_max.hh> +# include <mln/opt/at.hh> # include <complex> @@ -116,8 +117,8 @@ if (ordered) for (unsigned row = 0; row < new_im.nrows(); ++row) for (unsigned col = 0; col < new_im.ncols(); ++col) - new_im.at(row, col) = - std::norm(trans_im.at((row + trans_im.nrows() / 2) % trans_im.nrows(), + opt::at(new_im, row, col) = + std::norm(opt::at(trans_im, (row + trans_im.nrows() / 2) % trans_im.nrows(), (col + trans_im.ncols() / 2) % trans_im.ncols())); else { @@ -174,14 +175,14 @@ for (unsigned row = 0; row < new_im.nrows(); ++row) for (unsigned col = 0; col < new_im.ncols(); ++col) { - if (std::norm(trans_im.at((row + trans_im.nrows() / 2) % trans_im.nrows(), + if (std::norm(opt::at(trans_im, (row + trans_im.nrows() / 2) % trans_im.nrows(), (col + trans_im.ncols() / 2) % trans_im.ncols())) >= max * clip) - new_im.at(row, col) = mln_max(R); + opt::at(new_im, row, col) = mln_max(R); else - new_im.at(row, col) = + opt::at(new_im, row, col) = (double) mln_max(R) * - std::norm(trans_im.at((row + trans_im.nrows() / 2) % trans_im.nrows(), + std::norm(opt::at(trans_im, (row + trans_im.nrows() / 2) % trans_im.nrows(), (col + trans_im.ncols() / 2) % trans_im.ncols())) / (max * clip); } @@ -282,8 +283,8 @@ if (ordered) for (unsigned row = 0; row < new_im.nrows(); ++row) for (unsigned col = 0; col < new_im.ncols(); ++col) - new_im.at(row, col) = - log(a + b * std::norm(trans_im.at((row + trans_im.nrows() / 2) % trans_im.nrows(), + opt::at(new_im, row, col) = + log(a + b * std::norm(opt::at(trans_im, (row + trans_im.nrows() / 2) % trans_im.nrows(), (col + trans_im.ncols() / 2) % trans_im.ncols()))) / log (a + b * max) * mln_max(R); else @@ -413,7 +414,7 @@ for (unsigned row = 0; row < original_im.nrows(); ++row) for (unsigned col = 0; col < original_im.ncols(); ++col) - this->in[row * original_im.ncols() + col] = original_im.at(row, col); + this->in[row * original_im.ncols() + col] = opt::at(original_im, row, col); this->p = fftw_plan_dft_r2c_2d (original_im.nrows(), original_im.ncols(), this->in, reinterpret_cast<fftw_complex*>(this->out), FFTW_ESTIMATE); @@ -436,12 +437,12 @@ for (unsigned col = 0; col <= this->trans_im.ncols() / 2; ++col) { this->out[i] = std::complex<T> (this->out[i].real() / denom, this->out[i].imag() / denom); - this->trans_im.at(row, col) = this->out[i]; + opt::at(this->trans_im, row, col) = this->out[i]; ++i; } for (unsigned row = 0; row < this->trans_im.nrows(); ++row) for (unsigned col = this->trans_im.ncols() - 1; col > this->trans_im.ncols() / 2; --col) - this->trans_im.at(row, col) = this->trans_im.at(this->trans_im.nrows() - row - 1, + this->trans_im.at(row, col) = opt::at(this->trans_im, this->trans_im.nrows() - row - 1, this->trans_im.ncols() - col - 1); return this->trans_im; } @@ -459,7 +460,7 @@ for (unsigned row = 0; row < this->trans_im.nrows(); ++row) for (unsigned col = 0; col <= this->trans_im.ncols() / 2; ++col) this->out[row * (this->trans_im.ncols() / 2 + 1) + col] = - this->trans_im.at(row, col).real(); + opt::at(this->trans_im, row, col).real(); fftw_execute(this->p_inv); @@ -468,7 +469,7 @@ for (unsigned row = 0; row < this->trans_im.nrows(); ++row) for (unsigned col = 0; col < this->trans_im.ncols(); ++col) { - new_im.at(row, col) = (this->in[i] >= mln_min(R) ? + opt::at(new_im, row, col) = (this->in[i] >= mln_min(R) ? (this->in[i] <= mln_max(R) ? (R)this->in [i] : mln_min(R)) : Index: sandbox/inim/classif/src/proj.hh --- sandbox/inim/classif/src/proj.hh (revision 3062) +++ sandbox/inim/classif/src/proj.hh (working copy) @@ -35,7 +35,8 @@ #include <mln/accu/maj_h.hh> #include <mln/literal/white.hh> #include <mln/literal/colors.hh> -#include <mln/make/vec.hh> +#include <mln/make/vec.hh +#include <mln/opt/at.hh> namespace mln { @@ -48,7 +49,7 @@ mln_piter(image3d<T>) p(input.domain()); for_all(p) // 3d if (input(p) != literal::zero) - acc.at(p.sli(), p.row()).take(input(p)); + opt::at(acc, p.sli(), p.row()).take(input(p)); image2d<mln_result(A)> output(acc.domain()); level::paste(acc, output); @@ -91,7 +92,7 @@ mln_piter(image3d<T>) p(input.domain()); for_all(p) // 3d if (histo(p) != literal::zero) - acc.at(p.sli(), p.row()).take(input(p)); + opt::at(acc, p.sli(), p.row()).take(input(p)); image2d<mln_result(A)> output(acc.domain()); level::paste(acc, output); Index: sandbox/inim/binarization/proof-of-concept/src/gradient.cc --- sandbox/inim/binarization/proof-of-concept/src/gradient.cc (revision 3062) +++ sandbox/inim/binarization/proof-of-concept/src/gradient.cc (working copy) @@ -25,6 +25,7 @@ #include <mln/morpho/closing_area.hh> #include <mln/morpho/gradient.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> // DEBUG #include <mln/debug/all.hh> @@ -81,7 +82,7 @@ level::fill(hist, 0); image2d<value::int_u8>::fwd_piter p (in.domain ()); for_all (p) - hist.at(in(p)) += (unsigned) strength_of<2> (grad (p)); + opt::at(hist, in(p)) += (unsigned) strength_of<2> (grad (p)); // Histo print_histo (hist, file_hist + "_1.histo"); Index: sandbox/inim/binarization/binarization.hh --- sandbox/inim/binarization/binarization.hh (revision 3062) +++ sandbox/inim/binarization/binarization.hh (working copy) @@ -7,6 +7,7 @@ #include <mln/morpho/meyer_wst.hh> #include <mln/border/resize.hh> #include <mln/accu/maj_h.hh> +#include <mln/opt/at.hh> #include "snake2d.hh" namespace mln @@ -41,10 +42,10 @@ initialize(cla, input); typename I::fwd_piter q (input.domain()); for_all (q) - if (wst.at(input(q)) == 0) - cla(q) = wst.at(input(q) + 1); + if (opt::at(wst, input(q)) == 0) + cla(q) = opt::at(wst, input(q) + 1); else - cla(q) = wst.at(input(q)); + cla(q) = opt::at(wst, input(q)); border::resize(cla, 0); I maj = snake2d(accu::meta::maj_h(), cla, win); typename I::fwd_piter r (cla.domain()); Index: sandbox/nature/nature.cc --- sandbox/nature/nature.cc (revision 3062) +++ sandbox/nature/nature.cc (working copy) @@ -61,6 +61,8 @@ #include <mln/transform/fft.hh> +#include <mln/opt/at.hh> + #include "co_occurence.hh" #include <math.h> @@ -174,14 +176,14 @@ // If there is a plain background, there will be a massive peak in the diagonal of the matrix unsigned max = 0; for (unsigned i = 0; i < mco.nrows(); i++) - if (mco.at(i, i) > max) - max = mco.at(i, i); + if (opt::at(mco, i, i) > max) + max = opt::at(mco, i, i); for (unsigned i = 0; i < mco.nrows() - 1; i++) { - if (mco.at(i + 1, i) > max) - max = mco.at(i + 1, i); - if (mco.at(i, i + 1) > max) - max = mco.at(i, i + 1); + if (opt::at(mco, i + 1, i) > max) + max = opt::at(mco, i + 1, i); + if (opt::at(mco, i, i + 1) > max) + max = opt::at(mco, i, i + 1); } max = max * 100 / input.nelements(); Index: sandbox/nature/co_occurence.hh --- sandbox/nature/co_occurence.hh (revision 3062) +++ sandbox/nature/co_occurence.hh (working copy) @@ -37,6 +37,7 @@ # include <mln/core/dpoint.hh> # include <mln/core/image/image2d.hh> # include <mln/level/fill.hh> +# include <mln/opt/at.hh> namespace mln @@ -64,7 +65,7 @@ mln_piter(I) p(ima.domain()); for_all(p) if (ima.domain().has(p + dp)) - mco.at(ima(p), ima(p + dp))++; + opt::at(mco, ima(p), ima(p + dp))++; return mco; } Index: sandbox/nature/proj.hh --- sandbox/nature/proj.hh (revision 3062) +++ sandbox/nature/proj.hh (working copy) @@ -35,6 +35,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/image/image1d.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> namespace mln { @@ -47,7 +48,7 @@ mln_piter(image2d<T>) p(input.domain()); for_all(p) // 2d - out.at(p.row()) += input(p); + opt::at(out, p.row()) += input(p); mln_piter(image1d<T>) p2(out.domain()); unsigned count = geom::ncols(input); Index: sandbox/ballas/color/min_tree_volume_filter.cc --- sandbox/ballas/color/min_tree_volume_filter.cc (revision 3062) +++ sandbox/ballas/color/min_tree_volume_filter.cc (working copy) @@ -33,6 +33,7 @@ # include <mln/extension/fill.hh> # include <mln/morpho/closing_area.hh> +# include <mln/opt/at.hh> # include <mln/debug/println.hh> @@ -297,14 +298,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -326,7 +327,7 @@ unsigned col = (q.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) for (unsigned j = 0; j < zoom; ++j) - output.at(row + i, col + j) = ima(q); + opt::at(output, row + i, col + j) = ima(q); } mln_VAR( edge, ima | is_edge ); @@ -337,14 +338,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -386,7 +387,7 @@ 2 * input.ncols() - 1); for (unsigned row = 0; row < input.nrows(); ++row) for (unsigned col = 0; col < input.ncols(); ++col) - output.at(2 * row, 2 * col) = input.at(row, col); + output.at(2 * row, 2 * col) = mln::opt::at(input, row, col); return output; } @@ -399,7 +400,7 @@ (input.ncols() + 1) / 2); for (unsigned row = 0; row < input.nrows(); row += 2) for (unsigned col = 0; col < input.ncols(); col += 2) - output.at(row / 2, col / 2) = input.at(row, col); + output.at(row / 2, col / 2) = mln::opt::at(input, row, col); return output; } Index: sandbox/ballas/color/reference.cc --- sandbox/ballas/color/reference.cc (revision 3062) +++ sandbox/ballas/color/reference.cc (working copy) @@ -40,6 +40,7 @@ # include <mln/morpho/closing_volume.hh> # include <mln/make/w_window2d.hh> +# include <mln/opt/at.hh> # include <mln/debug/println.hh> @@ -163,13 +164,13 @@ const int ncols = ima.ncols(); for (int r = -1; r <= nrows; ++r) { - ima.at(r, -1) = v; - ima.at(r, ncols) = v; + opt::at(ima, r, -1) = v; + opt::at(ima, r, ncols) = v; } for (int c = -1; c <= ncols; ++c) { - ima.at(-1, c) = v; - ima.at(nrows, c) = v; + opt::at(ima, -1, c) = v; + opt::at(ima, nrows, c) = v; } } @@ -287,14 +288,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -315,7 +316,7 @@ unsigned col = (q.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) for (unsigned j = 0; j < zoom; ++j) - output.at(row + i, col + j) = ima(q); + opt::at(output, row + i, col + j) = ima(q); } mln_VAR( edge, ima | is_edge ); @@ -326,14 +327,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -350,7 +351,7 @@ 2 * input.ncols() - 1); for (int row = 0; row < input.nrows(); ++row) for (int col = 0; col < input.ncols(); ++col) - output.at(2 * row, 2 * col) = input.at(row, col); + output.at(2 * row, 2 * col) = mln::opt::at(input, row, col); return output; } @@ -416,7 +417,7 @@ (input.ncols() + 1) / 2); for (int row = 0; row < input.nrows(); row += 2) for (int col = 0; col < input.ncols(); col += 2) - output.at(row / 2, col / 2) = input.at(row, col); + output.at(row / 2, col / 2) = mln::opt::at(input, row, col); return output; } @@ -491,15 +492,15 @@ { if (is_row_odd(p)) { - mln_value(image2d<float>) t = ima.at(p.row() - 1, p.col()); - mln_value(image2d<float>) b = ima.at(p.row() + 1, p.col()); + mln_value(image2d<float>) t = opt::at(ima, p.row() - 1, p.col()); + mln_value(image2d<float>) b = opt::at(ima, p.row() + 1, p.col()); if ((t > 0 && b < 0) || (t < 0 && b > 0)) output(p) = value::rgb8(255,0,0); } else { - mln_value(image2d<float>) r = ima.at(p.row(), p.col() - 1); - mln_value(image2d<float>) d = ima.at(p.row(), p.col() + 1); + mln_value(image2d<float>) r = opt::at(ima, p.row(), p.col() - 1); + mln_value(image2d<float>) d = opt::at(ima, p.row(), p.col() + 1); if ((r > 0 && d < 0) || (r < 0 && d > 0)) output(p) = value::rgb8(255,0,0); } Index: sandbox/ballas/color/min_tree_area_filter.cc --- sandbox/ballas/color/min_tree_area_filter.cc (revision 3062) +++ sandbox/ballas/color/min_tree_area_filter.cc (working copy) @@ -36,6 +36,8 @@ # include <mln/morpho/meyer_wst.hh> # include <mln/morpho/closing_area.hh> +# include <mln/opt/at.hh> + # include <mln/debug/println.hh> # if 0 @@ -273,14 +275,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -301,7 +303,7 @@ unsigned col = (q.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) for (unsigned j = 0; j < zoom; ++j) - output.at(row + i, col + j) = ima(q); + opt::at(output, row + i, col + j) = ima(q); } mln_VAR( edge, ima | is_edge ); @@ -312,14 +314,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -362,7 +364,7 @@ 2 * input.ncols() - 1); for (unsigned row = 0; row < input.nrows(); ++row) for (unsigned col = 0; col < input.ncols(); ++col) - output.at(2 * row, 2 * col) = input.at(row, col); + output.at(2 * row, 2 * col) = mln::opt::at(input, row, col); return output; } @@ -375,7 +377,7 @@ (input.ncols() + 1) / 2); for (unsigned row = 0; row < input.nrows(); row += 2) for (unsigned col = 0; col < input.ncols(); col += 2) - output.at(row / 2, col / 2) = input.at(row, col); + output.at(row / 2, col / 2) = mln::opt::at(input, row, col); return output; } Index: sandbox/ballas/color/min_tree_height_filter.cc --- sandbox/ballas/color/min_tree_height_filter.cc (revision 3062) +++ sandbox/ballas/color/min_tree_height_filter.cc (working copy) @@ -31,6 +31,7 @@ # include <mln/level/fill.hh> # include <mln/level/transform.hh> # include <mln/extension/fill.hh> +# include <mln/opt/at.hh> # include <mln/morpho/closing_area.hh> @@ -297,14 +298,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -326,7 +327,7 @@ unsigned col = (q.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) for (unsigned j = 0; j < zoom; ++j) - output.at(row + i, col + j) = ima(q); + opt::at(output, row + i, col + j) = ima(q); } mln_VAR( edge, ima | is_edge ); @@ -337,14 +338,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -386,7 +387,7 @@ 2 * input.ncols() - 1); for (unsigned row = 0; row < input.nrows(); ++row) for (unsigned col = 0; col < input.ncols(); ++col) - output.at(2 * row, 2 * col) = input.at(row, col); + output.at(2 * row, 2 * col) = mln::opt::at(input, row, col); return output; } @@ -399,7 +400,7 @@ (input.ncols() + 1) / 2); for (unsigned row = 0; row < input.nrows(); row += 2) for (unsigned col = 0; col < input.ncols(); col += 2) - output.at(row / 2, col / 2) = input.at(row, col); + output.at(row / 2, col / 2) = mln::opt::at(input, row, col); return output; } Index: sandbox/ballas/color/min_tree_color.cc --- sandbox/ballas/color/min_tree_color.cc (revision 3062) +++ sandbox/ballas/color/min_tree_color.cc (working copy) @@ -34,6 +34,7 @@ # include <mln/extension/fill.hh> # include <mln/morpho/closing_area.hh> +# include <mln/opt/at.hh> # include <mln/debug/println.hh> @@ -292,14 +293,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -320,7 +321,7 @@ unsigned col = (q.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) for (unsigned j = 0; j < zoom; ++j) - output.at(row + i, col + j) = ima(q); + opt::at(output, row + i, col + j) = ima(q); } mln_VAR( edge, ima | is_edge ); @@ -331,14 +332,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -380,7 +381,7 @@ 2 * input.ncols() - 1); for (unsigned row = 0; row < input.nrows(); ++row) for (unsigned col = 0; col < input.ncols(); ++col) - output.at(2 * row, 2 * col) = input.at(row, col); + output.at(2 * row, 2 * col) = mln::opt::at(input, row, col); return output; } @@ -393,7 +394,7 @@ (input.ncols() + 1) / 2); for (unsigned row = 0; row < input.nrows(); row += 2) for (unsigned col = 0; col < input.ncols(); col += 2) - output.at(row / 2, col / 2) = input.at(row, col); + output.at(row / 2, col / 2) = mln::opt::at(input, row, col); return output; } Index: sandbox/ballas/color/reference2.cc --- sandbox/ballas/color/reference2.cc (revision 3062) +++ sandbox/ballas/color/reference2.cc (working copy) @@ -39,6 +39,8 @@ # include <mln/linear/convolve.hh> # include <mln/make/w_window2d.hh> +# include <mln/opt/at.hh> + # include <mln/debug/println.hh> namespace mln @@ -145,13 +147,13 @@ const int ncols = ima.ncols(); for (int r = -1; r <= nrows; ++r) { - ima.at(r, -1) = v; - ima.at(r, ncols) = v; + opt::at(ima, r, -1) = v; + opt::at(ima, r, ncols) = v; } for (int c = -1; c <= ncols; ++c) { - ima.at(-1, c) = v; - ima.at(nrows, c) = v; + opt::at(ima, -1, c) = v; + opt::at(ima, nrows, c) = v; } } @@ -269,14 +271,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -293,7 +295,7 @@ 2 * input.ncols() - 1); for (int row = 0; row < input.nrows(); ++row) for (int col = 0; col < input.ncols(); ++col) - output.at(2 * row, 2 * col) = input.at(row, col); + output.at(2 * row, 2 * col) = mln::opt::at(input, row, col); return output; } @@ -306,7 +308,7 @@ (input.ncols() + 1) / 2); for (int row = 0; row < input.nrows(); row += 2) for (int col = 0; col < input.ncols(); col += 2) - output.at(row / 2, col / 2) = input.at(row, col); + output.at(row / 2, col / 2) = mln::opt::at(input, row, col); return output; } Index: sandbox/ballas/color/min_tree_color_v2.cc --- sandbox/ballas/color/min_tree_color_v2.cc (revision 3062) +++ sandbox/ballas/color/min_tree_color_v2.cc (working copy) @@ -33,6 +33,7 @@ # include <mln/extension/fill.hh> # include <mln/morpho/closing_area.hh> +# include <mln/opt/at.hh> # include <mln/debug/println.hh> @@ -281,14 +282,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -309,7 +310,7 @@ unsigned col = (q.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) for (unsigned j = 0; j < zoom; ++j) - output.at(row + i, col + j) = ima(q); + opt::at(output, row + i, col + j) = ima(q); } mln_VAR( edge, ima | is_edge ); @@ -320,14 +321,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -369,7 +370,7 @@ 2 * input.ncols() - 1); for (unsigned row = 0; row < input.nrows(); ++row) for (unsigned col = 0; col < input.ncols(); ++col) - output.at(2 * row, 2 * col) = input.at(row, col); + output.at(2 * row, 2 * col) = mln::opt::at(input, row, col); return output; } @@ -382,7 +383,7 @@ (input.ncols() + 1) / 2); for (unsigned row = 0; row < input.nrows(); row += 2) for (unsigned col = 0; col < input.ncols(); col += 2) - output.at(row / 2, col / 2) = input.at(row, col); + output.at(row / 2, col / 2) = mln::opt::at(input, row, col); return output; } Index: sandbox/ballas/color/laplacien.cc --- sandbox/ballas/color/laplacien.cc (revision 3062) +++ sandbox/ballas/color/laplacien.cc (working copy) @@ -13,6 +13,7 @@ #include <mln/core/var.hh> #include <mln/debug/println.hh> +#include <mln/opt/at.hh> #include "src/io.hh" #include "src/graph.hh" @@ -92,7 +93,7 @@ // if (laplacian(p) == 0u) // { // std::cout << "I'm here" << std::endl; -// graph.at(p.row() * 2, p.col() * 2) = value::rgb<8>(255, 0, 0); +// opt::at(graph, p.row() * 2, p.col() * 2) = value::rgb<8>(255, 0, 0); // } } Index: sandbox/geraud/wst_edge.cc --- sandbox/geraud/wst_edge.cc (revision 3062) +++ sandbox/geraud/wst_edge.cc (working copy) @@ -35,6 +35,8 @@ # include <mln/morpho/meyer_wst.hh> # include <mln/morpho/closing_volume.hh> +# include <mln/opt/at.hh> + # include <mln/debug/println.hh> @@ -88,13 +90,13 @@ const int ncols = ima.ncols(); for (int r = -1; r <= nrows; ++r) { - ima.at(r, -1) = v; - ima.at(r, ncols) = v; + opt::at(ima, r, -1) = v; + opt::at(ima, r, ncols) = v; } for (int c = -1; c <= ncols; ++c) { - ima.at(-1, c) = v; - ima.at(nrows, c) = v; + opt::at(ima, -1, c) = v; + opt::at(ima, nrows, c) = v; } } @@ -216,14 +218,14 @@ unsigned row = (p.row() / 2 + 1) * (zoom + 1) - 1; unsigned col = (p.col() / 2) * (zoom + 1); for (unsigned i = 0; i < zoom; ++i) - output.at(row, col + i) = ima(p); + opt::at(output, row, col + i) = ima(p); } else // vertical edge { unsigned row = (p.row() / 2) * (zoom + 1); unsigned col = (p.col() / 2 + 1) * (zoom + 1) - 1; for (unsigned i = 0; i < zoom; ++i) - output.at(row + i, col) = ima(p); + opt::at(output, row + i, col) = ima(p); } return output; } @@ -240,7 +242,7 @@ 2 * input.ncols() - 1); for (int row = 0; row < input.nrows(); ++row) for (int col = 0; col < input.ncols(); ++col) - output.at(2 * row, 2 * col) = input.at(row, col); + output.at(2 * row, 2 * col) = mln::opt::at(input, row, col); return output; } @@ -253,7 +255,7 @@ (input.ncols() + 1) / 2); for (int row = 0; row < input.nrows(); row += 2) for (int col = 0; col < input.ncols(); col += 2) - output.at(row / 2, col / 2) = input.at(row, col); + output.at(row / 2, col / 2) = mln::opt::at(input, row, col); return output; } Index: sandbox/geraud/fllt.svg.6.cc --- sandbox/geraud/fllt.svg.6.cc (revision 3062) +++ sandbox/geraud/fllt.svg.6.cc (working copy) @@ -60,6 +60,8 @@ #include <mln/util/branch_iter_ind.hh> #include <mln/util/branch_iter.hh> +#include <mln/opt/at.hh> + #include <sstream> @@ -177,7 +179,7 @@ image2d<T> output(nrows_, ncols_); for (int row = 0; row < nrows_; ++row) for (int col = 0; col < ncols_; ++col) - output.at(row, col) = input.at(row / coef, col / coef); + output.at(row, col) = mln::opt::at(input, row / coef, col / coef); return output; } Index: sandbox/geraud/browsing/fwd.cc --- sandbox/geraud/browsing/fwd.cc (revision 3062) +++ sandbox/geraud/browsing/fwd.cc (working copy) @@ -3,6 +3,7 @@ # include <mln/value/int_u8.hh> # include <mln/accu/min_h.hh> # include <mln/accu/max_h.hh> +# include <mln/opt/at.hh> # include <mln/debug/println.hh> # include <mln/debug/iota.hh> @@ -104,10 +105,10 @@ // << std::endl; // for (unsigned c = 0; c <= half; ++c) - // std::cout << " take " << ima.at(row, c) << " "; + // std::cout << " take " << opt::at(ima, row, c) << " "; // std::cout << std::endl; - // std::cout << " --> OK at " << ima.at(row, col) << std::endl; + // std::cout << " --> OK at " << opt::at(ima, row, col) << std::endl; // // ok (row, col) at line start @@ -122,8 +123,8 @@ // { // ++col; // ++col_plus; - // std::cout << " take " << ima.at(row, col_plus) << " "; - // std::cout << " --> OK at " << ima.at(row, col) << std::endl; + // std::cout << " take " << opt::at(ima, row, col_plus) << " "; + // std::cout << " --> OK at " << opt::at(ima, row, col) << std::endl; // } // std::cout << std::endl @@ -138,9 +139,9 @@ // ++col; // ++col_plus; // ++col_minus; - // std::cout << " take " << ima.at(row, col_plus) << " "; - // std::cout << " untake " << ima.at(row, col_minus) << " "; - // std::cout << " --> OK at " << ima.at(row, col) << std::endl; + // std::cout << " take " << opt::at(ima, row, col_plus) << " "; + // std::cout << " untake " << opt::at(ima, row, col_minus) << " "; + // std::cout << " --> OK at " << opt::at(ima, row, col) << std::endl; // // ok (row, col) at line middle // } // std::cout << std::endl; @@ -155,8 +156,8 @@ // { // ++col; // ++col_minus; - // std::cout << " untake " << ima.at(row, col_minus) << " "; - // std::cout << " --> OK at " << ima.at(row, col) << std::endl; + // std::cout << " untake " << opt::at(ima, row, col_minus) << " "; + // std::cout << " --> OK at " << opt::at(ima, row, col) << std::endl; // } // std::cout << std::endl; @@ -185,10 +186,10 @@ unsigned col = col_start; for (unsigned c = 0; c <= half && c < len; ++c) - std::cout << " take " << ima.at(row, col + c) << " "; + std::cout << " take " << opt::at(ima, row, col + c) << " "; std::cout << std::endl; - std::cout << " --> OK at " << ima.at(row, col) << std::endl; + std::cout << " --> OK at " << opt::at(ima, row, col) << std::endl; // ok (row, col) at line start if (col == col_last) @@ -206,8 +207,8 @@ ++col; ++col_plus; if (col_plus <= col_last) - std::cout << " take " << ima.at(row, col_plus) << " "; - std::cout << " --> OK at " << ima.at(row, col) << std::endl; + std::cout << " take " << opt::at(ima, row, col_plus) << " "; + std::cout << " --> OK at " << opt::at(ima, row, col) << std::endl; } if (col == col_last) @@ -227,10 +228,10 @@ ++col_plus; ++col_minus; mln_invariant(col_plus >= col_start && col_plus <= col_last); - std::cout << " take " << ima.at(row, col_plus) << " "; + std::cout << " take " << opt::at(ima, row, col_plus) << " "; mln_invariant(col_minus >= col_start && col_minus <= col_last); - std::cout << " untake " << ima.at(row, col_minus) << " "; - std::cout << " --> OK at " << ima.at(row, col) << std::endl; + std::cout << " untake " << opt::at(ima, row, col_minus) << " "; + std::cout << " --> OK at " << opt::at(ima, row, col) << std::endl; // ok (row, col) at line middle } std::cout << std::endl; @@ -248,8 +249,8 @@ ++col; ++col_minus; mln_invariant(col_minus >= col_start && col_minus <= col_last); - std::cout << " untake " << ima.at(row, col_minus) << " "; - std::cout << " --> OK at " << ima.at(row, col) << std::endl; + std::cout << " untake " << opt::at(ima, row, col_minus) << " "; + std::cout << " --> OK at " << opt::at(ima, row, col) << std::endl; } std::cout << std::endl; Index: sandbox/geraud/fllt/fllt.hh --- sandbox/geraud/fllt/fllt.hh (revision 3062) +++ sandbox/geraud/fllt/fllt.hh (working copy) @@ -36,6 +36,7 @@ #include <mln/core/image/sub_image.hh> #include <mln/core/site_set/p_queue_fast.hh> #include <mln/core/image/cast_image.hh> +#include <mln/opt/at.hh> #include <mln/value/int_u8.hh> #include <mln/value/rgb8.hh> @@ -186,7 +187,7 @@ image2d<T> output(nrows_, ncols_); for (int row = 0; row < nrows_; ++row) for (int col = 0; col < ncols_; ++col) - output.at(row, col) = input.at(row / coef, col / coef); + opt::at(output, row, col) = opt::at(input, row / coef, col / coef); return output; } Index: sandbox/geraud/fllt/fllt.svg.7.hh --- sandbox/geraud/fllt/fllt.svg.7.hh (revision 3062) +++ sandbox/geraud/fllt/fllt.svg.7.hh (working copy) @@ -40,6 +40,8 @@ #include <mln/core/site_set/p_queue_fast.hh> #include <mln/core/image/cast_image.hh> +#include <mln/opt/at.hh> + #include <mln/value/int_u8.hh> #include <mln/value/rgb8.hh> @@ -178,7 +180,7 @@ image2d<T> output(nrows_, ncols_); for (int row = 0; row < nrows_; ++row) for (int col = 0; col < ncols_; ++col) - output.at(row, col) = input.at(row / coef, col / coef); + opt::at(output, row, col) = opt::at(input, row / coef, col / coef); return output; } Index: sandbox/geraud/fllt/fllt.svg.2.cc --- sandbox/geraud/fllt/fllt.svg.2.cc (revision 3062) +++ sandbox/geraud/fllt/fllt.svg.2.cc (working copy) @@ -48,6 +48,8 @@ #include <mln/literal/white.hh> #include <mln/literal/colors.hh> +#include <mln/opt/at.hh> + #include <sstream> @@ -100,7 +102,7 @@ image2d<T> output(nrows_, ncols_); for (int row = 0; row < nrows_; ++row) for (int col = 0; col < ncols_; ++col) - output.at(row, col) = input.at(row / coef, col / coef); + output.at(row, col) = mln::opt::at(input, row / coef, col / coef); return output; } Index: sandbox/geraud/fllt/fllt.svg.3.cc --- sandbox/geraud/fllt/fllt.svg.3.cc (revision 3062) +++ sandbox/geraud/fllt/fllt.svg.3.cc (working copy) @@ -49,6 +49,8 @@ #include <mln/literal/white.hh> #include <mln/literal/colors.hh> +#include <mln/opt/at.hh> + #include <sstream> @@ -101,7 +103,7 @@ image2d<T> output(nrows_, ncols_); for (int row = 0; row < nrows_; ++row) for (int col = 0; col < ncols_; ++col) - output.at(row, col) = input.at(row / coef, col / coef); + output.at(row, col) = mln::opt::at(input, row / coef, col / coef); return output; } Index: sandbox/geraud/fllt/fllt.svg.4.cc --- sandbox/geraud/fllt/fllt.svg.4.cc (revision 3062) +++ sandbox/geraud/fllt/fllt.svg.4.cc (working copy) @@ -51,6 +51,8 @@ #include <mln/literal/white.hh> #include <mln/literal/colors.hh> +#include <mln/opt/at.hh> + #include <sstream> @@ -103,7 +105,7 @@ image2d<T> output(nrows_, ncols_); for (int row = 0; row < nrows_; ++row) for (int col = 0; col < ncols_; ++col) - output.at(row, col) = input.at(row / coef, col / coef); + output.at(row, col) = mln::opt::at(input, row / coef, col / coef); return output; } Index: sandbox/geraud/fllt/fllt.svg.5.cc --- sandbox/geraud/fllt/fllt.svg.5.cc (revision 3062) +++ sandbox/geraud/fllt/fllt.svg.5.cc (working copy) @@ -51,6 +51,8 @@ #include <mln/literal/white.hh> #include <mln/literal/colors.hh> +#include <mln/opt/at.hh> + #include <sstream> @@ -103,7 +105,7 @@ image2d<T> output(nrows_, ncols_); for (int row = 0; row < nrows_; ++row) for (int col = 0; col < ncols_; ++col) - output.at(row, col) = input.at(row / coef, col / coef); + output.at(row, col) = mln::opt::at(input, row / coef, col / coef); return output; } Index: sandbox/geraud/fllt/fllt_test.hh --- sandbox/geraud/fllt/fllt_test.hh (revision 3062) +++ sandbox/geraud/fllt/fllt_test.hh (working copy) @@ -36,6 +36,8 @@ #include <mln/core/site_set/p_queue_fast.hh> #include <mln/core/image/cast_image.hh> +#include <mln/opt/at.hh> + #include <mln/value/int_u8.hh> #include <mln/value/rgb8.hh> @@ -181,7 +183,7 @@ image2d<T> output(nrows_, ncols_); for (int row = 0; row < nrows_; ++row) for (int col = 0; col < ncols_; ++col) - output.at(row, col) = input.at(row / coef, col / coef); + opt::at(output, row, col) = opt::at(input, row / coef, col / coef); return output; } Index: sandbox/geraud/fllt.svg.7.hh --- sandbox/geraud/fllt.svg.7.hh (revision 3062) +++ sandbox/geraud/fllt.svg.7.hh (working copy) @@ -63,6 +63,7 @@ #include <mln/util/tree.hh> #include <mln/util/branch_iter_ind.hh> #include <mln/util/branch_iter.hh> +#include <mln/opt/at.hh> #include <sstream> @@ -178,7 +179,7 @@ image2d<T> output(nrows_, ncols_); for (int row = 0; row < nrows_; ++row) for (int col = 0; col < ncols_; ++col) - output.at(row, col) = input.at(row / coef, col / coef); + opt::at(output, row, col) = opt::at(input, row / coef, col / coef); return output; } Index: sandbox/geraud/dmap.cc --- sandbox/geraud/dmap.cc (revision 3062) +++ sandbox/geraud/dmap.cc (working copy) @@ -8,6 +8,7 @@ #include <mln/accu/max.hh> #include <mln/io/pbm/load.hh> #include <mln/io/pgm/save.hh> +#include <mln/opt/at.hh> namespace mln @@ -107,7 +108,7 @@ const unsigned n = 9; image2d<bool> ima(n, n); level::fill(ima, false); - ima.at(n / 2, n / 2) = true; + opt::at(ima, n / 2, n / 2) = true; // int ws[] = { 3, 2, 3, // 2, 0, 2, Index: sandbox/geraud/tufa_2008/steps.0.cc --- sandbox/geraud/tufa_2008/steps.0.cc (revision 3062) +++ sandbox/geraud/tufa_2008/steps.0.cc (working copy) @@ -42,6 +42,7 @@ #include <mln/morpho/tree/compute_attribute_image.hh> #include <mln/morpho/closing_area.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> namespace mln @@ -54,10 +55,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: sandbox/geraud/tufa_2008/steps.1.cc --- sandbox/geraud/tufa_2008/steps.1.cc (revision 3062) +++ sandbox/geraud/tufa_2008/steps.1.cc (working copy) @@ -44,6 +44,7 @@ #include <mln/morpho/tree/compute_attribute_image.hh> #include <mln/morpho/closing_area.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> namespace mln @@ -56,10 +57,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: sandbox/geraud/tufa_2008/steps.2.cc --- sandbox/geraud/tufa_2008/steps.2.cc (revision 3062) +++ sandbox/geraud/tufa_2008/steps.2.cc (working copy) @@ -44,6 +44,7 @@ #include <mln/morpho/tree/compute_attribute_image.hh> #include <mln/morpho/closing_area.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> namespace mln @@ -56,10 +57,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: sandbox/geraud/tufa_2008/steps.3.cc --- sandbox/geraud/tufa_2008/steps.3.cc (revision 3062) +++ sandbox/geraud/tufa_2008/steps.3.cc (working copy) @@ -45,6 +45,8 @@ #include <mln/morpho/closing_area.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> + namespace mln { @@ -56,10 +58,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: sandbox/geraud/tufa_2008/steps.2b.cc --- sandbox/geraud/tufa_2008/steps.2b.cc (revision 3062) +++ sandbox/geraud/tufa_2008/steps.2b.cc (working copy) @@ -44,6 +44,7 @@ #include <mln/morpho/tree/compute_attribute_image.hh> #include <mln/morpho/closing_area.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> namespace mln @@ -56,10 +57,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: sandbox/geraud/tufa_2008/compute_a.cc --- sandbox/geraud/tufa_2008/compute_a.cc (revision 3062) +++ sandbox/geraud/tufa_2008/compute_a.cc (working copy) @@ -46,6 +46,7 @@ #include <mln/labeling/regional_minima.hh> #include <mln/accu/count.hh> +#include <mln/opt/at.hh> @@ -59,10 +60,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: sandbox/geraud/tufa_2008/fz_count.cc --- sandbox/geraud/tufa_2008/fz_count.cc (revision 3062) +++ sandbox/geraud/tufa_2008/fz_count.cc (working copy) @@ -39,6 +39,7 @@ #include <mln/labeling/regional_minima.hh> #include <mln/labeling/flat_zones.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> namespace mln @@ -51,10 +52,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: sandbox/geraud/tufa_2008/regmin_count.cc --- sandbox/geraud/tufa_2008/regmin_count.cc (revision 3062) +++ sandbox/geraud/tufa_2008/regmin_count.cc (working copy) @@ -40,6 +40,8 @@ #include <mln/labeling/flat_zones.hh> #include <mln/level/fill.hh> +#include <mln/opt/at.hh> + namespace mln { @@ -51,10 +53,10 @@ for (int r = 0; r < nr; ++r) { for (int c = 0; c < nc; ++c) - if (par.at(r,c) == point2d(r,c)) + if (opt::at(par, r,c) == point2d(r,c)) std::cout << "( ) "; else - std::cout << par.at(r,c) << ' '; + std::cout << opt::at(par, r,c) << ' '; std::cout << std::endl; } } Index: tests/debug/println_with_border.cc --- tests/debug/println_with_border.cc (revision 3062) +++ tests/debug/println_with_border.cc (working copy) @@ -35,6 +35,7 @@ #include <mln/level/fill.hh> #include <mln/debug/println.hh> #include <mln/debug/println_with_border.hh> +#include <mln/opt/at.hh> using namespace mln; @@ -46,17 +47,17 @@ { image2d<bool> msk(3, 3); - msk.at(0, 0) = true; - msk.at(1, 0) = true; - msk.at(2, 0) = true; - - msk.at(0, 1) = true; - msk.at(1, 1) = false; - msk.at(2, 1) = true; - - msk.at(0, 2) = true; - msk.at(1, 2) = true; - msk.at(2, 2) = true; + opt::at(msk, 0, 0) = true; + opt::at(msk, 1, 0) = true; + opt::at(msk, 2, 0) = true; + + opt::at(msk, 0, 1) = true; + opt::at(msk, 1, 1) = false; + opt::at(msk, 2, 1) = true; + + opt::at(msk, 0, 2) = true; + opt::at(msk, 1, 2) = true; + opt::at(msk, 2, 2) = true; debug::println(msk); debug::println_with_border(msk); @@ -64,9 +65,9 @@ { image1d<bool> msk(3); - msk.at(0) = false; - msk.at(1) = true; - msk.at(2) = false; + opt::at(msk, 0) = false; + opt::at(msk, 1) = true; + opt::at(msk, 2) = false; debug::println(msk); debug::println_with_border(msk); Index: tests/debug/println.cc --- tests/debug/println.cc (revision 3062) +++ tests/debug/println.cc (working copy) @@ -33,6 +33,7 @@ #include <mln/core/image/image2d.hh> #include <mln/level/fill.hh> #include <mln/debug/println.hh> +#include <mln/opt/at.hh> using namespace mln; @@ -41,6 +42,6 @@ int main() { image2d<bool> msk(3, 3); - msk.at(1, 1) = true; + opt::at(msk, 1, 1) = true; debug::println(msk); } Index: tests/histo/compute.cc --- tests/histo/compute.cc (revision 3062) +++ tests/histo/compute.cc (working copy) @@ -42,6 +42,8 @@ #include <mln/accu/histo.hh> #include <mln/histo/compute.hh> +#include <mln/opt/at.hh> + int main() { @@ -66,7 +68,7 @@ { image2d<int_u8> ima(3, 3); debug::iota(ima); - ima.at(0,0) = 2; + opt::at(ima, 0,0) = 2; histo::data<int_u8> h = histo::compute(ima); std::ostringstream oss; Index: tests/core/other/pixel.cc --- tests/core/other/pixel.cc (revision 3062) +++ tests/core/other/pixel.cc (working copy) @@ -33,6 +33,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/pixel.hh> #include <mln/metal/equal.hh> +#include <mln/opt/at.hh> int main() @@ -47,12 +48,12 @@ { pixel<I> pxl(ima, point2d(1, 1)); pxl.val() = 51; - mln_assertion(ima.at(1, 1) == 51); + mln_assertion(opt::at(ima, 1, 1) == 51); } { pixel<const I> pxl(ima, point2d(1, 1)); - ima.at(1, 1) = 51; + opt::at(ima, 1, 1) = 51; mln_assertion(unsigned(pxl) == 4); mln_assertion(pxl.val() == 51); Index: tests/opt/Makefile.am --- tests/opt/Makefile.am (revision 0) +++ tests/opt/Makefile.am (revision 0) @@ -0,0 +1,10 @@ +## Process this file through Automake to create Makefile.in -*- Makefile -*- + +include $(top_srcdir)/milena/tests/tests.mk + +check_PROGRAMS = \ + at + +at_SOURCES = at.cc + +TESTS = $(check_PROGRAMS) Index: tests/level/convert.cc --- tests/level/convert.cc (revision 3062) +++ tests/level/convert.cc (working copy) @@ -35,6 +35,7 @@ #include <mln/value/rgb8.hh> #include <mln/literal/grays.hh> +#include <mln/opt/at.hh> int main() @@ -47,10 +48,10 @@ // bool -> rgb8 { image2d<bool> ima(1, 2); - ima.at(0, 0) = false; - ima.at(0, 1) = true; + opt::at(ima, 0, 0) = false; + opt::at(ima, 0, 1) = true; image2d<rgb8> out = level::convert(rgb8(), ima); - mln_assertion(out.at(0, 0) == literal::black); - mln_assertion(out.at(0, 1) == literal::white); + mln_assertion(opt::at(out, 0, 0) == literal::black); + mln_assertion(opt::at(out, 0, 1) == literal::white); } } Index: tests/level/memset_.cc --- tests/level/memset_.cc (revision 3062) +++ tests/level/memset_.cc (working copy) @@ -34,6 +34,7 @@ #include <mln/geom/ncols.hh> #include <mln/level/fill.hh> #include <mln/level/memset_.hh> +#include <mln/opt/at.hh> int main() @@ -48,6 +49,6 @@ geom::ncols(ima) + 2 * ima.border() + 1); // ^ // | - mln_assertion(ima.at(1,0) == X); // <----------------+ - mln_assertion(ima.at(1,1) != X); + mln_assertion(opt::at(ima, 1,0) == X); // <----------------+ + mln_assertion(opt::at(ima, 1,1) != X); } Index: tests/transform/distance_geodesic.cc --- tests/transform/distance_geodesic.cc (revision 3062) +++ tests/transform/distance_geodesic.cc (working copy) @@ -34,6 +34,7 @@ #include <mln/value/int_u8.hh> #include <mln/level/fill.hh> #include <mln/debug/println.hh> +#include <mln/opt/at.hh> #include <mln/transform/distance_geodesic.hh> @@ -45,7 +46,7 @@ image2d<bool> input(9, 9); level::fill(input, false); - input.at(4, 4) = true; + opt::at(input, 4, 4) = true; image2d<int_u8> output = transform::distance_geodesic(input, c4(), int_u8(4)); debug::println(output); Index: tests/transform/distance_front.cc --- tests/transform/distance_front.cc (revision 3062) +++ tests/transform/distance_front.cc (working copy) @@ -35,6 +35,7 @@ #include <mln/value/int_u8.hh> #include <mln/level/fill.hh> #include <mln/debug/println.hh> +#include <mln/opt/at.hh> #include <mln/transform/distance_front.hh> @@ -46,7 +47,7 @@ image2d<bool> input(9, 9); level::fill(input, false); - input.at(4, 4) = true; + opt::at(input, 4, 4) = true; int ws[] = { 0, 9, 0, 9, 0, 9, 6, 4, 6, 9, Index: tests/make/dual_neighb.cc --- tests/make/dual_neighb.cc (revision 3062) +++ tests/make/dual_neighb.cc (working copy) @@ -32,6 +32,7 @@ #include <mln/make/dual_neighb.hh> #include <mln/core/alias/neighb2d.hh> #include <mln/core/image/image2d.hh> +#include <mln/opt/at.hh> @@ -53,8 +54,8 @@ using namespace mln; image2d<bool> ima(1, 2, 1); - ima.at(0, 0) = true; - ima.at(0, 1) = false; + opt::at(ima, 0, 0) = true; + opt::at(ima, 0, 1) = false; mln_assertion( count(ima, make::dual_neighb(ima, c4(), c8())) == c4().size() + c8().size() ); Index: tests/morpho/artificial_line_graph_image_wst.cc --- tests/morpho/artificial_line_graph_image_wst.cc (revision 3062) +++ tests/morpho/artificial_line_graph_image_wst.cc (working copy) @@ -76,6 +76,8 @@ #include <mln/math/max.hh> #include <mln/math/abs.hh> +#include <mln/opt/at.hh> + #include "tests/data.hh" @@ -100,7 +102,7 @@ image2d<input_val_t> input (nrows, ncols); for (unsigned r = 0; r < nrows; ++r) for (unsigned c = 0; c < ncols; ++c) - input.at(r,c) = + opt::at(input, r,c) = ((r / square_length) % 2 == (c / square_length) % 2) ? mln_min(input_val_t) : mln_max(input_val_t); Index: tests/Makefile.am --- tests/Makefile.am (revision 3062) +++ tests/Makefile.am (working copy) @@ -30,6 +30,7 @@ metal \ morpho \ norm \ + opt \ pw \ set \ subsampling \ Index: tests/canvas/chamfer.cc --- tests/canvas/chamfer.cc (revision 3062) +++ tests/canvas/chamfer.cc (working copy) @@ -43,6 +43,8 @@ #include <mln/geom/chamfer.hh> #include <mln/level/compare.hh> +#include <mln/opt/at.hh> + int main() { @@ -53,7 +55,7 @@ { level::fill(ima, false); - ima.at(4,4) = true; + opt::at(ima, 4,4) = true; const w_window2d_int& w_win = make::mk_chamfer_3x3_int<2, 0> (); image2d<unsigned> out = geom::chamfer(ima, w_win, max); unsigned r[9][9] = @@ -75,7 +77,7 @@ { level::fill(ima, false); - ima.at(4,4) = true; + opt::at(ima, 4,4) = true; const w_window2d_int& w_win = make::mk_chamfer_3x3_int<2, 3> (); image2d<unsigned> out = geom::chamfer(ima, w_win, max); @@ -98,7 +100,7 @@ { level::fill(ima, false); - ima.at(4,4) = true; + opt::at(ima, 4,4) = true; const w_window2d_int& w_win = make::mk_chamfer_5x5_int<4, 6, 9> (); image2d<unsigned> out = geom::chamfer(ima, w_win, max); image2d<unsigned>::fwd_piter p(out.domain()); Index: doc/tutorial/samples/ima2d-3.cc --- doc/tutorial/samples/ima2d-3.cc (revision 3062) +++ doc/tutorial/samples/ima2d-3.cc (working copy) @@ -1,5 +1,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/alias/box2d.hh> +#include <mln/opt/at.hh> + int main() { using namespace mln; @@ -13,8 +15,8 @@ // Associate '9' as value for the site/point2d (1,2). // The value is returned by reference and can be changed. - ima.at(1,2) = 9; - std::cout << "ima.at(1,2) = " << ima.at(1,2) + opt::at(ima, 1,2) = 9; + std::cout << "ima.at(1,2) = " << opt::at(ima, 1,2) << std::endl; std::cout << "ima(p) = " << ima(p) << std::endl; @@ -25,7 +27,7 @@ // The value is returned by reference // and can be changed as well. ima(p) = 2; - std::cout << "ima.at(1,2) = " << ima.at(1,2) + std::cout << "ima.at(1,2) = " << opt::at(ima, 1,2) << std::endl; std::cout << "ima(p) = " << ima(p) << std::endl; // \} Index: doc/tutorial/examples/image_plain.cc --- doc/tutorial/examples/image_plain.cc (revision 3062) +++ doc/tutorial/examples/image_plain.cc (working copy) @@ -3,6 +3,7 @@ # include <mln/debug/println.hh> # include <mln/debug/iota.hh> # include <mln/level/fill_with_value.hh> +# include <mln/opt/at.hh> template <typename I> @@ -10,14 +11,14 @@ { using namespace mln; const unsigned - nr = ima.at(0,0).domain().nrows(), - nc = ima.at(0,0).domain().ncols(); + nr = opt::at(ima, 0,0).domain().nrows(), + nc = opt::at(ima, 0,0).domain().ncols(); for (unsigned row = 0; row < ima.nrows(); ++row) for (unsigned r = 0; r < nr; ++r) { for (unsigned col = 0; col < ima.ncols(); ++col) for (unsigned c = 0; c < nc; ++c) - std::cout << ima.at(row, col)(point2d(r,c)) << ' '; + std::cout << opt::at(ima, row, col)(point2d(r,c)) << ' '; std::cout << std::endl; } } @@ -36,6 +37,6 @@ image2d<I_> mos(2, 2); level::fill_with_value(mos, ima); - level::fill_with_value(mos.at(1,1), 0); + level::fill_with_value(opt::at(mos, 1,1), 0); picture(mos); } Index: doc/benchmark/image2d.cc --- doc/benchmark/image2d.cc (revision 3062) +++ doc/benchmark/image2d.cc (working copy) @@ -2,6 +2,7 @@ # include <mln/util/timer.hh> # include <mln/core/pixter2d.hh> +# include <mln/opt/at.hh> int size; @@ -45,7 +46,7 @@ t.start(); for (int row = 0; row < size; ++row) for (int col = 0; col < size; ++col) - ima.at(row, col) = 0; + mln::opt::at(ima, row, col) = 0; return t.read(); } @@ -80,7 +81,7 @@ mln::def::coord & row = p.row(), & col = p.col(); for (row = 0; row < size; ++row) for (col = 0; col < size; ++col) - ima.at(row, col) = 0; + mln::opt::at(ima, row, col) = 0; return t.read(); } Index: doc/examples/labeling_algo.cc --- doc/examples/labeling_algo.cc (revision 3062) +++ doc/examples/labeling_algo.cc (working copy) @@ -43,6 +43,8 @@ # include <mln/draw/mesh.hh> # include <mln/geom/seeds2tiling.hh> # include <mln/make/voronoi.hh> +# include <mln/make/voronoi.hh> +# include <mln/opt/at.hh> int main() { @@ -59,7 +61,7 @@ image2d<int> input(in.domain()); level::fill(input, lab); - lab.at(0,0) = 0; + opt::at(lab, 0,0) = 0; image2d<unsigned> inte = geom::seeds2tiling(lab, c4 ()); border::fill(inte, 0);