* milena/mln/level/fill_with_image.spe.hh,
* milena/mln/morpho/erosion.spe.hh:
Call trace::exiting before the return statement.
* mln/io/fits/load.hh,
* mln/io/off/load.hh,
* mln/io/off/save.hh,
* mln/io/pbm/load.hh,
* mln/io/pbm/save.hh,
* mln/io/pfm/load.hh,
* mln/io/pfm/save.hh,
* mln/io/pgm/load.hh,
* mln/io/pgm/save.hh,
* mln/io/pnm/load.hh,
* mln/io/pnm/save.hh,
* mln/io/ppm/load.hh:
Add missing traces.
---
milena/ChangeLog | 21 +++++++++++++++++++++
milena/mln/io/fits/load.hh | 4 ++++
milena/mln/io/off/load.hh | 4 ++++
milena/mln/io/off/save.hh | 4 ++++
milena/mln/io/pbm/load.hh | 4 ++++
milena/mln/io/pbm/save.hh | 2 ++
milena/mln/io/pfm/load.hh | 5 +++++
milena/mln/io/pfm/save.hh | 2 ++
milena/mln/io/pgm/load.hh | 7 ++++++-
milena/mln/io/pgm/save.hh | 3 ++-
milena/mln/io/pnm/load.hh | 9 ++++++++-
milena/mln/io/pnm/save.hh | 2 ++
milena/mln/io/ppm/load.hh | 7 ++++++-
milena/mln/level/fill_with_image.spe.hh | 4 ++--
milena/mln/morpho/erosion.spe.hh | 31 ++++++++++++++++++++-----------
15 files changed, 92 insertions(+), 17 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 26dca4b..1a947ad 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,24 @@
+2008-10-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Fix wrong or missing traces.
+ * milena/mln/level/fill_with_image.spe.hh,
+ * milena/mln/morpho/erosion.spe.hh:
+ Call trace::exiting before the return statement.
+
+ * mln/io/fits/load.hh,
+ * mln/io/off/load.hh,
+ * mln/io/off/save.hh,
+ * mln/io/pbm/load.hh,
+ * mln/io/pbm/save.hh,
+ * mln/io/pfm/load.hh,
+ * mln/io/pfm/save.hh,
+ * mln/io/pgm/load.hh,
+ * mln/io/pgm/save.hh,
+ * mln/io/pnm/load.hh,
+ * mln/io/pnm/save.hh,
+ * mln/io/ppm/load.hh:
+ Add missing traces.
+
2008-10-27 Nicolas Ballas <ballas(a)lrde.epita.fr>
Fix bugs in low level routines.
diff --git a/milena/mln/io/fits/load.hh b/milena/mln/io/fits/load.hh
index 4d7e8e2..2e1b920 100644
--- a/milena/mln/io/fits/load.hh
+++ b/milena/mln/io/fits/load.hh
@@ -88,6 +88,8 @@ namespace mln
inline
image2d<float> load(const std::string& filename)
{
+ trace::entering("mln::io::fits::load");
+
fitsfile *fptr;
int status, nfound, anynull;
long naxes[2];
@@ -124,6 +126,8 @@ namespace mln
if (fits_close_file(fptr, &status))
fits_exit(status);
+ trace::exiting("mln::io::fits::load");
+
return output;
}
diff --git a/milena/mln/io/off/load.hh b/milena/mln/io/off/load.hh
index 60c534b..092d439 100644
--- a/milena/mln/io/off/load.hh
+++ b/milena/mln/io/off/load.hh
@@ -73,6 +73,8 @@ namespace mln
void load(bin_2complex_image3df& ima, const std::string& filename)
{
+ trace::entering("mln::io::off::load");
+
const std::string me = "mln::io::off::load";
std::ifstream istr(filename.c_str());
@@ -276,6 +278,8 @@ namespace mln
std::exit(1);
}
istr.close();
+
+ trace::exiting("mln::io::off::load");
}
diff --git a/milena/mln/io/off/save.hh b/milena/mln/io/off/save.hh
index dce42fd..ff47744 100644
--- a/milena/mln/io/off/save.hh
+++ b/milena/mln/io/off/save.hh
@@ -70,6 +70,8 @@ namespace mln
void save(const bin_2complex_image3df& ima, const std::string& filename)
{
+ trace::entering("mln::io::off::save");
+
const std::string me = "mln::io::off::save";
std::ofstream ostr(filename.c_str());
@@ -183,6 +185,8 @@ namespace mln
}
ostr.close();
+
+ trace::exiting("mln::io::off::save");
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/io/pbm/load.hh b/milena/mln/io/pbm/load.hh
index 3174b36..40c6086 100644
--- a/milena/mln/io/pbm/load.hh
+++ b/milena/mln/io/pbm/load.hh
@@ -131,6 +131,7 @@ namespace mln
inline
image2d<bool> load(const std::string& filename)
{
+ trace::entering("mln::io::pbm::load");
std::ifstream file(filename.c_str());
if (! file)
{
@@ -148,6 +149,9 @@ namespace mln
else
if (type == '1')
internal::load_ascii(file, ima);
+
+ trace::exiting("mln::io::pbm::load");
+
return ima;
}
diff --git a/milena/mln/io/pbm/save.hh b/milena/mln/io/pbm/save.hh
index eeb0580..93d4485 100644
--- a/milena/mln/io/pbm/save.hh
+++ b/milena/mln/io/pbm/save.hh
@@ -119,8 +119,10 @@ namespace mln
inline
void save(const Image<I>& ima, const std::string& filename)
{
+ trace::entering("mln::io::pbm::save");
mln::metal::equal<mln_value(I), bool >::check();
impl::save_(exact(ima), filename);
+ trace::exiting("mln::io::pbm::save");
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/io/pfm/load.hh b/milena/mln/io/pfm/load.hh
index 9ddaed2..35f5e54 100644
--- a/milena/mln/io/pfm/load.hh
+++ b/milena/mln/io/pfm/load.hh
@@ -143,6 +143,8 @@ namespace mln
inline
image2d<float> load(const std::string& filename)
{
+ trace::entering("mln::io::pfm::load");
+
std::ifstream file(filename.c_str());
if (! file)
{
@@ -155,6 +157,9 @@ namespace mln
image2d<float> ima(nrows, ncols);
internal::load_raw_2d(file, ima);
+
+ trace::exiting("mln::io::pfm::load");
+
return ima;
}
diff --git a/milena/mln/io/pfm/save.hh b/milena/mln/io/pfm/save.hh
index 7223b38..486639e 100644
--- a/milena/mln/io/pfm/save.hh
+++ b/milena/mln/io/pfm/save.hh
@@ -108,8 +108,10 @@ namespace mln
inline
void save(const Image<I>& ima, const std::string& filename)
{
+ trace::entering("mln::io::pfm::save");
mln::metal::equal<mln_value(I), float >::check();
impl::save_(exact(ima), filename);
+ trace::exiting("mln::io::pfm::save");
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/io/pgm/load.hh b/milena/mln/io/pgm/load.hh
index cbe7e05..e7df29e 100644
--- a/milena/mln/io/pgm/load.hh
+++ b/milena/mln/io/pgm/load.hh
@@ -85,7 +85,10 @@ namespace mln
inline
image2d<V> load(const std::string& filename)
{
- return io::pnm::load<V>(PGM, filename);
+ trace::entering("mln::io::pgm::load");
+ image2d<V> ima = io::pnm::load<V>(PGM, filename);
+ trace::exiting("mln::io::pgm::load");
+ return ima;
}
template <typename I>
@@ -93,7 +96,9 @@ namespace mln
void load(Image<I>& ima,
const std::string& filename)
{
+ trace::entering("mln::io::pgm::load");
io::pnm::load<I>(PGM, ima, filename);
+ trace::exiting("mln::io::pgm::load");
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/io/pgm/save.hh b/milena/mln/io/pgm/save.hh
index d5d368b..b02576d 100644
--- a/milena/mln/io/pgm/save.hh
+++ b/milena/mln/io/pgm/save.hh
@@ -83,8 +83,9 @@ namespace mln
// mln::metal::templated_by<mln_value(I), value::int_u >,
// mln::metal::templated_by<mln_value(I), value::int_u_sat >
// >::check();
-
+ trace::entering("mln::io::pgm::save");
io::pnm::save(PGM, exact(ima), filename);
+ trace::exiting("mln::io::pgm::save");
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/io/pnm/load.hh b/milena/mln/io/pnm/load.hh
index be491e3..d2c2f6b 100644
--- a/milena/mln/io/pnm/load.hh
+++ b/milena/mln/io/pnm/load.hh
@@ -159,6 +159,8 @@ namespace mln
inline
image2d<V> load(char type_, const std::string& filename)
{
+ trace::entering("mln::io::pnm::load");
+
std::ifstream file(filename.c_str());
if (! file)
{
@@ -191,8 +193,10 @@ namespace mln
else
if (type == (type_ - 3))
pnm::load_ascii(file, ima);
- return ima;
+ trace::entering("mln::io::pnm::load");
+
+ return ima;
}
/// An other way to load pnm files :
@@ -204,6 +208,8 @@ namespace mln
Image<I>& ima_,
const std::string& filename)
{
+ trace::entering("mln::io::pnm::load");
+
std::ifstream file(filename.c_str());
if (! file)
{
@@ -240,6 +246,7 @@ namespace mln
if (type == (type_ - 3))
pnm::load_ascii(file, ima);
+ trace::exiting("mln::io::pnm::load");
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/io/pnm/save.hh b/milena/mln/io/pnm/save.hh
index eadd618..b09465c 100644
--- a/milena/mln/io/pnm/save.hh
+++ b/milena/mln/io/pnm/save.hh
@@ -177,12 +177,14 @@ namespace mln
inline
void save(const int type, const Image<I>& ima_, const std::string&
filename)
{
+ trace::entering("mln::io::pnm::save");
const I& ima = exact(ima_);
std::ofstream file(filename.c_str());
io::pnm::save_header(type, ima, filename, file);
impl::save_data_(file,
mln_trait_image_speed(I)(), ima);
+ trace::exiting("mln::io::pnm::save");
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/io/ppm/load.hh b/milena/mln/io/ppm/load.hh
index dc2ee4d..f97700b 100644
--- a/milena/mln/io/ppm/load.hh
+++ b/milena/mln/io/ppm/load.hh
@@ -82,7 +82,10 @@ namespace mln
inline
image2d<V> load(const std::string& filename)
{
- return io::pnm::load<V>(PPM, filename);
+ trace::entering("mln::io::ppm::load");
+ image2d<V> ima = io::pnm::load<V>(PPM, filename);
+ trace::exiting("mln::io::ppm::load");
+ return ima;
}
template <typename I>
@@ -90,7 +93,9 @@ namespace mln
void load(Image<I>& ima,
const std::string& filename)
{
+ trace::entering("mln::io::ppm::load");
io::pnm::load<I>(PPM, ima, filename);
+ trace::exiting("mln::io::ppm::load");
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/level/fill_with_image.spe.hh
b/milena/mln/level/fill_with_image.spe.hh
index 6084e72..036a7a0 100644
--- a/milena/mln/level/fill_with_image.spe.hh
+++ b/milena/mln/level/fill_with_image.spe.hh
@@ -88,7 +88,7 @@ namespace mln
pi.val() = d.val();
d.next();
}
- trace::entering("level::impl::fill_with_image_fast");
+ trace::exiting("level::impl::fill_with_image_fast");
}
@@ -108,7 +108,7 @@ namespace mln
for_all(pi)
pi.val() = data.val();
- trace::entering("level::impl::fill_with_image_fast_singleton");
+ trace::exiting("level::impl::fill_with_image_fast_singleton");
}
} // end of namespace mln::level::impl
diff --git a/milena/mln/morpho/erosion.spe.hh b/milena/mln/morpho/erosion.spe.hh
index e309c83..324cfa2 100644
--- a/milena/mln/morpho/erosion.spe.hh
+++ b/milena/mln/morpho/erosion.spe.hh
@@ -1199,10 +1199,12 @@ namespace mln
erosion_dispatch_for_generic(const I& input, const W& win) // Entry point.
{
trace::entering("morpho::erosion_dispatch_for_generic");
- return erosion_dispatch_for_generic(mln_trait_image_kind(I)(),
- mln_trait_image_speed(I)(),
- input, win);
+ mln_concrete(I) ima =
+ erosion_dispatch_for_generic(mln_trait_image_kind(I)(),
+ mln_trait_image_speed(I)(),
+ input, win);
trace::entering("morpho::erosion_dispatch_for_generic");
+ return ima;
}
@@ -1249,8 +1251,9 @@ namespace mln
erosion_dispatch_for_arbitrary(const I& input, const W& win)
{
trace::entering("morpho::erosion_dispatch_for_arbitrary");
- return erosion_dispatch_for_arbitrary(mln_trait_image_speed(I)(),
- input, win);
+ mln_concrete(I) ima =
+ erosion_dispatch_for_arbitrary(mln_trait_image_speed(I)(),
+ input, win);
trace::exiting("morpho::erosion_dispatch_for_arbitrary");
}
@@ -1279,9 +1282,11 @@ namespace mln
erosion_dispatch_for_directional(const I& input, const W& win, unsigned
dir)
{
trace::entering("morpho::erosion_dispatch_for_directional");
- return erosion_dispatch_for_directional(mln_trait_image_speed(I)(),
- input, win, dir);
+ mln_concrete(I) ima =
+ erosion_dispatch_for_directional(mln_trait_image_speed(I)(),
+ input, win, dir);
trace::exiting("morpho::erosion_dispatch_for_directional");
+ return ima;
}
@@ -1308,9 +1313,11 @@ namespace mln
erosion_dispatch_for_diagonal2d(const I& input, const W& win)
{
trace::entering("morpho::erosion_dispatch_for_diagonal2d");
- return erosion_dispatch_for_diagonal2d(mln_trait_image_speed(I)(),
- input, win);
+ mln_concrete(I) ima =
+ erosion_dispatch_for_diagonal2d(mln_trait_image_speed(I)(),
+ input, win);
trace::exiting("morpho::erosion_dispatch_for_diagonal2d");
+ return ima;
}
@@ -1337,9 +1344,11 @@ namespace mln
erosion_dispatch_for_backdiagonal2d(const I& input, const W& win)
{
trace::entering("morpho::erosion_dispatch_for_backdiagonal2d");
- return erosion_dispatch_for_backdiagonal2d(mln_trait_image_speed(I)(),
- input, win);
+ mln_concrete(I) ima =
+ erosion_dispatch_for_backdiagonal2d(mln_trait_image_speed(I)(),
+ input, win);
trace::exiting("morpho::erosion_dispatch_for_backdiagonal2d");
+ return ima;
}
// dispatch w.r.t. win
--
1.5.6.5