https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Renaming io and fix warnings.
* mln/io/pgm: New directory.
* mln/io/save_pgm.hh: Rename as...
* mln/io/pgm/save.hh: ...this.
(save_pgn): Rename as...
(save): ...this.
* mln/io/load_pgm.hh: Rename as...
* mln/io/pgm/load.hh: ...this.
(load_pgm): Rename as...
(load): ...this.
* tests/level_naive_median.cc,
* tests/linear_log.cc,
* tests/level_median_hline2d.cc,
* tests/morpho_thinning.cc,
* tests/morpho_erosion.cc,
* tests/morpho_hit_or_miss.cc,
* tests/morpho_laplacian.cc,
* tests/morpho_opening_area.cc,
* tests/labeling_regional_maxima.cc,
* tests/level_median_fast.cc,
* tests/level_approx_median.cc,
* tests/level_median.cc,
* tests/linear_convolve.cc,
* tests/linear_sobel.cc,
* tests/line_convolve.cc,
* tests/linear_gaussian.cc,
* tests/linear_lap.cc,
* tests/labeling_foreground.cc,
* tests/morpho_contrast.cc,
* tests/morpho_gradient.cc: Update.
* mln/linear/gaussian.hh,
* mln/canvas/morpho/algebraic_union_find.hh,
* mln/canvas/dirbrowsing.hh,
* mln/canvas/labeling.hh: Fix warnings.
mln/canvas/dirbrowsing.hh | 2 +-
mln/canvas/labeling.hh | 1 -
mln/canvas/morpho/algebraic_union_find.hh | 1 -
mln/io/pgm/load.hh | 21 +++++++++++++--------
mln/io/pgm/save.hh | 27 ++++++++++++++++-----------
mln/linear/gaussian.hh | 11 +++++------
tests/labeling_foreground.cc | 8 ++++----
tests/labeling_regional_maxima.cc | 8 ++++----
tests/level_approx_median.cc | 8 ++++----
tests/level_median.cc | 8 ++++----
tests/level_median_fast.cc | 8 ++++----
tests/level_median_hline2d.cc | 8 ++++----
tests/level_naive_median.cc | 8 ++++----
tests/line_convolve.cc | 8 ++++----
tests/linear_convolve.cc | 8 ++++----
tests/linear_gaussian.cc | 8 ++++----
tests/linear_lap.cc | 4 ++--
tests/linear_log.cc | 8 ++++----
tests/linear_sobel.cc | 8 ++++----
tests/morpho_contrast.cc | 8 ++++----
tests/morpho_erosion.cc | 10 +++++-----
tests/morpho_gradient.cc | 8 ++++----
tests/morpho_hit_or_miss.cc | 10 +++++-----
tests/morpho_laplacian.cc | 8 ++++----
tests/morpho_opening_area.cc | 8 ++++----
tests/morpho_thinning.cc | 8 ++++----
26 files changed, 115 insertions(+), 108 deletions(-)
Index: tests/level_naive_median.cc
--- tests/level_naive_median.cc (revision 1092)
+++ tests/level_naive_median.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/win/rectangle2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
#include <mln/level/naive/median.hh>
@@ -50,9 +50,9 @@
border::thickness = 52;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
level::naive::median(lena, rec, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/linear_log.cc
--- tests/linear_log.cc (revision 1092)
+++ tests/linear_log.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/value/int_u8.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/border/thickness.hh>
#include <mln/linear/log.hh>
@@ -50,7 +50,7 @@
border::thickness = 2;
- image2d_b<int_u8> lena = io::load_pgm("../img/lena.pgm");
+ image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
image2d_b<int> tmp(lena.domain());
linear::LoG_5x5(lena, tmp);
@@ -62,7 +62,7 @@
image2d_b<int_u8> out(lena.domain());
level::stretch(tmp, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
{
int_u8 min, max;
estim::min_max(out, min, max);
Index: tests/level_median_hline2d.cc
--- tests/level_median_hline2d.cc (revision 1092)
+++ tests/level_median_hline2d.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/win/rectangle2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
#include <mln/level/median.hh>
@@ -51,14 +51,14 @@
border::thickness = 0;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain()),
ref(lena.domain());
level::median(lena, win::rectangle2d(1, 101), ref);
level::median(lena, win::hline2d(101), out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
// FIXME: mln_assertion(out = ref);
}
Index: tests/morpho_thinning.cc
--- tests/morpho_thinning.cc (revision 1092)
+++ tests/morpho_thinning.cc (working copy)
@@ -36,8 +36,8 @@
#include <mln/core/win/rectangle2d.hh>
#include <mln/core/window2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/morpho/thinning.hh>
@@ -60,10 +60,10 @@
border::thickness = 2;
image2d_b<int_u8>
- pic = io::load_pgm("../img/picasso.pgm"),
+ pic = io::pgm::load("../img/picasso.pgm"),
out(pic.domain());
morpho::thinning(pic, win_fg, win_bg, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/morpho_erosion.cc
--- tests/morpho_erosion.cc (revision 1092)
+++ tests/morpho_erosion.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/win/rectangle2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
#include <mln/level/fill.hh>
@@ -54,12 +54,12 @@
win::rectangle2d rec(21, 21);
border::thickness = 66;
- image2d_b<int_u8> lena = io::load_pgm("../img/lena.pgm");
+ image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
{
image2d_b<int_u8> out(lena.domain());
morpho::erosion(lena, rec, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
{
@@ -71,7 +71,7 @@
image2d_b<int_u8>::fwd_piter p(lena.domain());
for_all(p)
test(p) = out(p) ? 255 : 0;
- io::save_pgm(test, "test.pgm");
+ io::pgm::save(test, "test.pgm");
}
}
Index: tests/morpho_hit_or_miss.cc
--- tests/morpho_hit_or_miss.cc (revision 1092)
+++ tests/morpho_hit_or_miss.cc (working copy)
@@ -38,8 +38,8 @@
#include <mln/geom/shift.hh>
#include <mln/set/diff.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/level/fill.hh>
#include <mln/level/stretch.hh>
@@ -53,7 +53,7 @@
window2d win_hit = geom::shift(win::rectangle2d(3, 3),
make::dpoint2d(+1, +1));
- window2d win_miss = set::diff(win::rectangle2d(5, 5), win_hit);
+ window2d win_miss = mln::set::diff(win::rectangle2d(5, 5), win_hit);
{
bool hit[] = { 0, 0, 0, 0, 0,
@@ -76,10 +76,10 @@
border::thickness = 2;
image2d_b<int_u8>
- pic = io::load_pgm("../img/picasso.pgm"),
+ pic = io::pgm::load("../img/picasso.pgm"),
out(pic.domain());
morpho::hit_or_miss(pic, win_hit, win_miss, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/morpho_laplacian.cc
--- tests/morpho_laplacian.cc (revision 1092)
+++ tests/morpho_laplacian.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/win/rectangle2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/value/int_u_sat.hh>
#include <mln/core/cast_image.hh>
@@ -53,11 +53,11 @@
win::rectangle2d rect(5, 5);
border::thickness = 2;
- image2d_b<int_u8> lena = io::load_pgm("../img/tiny.pgm");
+ image2d_b<int_u8> lena = io::pgm::load("../img/tiny.pgm");
image2d_b<int> lap(lena.domain());
morpho::laplacian(lena, rect, lap);
image2d_b< value::int_u_sat<8> > out(lena.domain());
arith::plus_cst(lap, 128, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/morpho_opening_area.cc
--- tests/morpho_opening_area.cc (revision 1092)
+++ tests/morpho_opening_area.cc (working copy)
@@ -34,8 +34,8 @@
#include <mln/value/int_u8.hh>
#include <mln/core/neighb2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/morpho/opening_area.hh>
@@ -47,9 +47,9 @@
using value::int_u8;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
morpho::opening_area(lena, c4(), 510, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/labeling_regional_maxima.cc
--- tests/labeling_regional_maxima.cc (revision 1092)
+++ tests/labeling_regional_maxima.cc (working copy)
@@ -34,8 +34,8 @@
#include <mln/core/neighb2d.hh>
#include <mln/value/int_u8.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/labeling/regional_maxima.hh>
@@ -46,12 +46,12 @@
using value::int_u8;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
unsigned n;
labeling::regional_maxima(lena, c4(), out, n);
mln_assertion(n = 255);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/level_median_fast.cc
--- tests/level_median_fast.cc (revision 1092)
+++ tests/level_median_fast.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/win/rectangle2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
@@ -94,11 +94,11 @@
border::thickness = 52;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
level::fast_median(lena, rect, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
}
Index: tests/level_approx_median.cc
--- tests/level_approx_median.cc (revision 1092)
+++ tests/level_approx_median.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/win/rectangle2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
#include <mln/level/approx/median.hh>
@@ -51,9 +51,9 @@
border::thickness = 52;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
level::approx::median(lena, rect, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/level_median.cc
--- tests/level_median.cc (revision 1092)
+++ tests/level_median.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/win/rectangle2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
#include <mln/level/median.hh>
@@ -51,9 +51,9 @@
border::thickness = 52;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
level::median(lena, rect, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/linear_convolve.cc
--- tests/linear_convolve.cc (revision 1092)
+++ tests/linear_convolve.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/value/int_u8.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/math/round.hh>
#include <mln/level/transform.hh>
@@ -51,7 +51,7 @@
border::thickness = 2;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
float ws[] = { .04, .04, .04, .04, .04,
@@ -65,5 +65,5 @@
linear::convolve(lena, w, tmp);
level::transform(tmp, math::round<int_u8>(), out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/linear_sobel.cc
--- tests/linear_sobel.cc (revision 1092)
+++ tests/linear_sobel.cc (working copy)
@@ -34,8 +34,8 @@
#include <mln/value/int_u8.hh>
#include <mln/level/saturate.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/border/thickness.hh>
#include <mln/linear/sobel.hh>
@@ -49,12 +49,12 @@
border::thickness = 1;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
image2d_b<int> tmp(lena.domain());
linear::sobel(lena, tmp);
level::saturate(tmp, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/line_convolve.cc
--- tests/line_convolve.cc (revision 1092)
+++ tests/line_convolve.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/value/int_u8.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/math/round.hh>
#include <mln/level/transform.hh>
@@ -51,7 +51,7 @@
border::thickness = 4;
image2d_b<int_u8>
- lena = io::load_pgm("../img/lena.pgm"),
+ lena = io::pgm::load("../img/lena.pgm"),
out(lena.domain());
image2d_b<float> tmp(lena.domain());
@@ -59,5 +59,5 @@
linear::line_convolve(lena, ws, tmp);
level::transform(tmp, math::round<int_u8>(), out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/linear_gaussian.cc
--- tests/linear_gaussian.cc (revision 1092)
+++ tests/linear_gaussian.cc (working copy)
@@ -34,8 +34,8 @@
#include <mln/value/int_u8.hh>
#include <mln/value/int_u_sat.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/level/transform.hh>
#include <mln/level/saturate.hh>
@@ -48,12 +48,12 @@
{
using namespace mln;
- image2d_b< value::int_u8 > lena = io::load_pgm("../img/lena.pgm");
+ image2d_b< value::int_u8 > lena = io::pgm::load("../img/lena.pgm");
image2d_b<float> tmp(lena.domain());
linear::gaussian(lena, 5.1f, tmp);
image2d_b< value::int_u_sat<8> > out(lena.domain());
level::transform(tmp, math::round<int>(), out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: tests/linear_lap.cc
--- tests/linear_lap.cc (revision 1092)
+++ tests/linear_lap.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image2d_b.hh>
#include <mln/value/int_u8.hh>
-#include <mln/io/load_pgm.hh>
+#include <mln/io/pgm/load.hh>
#include <mln/border/thickness.hh>
#include <mln/linear/lap.hh>
@@ -45,7 +45,7 @@
border::thickness = 1;
- image2d_b<int_u8> lena = io::load_pgm("../img/lena.pgm");
+ image2d_b<int_u8> lena = io::pgm::load("../img/lena.pgm");
image2d_b<int> tmp(lena.domain());
linear::lap_4(lena, tmp);
}
Index: tests/labeling_foreground.cc
--- tests/labeling_foreground.cc (revision 1092)
+++ tests/labeling_foreground.cc (working copy)
@@ -35,8 +35,8 @@
#include <mln/value/int_u8.hh>
#include <mln/pw/all.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/labeling/foreground.hh>
@@ -46,12 +46,12 @@
using value::int_u8;
image2d_b<int_u8>
- lena = io::load_pgm("../img/tiny.pgm"),
+ lena = io::pgm::load("../img/tiny.pgm"),
out(lena.domain());
unsigned n;
labeling::foreground((pw::value(lena) > pw::cst(127)) | lena.domain(),
c4(), out, n);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
mln_assertion(n = 14);
}
Index: tests/morpho_contrast.cc
--- tests/morpho_contrast.cc (revision 1092)
+++ tests/morpho_contrast.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/win/rectangle2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/int_s.hh>
@@ -54,7 +54,7 @@
border::thickness = 2;
image2d_b<int_u8>
- lena = io::load_pgm("../img/tiny.pgm"),
+ lena = io::pgm::load("../img/tiny.pgm"),
out(lena.domain());
image2d_b< value::int_s<10> >
@@ -65,7 +65,7 @@
morpho::contrast(in, rect, tmp);
level::saturate(tmp, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
{
// self-duality test:
Index: tests/morpho_gradient.cc
--- tests/morpho_gradient.cc (revision 1092)
+++ tests/morpho_gradient.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image2d_b.hh>
#include <mln/core/win/rectangle2d.hh>
-#include <mln/io/load_pgm.hh>
-#include <mln/io/save_pgm.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
#include <mln/morpho/gradient.hh>
@@ -50,9 +50,9 @@
border::thickness = 2;
image2d_b<int_u8>
- lena = io::load_pgm("../img/tiny.pgm"),
+ lena = io::pgm::load("../img/tiny.pgm"),
out(lena.domain());
morpho::gradient(lena, rect, out);
- io::save_pgm(out, "out.pgm");
+ io::pgm::save(out, "out.pgm");
}
Index: mln/io/pgm/save.hh
--- mln/io/pgm/save.hh (revision 0)
+++ mln/io/pgm/save.hh (working copy)
@@ -26,8 +26,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_IO_SAVE_PGM_HH
-# define MLN_IO_SAVE_PGM_HH
+#ifndef MLN_IO_PGM_SAVE_HH
+# define MLN_IO_PGM_SAVE_HH
# include <iostream>
# include <fstream>
@@ -50,8 +50,11 @@
namespace io
{
+ namespace pgm
+ {
+
template <typename I>
- void save_pgm(const Image<I>& ima, const std::string& filename);
+ void save(const Image<I>& ima, const std::string& filename);
# ifndef MLN_INCLUDE_ONLY
@@ -60,7 +63,7 @@
{
template <typename I>
- void save_pgm_header_(const I& ima, const std::string& filename,
+ void save_header_(const I& ima, const std::string& filename,
std::ofstream& file)
{
if (! file)
@@ -76,11 +79,11 @@
}
template <typename I>
- void save_pgm_(const Fast_Image<I>& ima_, const std::string&
filename)
+ void save_(const Fast_Image<I>& ima_, const std::string& filename)
{
const I& ima = exact(ima_);
std::ofstream file(filename.c_str());
- save_pgm_header_(ima, filename, file);
+ save_header_(ima, filename, file);
const int
min_row = geom::min_row(ima),
max_row = geom::max_row(ima);
@@ -108,11 +111,11 @@
}
template <typename I>
- void save_pgm_(const Image<I>& ima_, const std::string& filename)
+ void save_(const Image<I>& ima_, const std::string& filename)
{
const I& ima = exact(ima_);
std::ofstream file(filename.c_str());
- save_pgm_header_(ima, filename, file);
+ save_header_(ima, filename, file);
const int
min_row = geom::min_row(ima),
max_row = geom::max_row(ima),
@@ -131,20 +134,22 @@
template <typename I>
- void save_pgm(const Image<I>& ima, const std::string& filename)
+ void save(const Image<I>& ima, const std::string& filename)
{
mln::metal::or_<
mln::metal::equal<mln_value(I), value::int_u<8> >,
mln::metal::equal<mln_value(I), value::int_u_sat<8> >
::check();
- impl::save_pgm_(exact(ima),
filename);
+ impl::save_(exact(ima), filename);
}
# endif // ! MLN_INCLUDE_ONLY
+ } // end of namespace mln::pgm
+
} // end of namespace mln::io
} // end of namespace mln
-#endif // ! MLN_IO_SAVE_PGM_HH
+#endif // ! MLN_IO_PGM_SAVE_HH
Index: mln/io/pgm/load.hh
--- mln/io/pgm/load.hh (revision 0)
+++ mln/io/pgm/load.hh (working copy)
@@ -26,8 +26,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_IO_LOAD_PGM_HH
-# define MLN_IO_LOAD_PGM_HH
+#ifndef MLN_IO_PGM_LOAD_HH
+# define MLN_IO_PGM_LOAD_HH
# include <iostream>
# include <fstream>
@@ -43,6 +43,9 @@
namespace io
{
+ namespace pgm
+ {
+
namespace internal
{
@@ -116,7 +119,7 @@
/// load_ascii.
template <typename I>
- void load_pgm_ascii(std::ifstream& file, I& ima)
+ void load_ascii(std::ifstream& file, I& ima)
{
mln_fwd_piter(I) p(ima.domain());
for_all(p)
@@ -132,7 +135,7 @@
/// load_raw_2d.
template <typename I>
- void load_pgm_raw_2d(std::ifstream& file, I& ima)
+ void load_raw_2d(std::ifstream& file, I& ima)
{
point2d p = make::point2d(0, ima.domain().pmin().col());
typedef mln_value(I) V;
@@ -165,7 +168,7 @@
} // end of namespace mln::io::internal
- image2d_b<value::int_u8> load_pgm(const std::string& filename)
+ image2d_b<value::int_u8> load(const std::string& filename)
{
std::ifstream file(filename.c_str());
if (! file)
@@ -180,16 +183,18 @@
image2d_b<value::int_u8> ima(nrows, ncols);
if (type = '5')
- internal::load_pgm_raw_2d(file, ima);
+ internal::load_raw_2d(file, ima);
else
if (type = '2')
- internal::load_pgm_ascii(file, ima);
+ internal::load_ascii(file, ima);
return ima;
}
+ } // end of namespace mln::io::pgm
+
} // end of namespace mln::io
} // end of namespace mln
-#endif // ! MLN_IO_LOAD_PGM_HH
+#endif // ! MLN_IO_PGM_LOAD_HH
Index: mln/linear/gaussian.hh
--- mln/linear/gaussian.hh (revision 1092)
+++ mln/linear/gaussian.hh (working copy)
@@ -52,7 +52,7 @@
template <class I, class O>
void
gaussian(const Image<I>& input, float sigma,
- Image<O>& output)
+ Image<O>& output);
# ifndef MLN_INCLUDE_ONLY
@@ -251,7 +251,7 @@
I& img = exact(img_);
// Apply on rows.
- for (int j = 0; j < geom::ncols(img); ++j)
+ for (unsigned j = 0; j < geom::ncols(img); ++j)
recursivefilter_<float>(img, coef,
make::point2d(-img.border(), j),
make::point2d(geom::nrows(img) - 1 + img.border(), j),
@@ -259,7 +259,7 @@
make::dpoint2d(1, 0));
// Apply on columns.
- for (int i = 0; i < geom::nrows(img); ++i)
+ for (unsigned i = 0; i < geom::nrows(img); ++i)
recursivefilter_<float>(img, coef,
make::point2d(i, -img.border()),
make::point2d(i, geom::ncols(img) - 1 + img.border()),
@@ -298,14 +298,13 @@
gaussian(const Image<I>& input, float sigma,
Image<O>& output)
{
- recursivefilter_coef_
+ impl::recursivefilter_coef_
coef(1.68f, 3.735f,
1.783f, 1.723f,
-0.6803f, -0.2598f,
0.6318f, 1.997f,
sigma);
-
- gaussian_common_(in, coef, sigma, out);
+ impl::gaussian_common_(input, coef, sigma, output);
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/canvas/morpho/algebraic_union_find.hh
--- mln/canvas/morpho/algebraic_union_find.hh (revision 1092)
+++ mln/canvas/morpho/algebraic_union_find.hh (working copy)
@@ -100,7 +100,6 @@
// second pass
{
mln_bkd_piter(S) p(f.s);
- mln_niter(N) n(f.nbh, p);
for_all(p)
if (is_root(p))
f.output(p) = f.input(p);
Index: mln/canvas/dirbrowsing.hh
--- mln/canvas/dirbrowsing.hh (revision 1092)
+++ mln/canvas/dirbrowsing.hh (working copy)
@@ -77,7 +77,7 @@
for (int c = F::dim - 1; c >= 0; --c)
{
- if (c = f.dir)
+ if (c = int(f.dir))
continue;
if (p[c] != pmax[c])
{
Index: mln/canvas/labeling.hh
--- mln/canvas/labeling.hh (revision 1092)
+++ mln/canvas/labeling.hh (working copy)
@@ -97,7 +97,6 @@
// second pass
{
mln_bkd_piter(S) p(f.s);
- mln_niter(N) n(f.nbh, p);
for_all(p) if (f.handles(p))
{
if (is_root(p))