Commit 6e407cc7 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Add missing traces in basic routines in geom/* (ticket #49).

	* mln/geom/bbox.hh,
	* mln/geom/max_col.hh,
	* mln/geom/max_ind.hh,
	* mln/geom/max_row.hh,
	* mln/geom/max_sli.hh,
	* mln/geom/min_col.hh,
	* mln/geom/min_ind.hh,
	* mln/geom/min_row.hh,
	* mln/geom/min_sli.hh,
	* mln/geom/ncols.hh,
	* mln/geom/ninds.hh,
	* mln/geom/nrows.hh,
	* mln/geom/nslis.hh: add missing traces.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3455 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 580e2bc0
2009-03-02 Guillaume Lazzara <lazzara@lrde.epita.fr>
Add missing traces in basic routines in geom/* (ticket #49).
* mln/geom/bbox.hh,
* mln/geom/max_col.hh,
* mln/geom/max_ind.hh,
* mln/geom/max_row.hh,
* mln/geom/max_sli.hh,
* mln/geom/min_col.hh,
* mln/geom/min_ind.hh,
* mln/geom/min_row.hh,
* mln/geom/min_sli.hh,
* mln/geom/ncols.hh,
* mln/geom/ninds.hh,
* mln/geom/nrows.hh,
* mln/geom/nslis.hh: add missing traces.
2009-03-02 Guillaume Lazzara <lazzara@lrde.epita.fr>
 
Cleanup scribo sandbox.
......@@ -135,27 +135,41 @@ namespace mln
template <typename I>
box<mln_site(I)> bbox(const Image<I>& ima_)
{
trace::entering("geom::bbox");
const I& ima = exact(ima_);
mln_precondition(ima.is_valid());
return geom::bbox(ima.domain());
box<mln_site(I)> b = geom::bbox(ima.domain());
trace::exiting("geom::bbox");
return b;
}
template <typename W>
box<mln_psite(W)> bbox(const Window<W>& win)
{
trace::entering("geom::bbox");
typedef mln_psite(W) P;
accu::bbox<P> b;
P O = literal::origin;
mln_qiter(W) q(exact(win), O);
for_all(q)
b.take(q);
trace::exiting("geom::bbox");
return b;
}
template <typename W>
box<mln_psite(W)> bbox(const Weighted_Window<W>& win)
{
return bbox(exact(win).win());
trace::entering("geom::bbox");
box<mln_psite(W)> b = bbox(exact(win).win());
trace::exiting("geom::bbox");
return b;
}
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......@@ -57,8 +57,13 @@ namespace mln
inline
mln_deduce(I, site, coord) max_col(const Image<I>& ima)
{
trace::entering("mln::geom::max_col");
mln_precondition(exact(ima).is_valid());
return geom::bbox(ima).pmax().col();
mln_deduce(I, site, coord) maxcol = geom::bbox(ima).pmax().col();
trace::exiting("mln::geom::max_col");
return maxcol;
}
......@@ -66,8 +71,13 @@ namespace mln
inline
mln_deduce(B, point, coord) max_col(const Box<B>& b)
{
trace::entering("mln::geom::max_col");
metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check();
return exact(b).pmax().col();
mln_deduce(B, point, coord) maxcol = exact(b).pmax().col();
trace::exiting("mln::geom::max_col");
return maxcol;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......@@ -53,8 +53,13 @@ namespace mln
inline
mln_deduce(I, site, coord) max_ind(const Image<I>& ima)
{
trace::entering("mln::geom::max_ind");
mln_precondition(exact(ima).is_valid());
return exact(ima).bbox().pmax().ind();
mln_deduce(I, site, coord) maxind = exact(ima).bbox().pmax().ind();
trace::exiting("mln::geom::max_ind");
return maxind;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......@@ -58,8 +58,13 @@ namespace mln
inline
mln_deduce(I, site, coord) max_row(const Image<I>& ima)
{
trace::entering("mln::geom::max_row");
mln_precondition(exact(ima).is_valid());
return geom::bbox(ima).pmax().row();
mln_deduce(I, site, coord) maxrow = geom::bbox(ima).pmax().row();
trace::exiting("mln::geom::max_row");
return maxrow;
}
......@@ -67,8 +72,13 @@ namespace mln
inline
mln_deduce(B, point, coord) max_row(const Box<B>& b)
{
trace::entering("mln::geom::max_row");
metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check();
return exact(b).pmax().row();
mln_deduce(B, point, coord) maxrow = exact(b).pmax().row();
trace::exiting("mln::geom::max_row");
return maxrow;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......@@ -53,8 +53,13 @@ namespace mln
inline
mln_deduce(I, site, coord) max_sli(const Image<I>& ima)
{
trace::entering("mln::geom::max_sli");
mln_precondition(exact(ima).is_valid());
return exact(ima).bbox().pmax().sli();
mln_deduce(I, site, coord) maxsli = exact(ima).bbox().pmax().sli();
trace::exiting("mln::geom::max_sli");
return maxsli;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......@@ -58,8 +58,13 @@ namespace mln
inline
mln_deduce(I, site, coord) min_col(const Image<I>& ima)
{
trace::entering("mln::geom::min_col");
mln_precondition(exact(ima).is_valid());
return geom::bbox(ima).pmin().col();
mln_deduce(I, site, coord) mincol = geom::bbox(ima).pmin().col();
trace::exiting("mln::geom::min_col");
return mincol;
}
......@@ -67,8 +72,13 @@ namespace mln
inline
mln_deduce(B, point, coord) min_col(const Box<B>& b)
{
trace::entering("mln::geom::min_col");
metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check();
return exact(b).pmin().col();
mln_deduce(B, point, coord) mincol = exact(b).pmin().col();
trace::exiting("mln::geom::min_col");
return mincol;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......@@ -53,8 +53,13 @@ namespace mln
inline
mln_deduce(I, site, coord) min_ind(const Image<I>& ima)
{
trace::entering("mln::geom::min_ind");
mln_precondition(exact(ima).is_valid());
return exact(ima).bbox().pmin().ind();
mln_deduce(I, site, coord) minind = exact(ima).bbox().pmin().ind();
trace::exiting("mln::geom::min_ind");
return minind;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......@@ -61,8 +61,13 @@ namespace mln
inline
mln_deduce(I, site, coord) min_row(const Image<I>& ima)
{
trace::entering("mln::geom::min_row");
mln_precondition(exact(ima).is_valid());
return geom::bbox(ima).pmin().row();
mln_deduce(I, site, coord) minrow = geom::bbox(ima).pmin().row();
trace::exiting("mln::geom::min_row");
return minrow;
}
......@@ -70,8 +75,13 @@ namespace mln
inline
mln_deduce(B, point, coord) min_row(const Box<B>& b)
{
trace::entering("mln::geom::min_row");
metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check();
return exact(b).pmin().row();
mln_deduce(B, point, coord) minrow = exact(b).pmin().row();
trace::exiting("mln::geom::min_row");
return minrow;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......@@ -53,8 +53,13 @@ namespace mln
inline
mln_deduce(I, site, coord) min_sli(const Image<I>& ima)
{
trace::entering("mln::geom::min_sli");
mln_precondition(exact(ima).is_valid());
return exact(ima).bbox().pmin().sli();
mln_deduce(I, site, coord) minsli = exact(ima).bbox().pmin().sli();
trace::exiting("mln::geom::min_sli");
return minsli;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -28,10 +28,9 @@
#ifndef MLN_GEOM_NCOLS_HH
# define MLN_GEOM_NCOLS_HH
/*! \file mln/geom/ncols.hh
*
* \brief Give the number of columns of an image.
*/
/// \file mln/geom/ncols.hh
///
/// Give the number of columns of an image.
# include <mln/geom/min_col.hh>
# include <mln/geom/max_col.hh>
......@@ -58,16 +57,26 @@ namespace mln
inline
unsigned ncols(const Image<I>& ima)
{
trace::entering("mln::geom::ncols");
mln_precondition(exact(ima).is_valid());
return geom::max_col(ima) - geom::min_col(ima) + 1;
unsigned ncols = geom::max_col(ima) - geom::min_col(ima) + 1;
trace::exiting("mln::geom::ncols");
return ncols;
}
template <typename B>
unsigned ncols(const Box<B>& b)
{
trace::entering("mln::geom::ncols");
metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check();
return geom::max_col(b) - geom::min_col(b) + 1;
unsigned ncols = geom::max_col(b) - geom::min_col(b) + 1;
trace::exiting("mln::geom::ncols");
return ncols;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......@@ -54,8 +54,13 @@ namespace mln
inline
unsigned ninds(const Image<I>& ima)
{
trace::entering("mln::geom::ninds");
mln_precondition(exact(ima).is_valid());
return geom::max_ind(ima) - geom::min_ind(ima) + 1;
unsigned ninds = geom::max_ind(ima) - geom::min_ind(ima) + 1;
trace::exiting("mln::geom::ninds");
return ninds;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -28,10 +28,9 @@
#ifndef MLN_GEOM_NROWS_HH
# define MLN_GEOM_NROWS_HH
/*! \file mln/geom/nrows.hh
*
* \brief Give the number of rows of an image.
*/
/// \file mln/geom/nrows.hh
///
/// Give the number of rows of an image.
# include <mln/geom/min_row.hh>
# include <mln/geom/max_row.hh>
......@@ -58,15 +57,25 @@ namespace mln
inline
unsigned nrows(const Image<I>& ima)
{
trace::entering("mln::geom::nrows");
mln_precondition(exact(ima).is_valid());
return geom::max_row(ima) - geom::min_row(ima) + 1;
unsigned nrows = geom::max_row(ima) - geom::min_row(ima) + 1;
trace::exiting("mln::geom::nrows");
return nrows;
}
template <typename B>
unsigned nrows(const Box<B>& b)
{
trace::entering("mln::geom::nrows");
metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check();
return geom::max_row(b) - geom::min_row(b) + 1;
unsigned nrows = geom::max_row(b) - geom::min_row(b) + 1;
trace::exiting("mln::geom::nrows");
return nrows;
}
# endif // ! MLN_INCLUDE_ONLY
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
......@@ -28,10 +28,9 @@
#ifndef MLN_GEOM_NSLIS_HH
# define MLN_GEOM_NSLIS_HH
/*! \file mln/geom/nslis.hh
*
* \brief Give the number of slices of an image.
*/
/// \file mln/geom/nslis.hh
///
/// Give the number of slices of an image.
# include <mln/geom/min_sli.hh>
# include <mln/geom/max_sli.hh>
......@@ -54,8 +53,13 @@ namespace mln
inline
unsigned nslis(const Image<I>& ima)
{
trace::entering("mln::geom::nslis");
mln_precondition(exact(ima).is_valid());
return geom::max_sli(ima) - geom::min_sli(ima) + 1;
unsigned nslis = geom::max_sli(ima) - geom::min_sli(ima) + 1;
trace::exiting("mln::geom::nslis");
return nslis;
}
# endif // ! MLN_INCLUDE_ONLY
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment