https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
Portability fix.
Partially fix portability problem due to wrong cast
of size_t to unsigned:
* mln/histo/data.hh,
* mln/debug/println_with_border.spe.hh,
* mln/core/image/translate_image.hh,
* mln/draw/graph.hh,
* mln/level/all.hh,
* mln/accu/count_adjacent_vertices.hh,
* mln/accu/count.hh,
* mln/accu/min_h.hh,
* mln/accu/rank.hh,
* mln/accu/max_h.hh,
* mln/accu/median_alt.hh,
* mln/accu/median_h.hh,
* mln/accu/volume.hh,
* mln/accu/height.hh,
* mln/border/fill.hh,
* mln/border/duplicate.hh,
* mln/border/mirror.hh,
* mln/geom/resize.hh,
* mln/morpho/closing_volume.hh,
* mln/morpho/closing_area.hh,
* mln/morpho/closing_height.hh,
* mln/morpho/opening_area_on_vertices.hh,
* mln/morpho/opening_volume.hh,
* mln/morpho/closing_area_on_vertices.hh,
* mln/morpho/opening_height.hh,
* mln/morpho/opening_area.hh: Remove wrong use of std::size_t.
accu/count.hh | 12 ++---
accu/count_adjacent_vertices.hh | 12 ++---
accu/height.hh | 12 ++---
accu/max_h.hh | 4 -
accu/median_alt.hh | 4 -
accu/median_h.hh | 4 -
accu/min_h.hh | 4 -
accu/rank.hh | 4 -
accu/volume.hh | 14 +++---
border/duplicate.hh | 77
++++++++++++++++++-------------------
border/fill.hh | 16 +++----
border/mirror.hh | 54 ++++++++++++-------------
core/image/translate_image.hh | 1
debug/println_with_border.spe.hh | 24 +++++------
draw/graph.hh | 8 +--
geom/resize.hh | 30 +++++++-------
histo/data.hh | 26 ++++++------
level/all.hh | 1
morpho/closing_area.hh | 8 +--
morpho/closing_area_on_vertices.hh | 4 -
morpho/closing_height.hh | 4 -
morpho/closing_volume.hh | 6 +-
morpho/opening_area.hh | 4 -
morpho/opening_area_on_vertices.hh | 4 -
morpho/opening_height.hh | 4 -
morpho/opening_volume.hh | 4 -
26 files changed, 171 insertions(+), 174 deletions(-)
Index: mln/histo/data.hh
--- mln/histo/data.hh (revision 2741)
+++ mln/histo/data.hh (working copy)
@@ -57,20 +57,20 @@
void clear();
- std::size_t operator()(const T& v) const;
- std::size_t& operator()(const T& v);
+ unsigned operator()(const T& v) const;
+ unsigned& operator()(const T& v);
- const std::vector<std::size_t>& vect() const;
+ const std::vector<unsigned>& vect() const;
const mln::value::set<T>& vset() const;
- std::size_t operator[](unsigned i) const;
- std::size_t& operator[](unsigned i);
+ unsigned operator[](unsigned i) const;
+ unsigned& operator[](unsigned i);
- std::size_t nvalues() const;
+ unsigned nvalues() const;
protected:
const mln::value::set<T>& s_;
- std::vector<std::size_t> h_;
+ std::vector<unsigned> h_;
};
@@ -100,7 +100,7 @@
template <typename T>
inline
- std::size_t
+ unsigned
data<T>::operator()(const T& v) const
{
return h_[s_.index_of(v)];
@@ -108,7 +108,7 @@
template <typename T>
inline
- std::size_t&
+ unsigned&
data<T>::operator()(const T& v)
{
return h_[s_.index_of(v)];
@@ -124,7 +124,7 @@
template <typename T>
inline
- std::size_t
+ unsigned
data<T>::operator[](unsigned i) const
{
mln_precondition(i < s_.nvalues());
@@ -133,7 +133,7 @@
template <typename T>
inline
- std::size_t&
+ unsigned&
data<T>::operator[](unsigned i)
{
mln_precondition(i < s_.nvalues());
@@ -142,7 +142,7 @@
template <typename T>
inline
- const std::vector<std::size_t>&
+ const std::vector<unsigned>&
data<T>::vect() const
{
return h_;
@@ -150,7 +150,7 @@
template <typename T>
inline
- std::size_t data<T>::nvalues() const
+ unsigned data<T>::nvalues() const
{
return h_.size();
}
Index: mln/debug/println_with_border.spe.hh
--- mln/debug/println_with_border.spe.hh (revision 2741)
+++ mln/debug/println_with_border.spe.hh (working copy)
@@ -60,7 +60,7 @@
void
println_with_border(const box2d& b, const I& input)
{
- const std::size_t ncols = b.ncols() + 2 * input.border();
+ const unsigned ncols = b.ncols() + 2 * input.border();
for (size_t i = 0; i < input.nelements(); i++)
{
std::cout << format(input.buffer()[i]) << ' ';
@@ -81,20 +81,20 @@
{
typedef mln_psite(I) P;
- std::size_t len_s = b.len(P::dim - 3);
- std::size_t len_r = b.len(P::dim - 2);
- std::size_t len_c = b.len(P::dim - 1);
-
- std::size_t border = input.border();
- std::size_t real_len_s = len_s + 2 * border;
- std::size_t real_len_c = len_c + 2 * border;
- std::size_t real_len_r = len_r + 2 * border;
+ unsigned len_s = b.len(P::dim - 3);
+ unsigned len_r = b.len(P::dim - 2);
+ unsigned len_c = b.len(P::dim - 1);
+
+ unsigned border = input.border();
+ unsigned real_len_s = len_s + 2 * border;
+ unsigned real_len_c = len_c + 2 * border;
+ unsigned real_len_r = len_r + 2 * border;
- for (std::size_t k = 0; k < real_len_s; ++k)
+ for (unsigned k = 0; k < real_len_s; ++k)
{
- for (std::size_t j = 0; j < real_len_r; ++j)
+ for (unsigned j = 0; j < real_len_r; ++j)
{
- for (std::size_t i = 0; i < real_len_c; ++i)
+ for (unsigned i = 0; i < real_len_c; ++i)
std::cout << format(input[k * (real_len_r * real_len_c) + j *
real_len_c + i])
<< ' ';
std::cout << std::endl;
Index: mln/core/image/translate_image.hh
--- mln/core/image/translate_image.hh (revision 2741)
+++ mln/core/image/translate_image.hh (working copy)
@@ -37,7 +37,6 @@
# include <mln/core/internal/image_identity.hh>
# include <mln/core/alias/box2d.hh>
-# include <mln/core/line_piter.hh>
namespace mln
Index: mln/draw/graph.hh
--- mln/draw/graph.hh (revision 2741)
+++ mln/draw/graph.hh (working copy)
@@ -95,7 +95,7 @@
// Draw the background.
level::fill(ima, 0);
// Draw the lines (edges).
- for (size_t l = 0; l < pg.nedges(); ++l)
+ for (unsigned l = 0; l < pg.nedges(); ++l)
line (exact(ima),
// FIXME: Too low-level. See similar remarks
// in mln/core/image/graph_image.hh
@@ -103,7 +103,7 @@
pg.gr_->vertex_data(pg.gr_->edge(l).v2()),
edge_v);
// Draw the points (vertices).
- for (size_t p = 0; p < pg.nsites(); ++p)
+ for (unsigned p = 0; p < pg.nsites(); ++p)
exact(ima)(pg.gr_->vertex_data(p)) = vertex_v;
}
@@ -116,10 +116,10 @@
// Draw the background.
level::fill(ima, 0);
// Draw the lines (edges).
- for (size_t l = 0; l < gi.domain().nedges(); ++l)
+ for (unsigned l = 0; l < gi.domain().nedges(); ++l)
line (exact(ima), gi.vertex1(l), gi.vertex2(l), edge_v);
// Draw the points (vertices).
- for (size_t p = 0; p < gi.domain().nvertices(); ++p)
+ for (unsigned p = 0; p < gi.domain().nvertices(); ++p)
exact(ima)(gi.domain().point_from_id(p)) = gi.vertex_values()[p];
}
Index: mln/level/all.hh
--- mln/level/all.hh (revision 2741)
+++ mln/level/all.hh (working copy)
@@ -70,7 +70,6 @@
# include <mln/level/saturate.hh>
# include <mln/level/sort_psites.hh>
# include <mln/level/stretch.hh>
-# include <mln/level/take.hh>
# include <mln/level/to_enc.hh>
# include <mln/level/transform.hh>
# include <mln/level/was.median.hh>
Index: mln/accu/count_adjacent_vertices.hh
--- mln/accu/count_adjacent_vertices.hh (revision 2741)
+++ mln/accu/count_adjacent_vertices.hh (working copy)
@@ -54,7 +54,7 @@
/// mln::opening_area_on_vertices.
template <typename P, typename V>
struct count_adjacent_vertices
- : public mln::accu::internal::base< std::size_t,
+ : public mln::accu::internal::base< unsigned,
count_adjacent_vertices<P, V> >
{
typedef mln::util::pix< mln::line_graph_image<P, V> > argument;
@@ -68,11 +68,11 @@
void take(const count_adjacent_vertices<P, V>& other);
/// Force the value of the counter to \a c.
- void set_value(std::size_t c);
+ void set_value(unsigned c);
/// \}
/// Get the value of the accumulator.
- std::size_t to_result() const;
+ unsigned to_result() const;
protected:
/// Update the value of the counter.
@@ -80,7 +80,7 @@
protected:
/// The value of the counter.
- std::size_t count__;
+ unsigned count__;
/// The set of adjacent vertices.
std::set<util::vertex_id> vertices_;
};
@@ -142,7 +142,7 @@
template <typename P, typename V>
inline
- std::size_t
+ unsigned
count_adjacent_vertices<P, V>::to_result() const
{
return count__;
@@ -151,7 +151,7 @@
template <typename P, typename V>
inline
void
- count_adjacent_vertices<P, V>::set_value(std::size_t c)
+ count_adjacent_vertices<P, V>::set_value(unsigned c)
{
count__ = c;
/// Reset the other member.
Index: mln/accu/count.hh
--- mln/accu/count.hh (revision 2741)
+++ mln/accu/count.hh (working copy)
@@ -43,7 +43,7 @@
/// \brief Generic counter accumulator class.
/// The parameter \a T is the type to be count.
template <typename T>
- struct count : public mln::accu::internal::base< std::size_t ,
count<T> >
+ struct count : public mln::accu::internal::base< unsigned , count<T> >
{
typedef T argument;
@@ -56,11 +56,11 @@
void take(const count<T>& other);
/// Force the value of the counter to \a c.
- void set_value(std::size_t c);
+ void set_value(unsigned c);
/// \}
/// Get the value of the accumulator.
- std::size_t to_result() const;
+ unsigned to_result() const;
/// Check whether this accu is able to return a result.
/// Always true here.
@@ -68,7 +68,7 @@
protected:
/// The value of the counter.
- std::size_t count_;
+ unsigned count_;
};
namespace meta
@@ -122,7 +122,7 @@
template <typename T>
inline
- std::size_t
+ unsigned
count<T>::to_result() const
{
return count_;
@@ -131,7 +131,7 @@
template <typename T>
inline
void
- count<T>::set_value(std::size_t c)
+ count<T>::set_value(unsigned c)
{
count_ = c;
}
Index: mln/accu/min_h.hh
--- mln/accu/min_h.hh (revision 2741)
+++ mln/accu/min_h.hh (working copy)
@@ -83,9 +83,9 @@
mutable accu::histo<V> h_;
const value::set<V>& s_; // derived from h_
- mutable std::size_t sum_;
+ mutable unsigned sum_;
mutable bool valid_;
- mutable std::size_t i_; // the min index
+ mutable unsigned i_; // the min index
mutable argument t_; // the min value
// Auxiliary methods
Index: mln/accu/rank.hh
--- mln/accu/rank.hh (revision 2741)
+++ mln/accu/rank.hh (working copy)
@@ -88,10 +88,10 @@
mutable accu::histo<T> h_;
const S& s_; // derived from h_
- mutable std::size_t sum_minus_, sum_plus_;
+ mutable unsigned sum_minus_, sum_plus_;
mutable bool valid_;
- mutable std::size_t i_; // the median index
+ mutable unsigned i_; // the median index
mutable argument t_; // the median value
// Auxiliary methods
Index: mln/accu/max_h.hh
--- mln/accu/max_h.hh (revision 2741)
+++ mln/accu/max_h.hh (working copy)
@@ -82,9 +82,9 @@
mutable accu::histo<V> h_;
const value::set<V>& s_; // derived from h_
- mutable std::size_t sum_;
+ mutable unsigned sum_;
mutable bool valid_;
- mutable std::size_t i_; // the max index
+ mutable unsigned i_; // the max index
mutable argument t_; // the max argument
// Auxiliary methods
Index: mln/accu/median_alt.hh
--- mln/accu/median_alt.hh (revision 2741)
+++ mln/accu/median_alt.hh (working copy)
@@ -83,10 +83,10 @@
/// derived from h_
const S& s_;
- std::size_t sum_minus_, sum_plus_;
+ unsigned sum_minus_, sum_plus_;
/// the median index
- std::size_t i_;
+ unsigned i_;
/// the median argument
argument t_;
Index: mln/accu/median_h.hh
--- mln/accu/median_h.hh (revision 2741)
+++ mln/accu/median_h.hh (working copy)
@@ -79,10 +79,10 @@
mutable accu::histo<V> h_;
const value::set<V>& s_; // derived from h_
- mutable std::size_t sum_minus_, sum_plus_;
+ mutable unsigned sum_minus_, sum_plus_;
mutable bool valid_;
- mutable std::size_t i_; // the median_h index
+ mutable unsigned i_; // the median_h index
mutable argument t_; // the median_h value
// Auxiliary methods
Index: mln/accu/volume.hh
--- mln/accu/volume.hh (revision 2741)
+++ mln/accu/volume.hh (working copy)
@@ -58,7 +58,7 @@
/// of pixels is built.
template <typename I>
struct volume
- : public mln::accu::internal::base< std::size_t , volume<I> >
+ : public mln::accu::internal::base< unsigned , volume<I> >
{
/// \brief The accumulated data type.
///
@@ -79,11 +79,11 @@
void take(const volume<I>& other);
/// Force the value of the counter to \a v.
- void set_value(std::size_t v);
+ void set_value(unsigned v);
/// \}
/// Get the value of the accumulator.
- std::size_t to_result() const;
+ unsigned to_result() const;
/// Check whether this accu is able to return a result.
/// Always true here.
@@ -93,9 +93,9 @@
/// The reference level (the level of the component's root).
value ref_level__;
/// The area of the component.
- std::size_t area__;
+ unsigned area__;
/// The volume of the component.
- std::size_t volume_;
+ unsigned volume_;
};
@@ -175,7 +175,7 @@
template <typename I>
inline
- std::size_t
+ unsigned
volume<I>::to_result() const
{
return volume_;
@@ -184,7 +184,7 @@
template <typename I>
inline
void
- volume<I>::set_value(std::size_t v)
+ volume<I>::set_value(unsigned v)
{
volume_ = v;
// Reset the other members.
Index: mln/accu/height.hh
--- mln/accu/height.hh (revision 2741)
+++ mln/accu/height.hh (working copy)
@@ -59,7 +59,7 @@
/// of pixels is built.
template <typename I>
struct height
- : public mln::accu::internal::base< std::size_t , height<I> >
+ : public mln::accu::internal::base< unsigned , height<I> >
{
/// \brief The accumulated data type.
///
@@ -80,11 +80,11 @@
void take(const height<I>& other);
/// Force the value of the counter to \a h.
- void set_value(std::size_t h);
+ void set_value(unsigned h);
/// \}
/// Get the value of the accumulator.
- std::size_t to_result() const;
+ unsigned to_result() const;
/// Check whether this accu is able to return a result.
/// Always true here.
@@ -96,7 +96,7 @@
/// The maximum level in the component.
value max_level__;
/// The height of the component.
- std::size_t height_;
+ unsigned height_;
};
@@ -156,7 +156,7 @@
template <typename I>
inline
- std::size_t
+ unsigned
height<I>::to_result() const
{
return height_;
@@ -165,7 +165,7 @@
template <typename I>
inline
void
- height<I>::set_value(std::size_t h)
+ height<I>::set_value(unsigned h)
{
height_ = h;
// Reset the other members.
Index: mln/border/fill.hh
--- mln/border/fill.hh (revision 2741)
+++ mln/border/fill.hh (working copy)
@@ -92,12 +92,12 @@
typedef mln_psite(I) P;
mln_box_runstart_piter(I) pl(ima.domain());
- std::size_t len_r = pl.run_length();
- std::size_t st = 0;
+ unsigned len_r = pl.run_length();
+ unsigned st = 0;
for_all (pl)
{
- std::size_t end = ima.index_of_point (pl);
+ unsigned end = ima.index_of_point (pl);
std::memset((void*)&ima.element(st),
*(const int*)(&v),
end - st);
@@ -122,17 +122,17 @@
typedef mln_psite(I) P;
mln_box_runstart_piter(I) pl(ima.domain());
- std::size_t len_r = pl.run_length();
- std::size_t st = 0;
+ unsigned len_r = pl.run_length();
+ unsigned st = 0;
for_all (pl)
{
- std::size_t end = ima.index_of_point (pl);
- for (std::size_t i = st; i < end; ++i)
+ unsigned end = ima.index_of_point (pl);
+ for (unsigned i = st; i < end; ++i)
(const_cast<I&>(ima)).element(i) = v;
st = end + len_r;
}
- for (std::size_t i = st; i < ima.nelements (); ++i)
+ for (unsigned i = st; i < ima.nelements (); ++i)
const_cast<I&>(ima).element(i) = v;
trace::exiting("border::impl::fill_size_n");
Index: mln/border/duplicate.hh
--- mln/border/duplicate.hh (revision 2741)
+++ mln/border/duplicate.hh (working copy)
@@ -35,7 +35,6 @@
# include <mln/core/concept/image.hh>
# include <mln/level/memset_.hh>
-# include <mln/core/line_piter.hh>
# include <mln/core/pixel.hh>
@@ -71,14 +70,14 @@
typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
- std::size_t len_c = exact(ima).bbox().len(P::dim - 1);
- std::size_t border = ima.border ();
+ unsigned len_c = exact(ima).bbox().len(P::dim - 1);
+ unsigned border = ima.border ();
- for (std::size_t i = 0; i < border; ++i)
+ for (unsigned i = 0; i < border; ++i)
const_cast<I&>(ima)[i] = ima[border];
- std::size_t st = border + len_c - 1;
- for (std::size_t i = st + 1; i < ima.nelements (); ++i)
+ unsigned st = border + len_c - 1;
+ for (unsigned i = st + 1; i < ima.nelements (); ++i)
const_cast<I&>(ima)[i] = ima[st];
trace::exiting("border::impl::duplicate_1d_");
@@ -92,34 +91,34 @@
typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
- std::size_t border = ima.border ();
- std::size_t border_2x = 2 * ima.border ();
- std::size_t len_c = exact(ima).bbox().len(1);
- std::size_t len_r = exact(ima).bbox().len(0);
- std::size_t real_len_c = len_c + border_2x;
- std::size_t st;
+ unsigned border = ima.border ();
+ unsigned border_2x = 2 * ima.border ();
+ unsigned len_c = exact(ima).bbox().len(1);
+ unsigned len_r = exact(ima).bbox().len(0);
+ unsigned real_len_c = len_c + border_2x;
+ unsigned st;
// Duplicate
for_all (pl)
{
st = ima.index_of_point (pl);
- for (std::size_t i = 1; i <= border; ++i)
+ for (unsigned i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
- for (std::size_t i = 1; i <= border; ++i)
+ for (unsigned i = 1; i <= border; ++i)
const_cast<I&>(ima)[st + i] = ima[st];
}
// Duplicate n first * border line
st = real_len_c * border;
- for (std::size_t k = 0; k < border; ++k)
- for (std::size_t i = 0; i < real_len_c; ++i)
+ for (unsigned k = 0; k < border; ++k)
+ for (unsigned i = 0; i < real_len_c; ++i)
const_cast<I&>(ima)[k * real_len_c + i] = ima[st + i];
// Duplicate n last * border line
st = real_len_c * (border + len_r - 1);
- for (std::size_t k = 1; k <= border; ++k)
- for (std::size_t i = st; i < st + real_len_c; ++i)
+ for (unsigned k = 1; k <= border; ++k)
+ for (unsigned i = st; i < st + real_len_c; ++i)
const_cast<I&>(ima)[k * real_len_c + i] = ima[i];
trace::exiting("border::impl::duplicate_2d_");
@@ -136,56 +135,56 @@
typedef mln_psite(I) P;
typename I::line_piter pl(ima.domain());
- std::size_t border = ima.border ();
- std::size_t border_2x = 2 * ima.border ();
- std::size_t len_c = exact(ima).bbox().len(P::dim - 1);
- std::size_t len_r = exact(ima).bbox().len(1);
- std::size_t len_s = exact(ima).bbox().len(0);
- std::size_t real_len_c = len_c + border_2x;
- std::size_t real_len_r = len_r + border_2x;
- std::size_t face = real_len_c * real_len_r;
- std::size_t st;
+ unsigned border = ima.border ();
+ unsigned border_2x = 2 * ima.border ();
+ unsigned len_c = exact(ima).bbox().len(P::dim - 1);
+ unsigned len_r = exact(ima).bbox().len(1);
+ unsigned len_s = exact(ima).bbox().len(0);
+ unsigned real_len_c = len_c + border_2x;
+ unsigned real_len_r = len_r + border_2x;
+ unsigned face = real_len_c * real_len_r;
+ unsigned st;
pl.start ();
- for (std::size_t k = 0; k < len_s; ++k)
+ for (unsigned k = 0; k < len_s; ++k)
{
// Duplicate
- for (std::size_t j = 0; j < len_r; ++j)
+ for (unsigned j = 0; j < len_r; ++j)
{
st = ima.index_of_point (pl);
- for (std::size_t i = 1; i <= border; ++i)
+ for (unsigned i = 1; i <= border; ++i)
const_cast<I&>(ima)[st - i] = ima[st];
st = st + len_c - 1;
- for (std::size_t i = 1; i <= border; ++i)
+ for (unsigned i = 1; i <= border; ++i)
const_cast<I&>(ima)[st + i] = ima[st];
pl.next ();
}
// Duplicate n last * border line
st = border * face + k * face + border * real_len_c ;
- for (std::size_t j = 1; j <= border; ++j)
- for (std::size_t i = 0; i < real_len_c; ++i)
+ for (unsigned j = 1; j <= border; ++j)
+ for (unsigned i = 0; i < real_len_c; ++i)
const_cast<I&>(ima)[st - j * real_len_c + i] = ima[st + i];
// Duplicate n last * border line
st = border * face + k * face + (len_r + border - 1) * real_len_c ;
- for (std::size_t j = 1; j <= border; ++j)
- for (std::size_t i = 0; i < real_len_c; ++i)
+ for (unsigned j = 1; j <= border; ++j)
+ for (unsigned i = 0; i < real_len_c; ++i)
const_cast<I&>(ima)[st + j * real_len_c + i] = ima[st + i];
}
// Duplicate n first * border face
st = border * face;
- for (std::size_t k = 0; k < border; ++k)
- for (std::size_t i = 0; i < face; ++i)
+ for (unsigned k = 0; k < border; ++k)
+ for (unsigned i = 0; i < face; ++i)
const_cast<I&>(ima)[k * face + i] = ima[st + i];
// Duplicate n last * border face
st = (len_s + border - 1) * face;
- for (std::size_t k = 1; k <= border; ++k)
- for (std::size_t i = 0; i < face; ++i)
+ for (unsigned k = 1; k <= border; ++k)
+ for (unsigned i = 0; i < face; ++i)
const_cast<I&>(ima)[st + k * face + i] = ima[st + i];
trace::exiting("border::impl::duplicate_3d_");
Index: mln/border/mirror.hh
--- mln/border/mirror.hh (revision 2741)
+++ mln/border/mirror.hh (working copy)
@@ -78,9 +78,9 @@
trace::entering("border::impl::mirror_");
I& ima = const_cast<I&>(ima_);
- std::size_t border = ima.border ();
- std::size_t nbinds = geom::ninds(ima);
- std::size_t min;
+ unsigned border = ima.border ();
+ unsigned nbinds = geom::ninds(ima);
+ unsigned min;
if (border > nbinds)
min = nbinds;
@@ -89,7 +89,7 @@
/// left border
{
- std::size_t i = 0;
+ unsigned i = 0;
for (; i < min; ++i)
ima.element(border - 1 - i) = ima(point1d(i));
@@ -99,7 +99,7 @@
/// right border
{
- std::size_t i = 0,
+ unsigned i = 0,
j = nbinds - 1;
for (;
i < min;
@@ -121,58 +121,58 @@
trace::entering("border::impl::mirror_");
I& ima = const_cast<I&>(ima_);
- std::size_t border = ima.border ();
- std::size_t nbrows = geom::max_row(ima) - geom::min_row(ima);
- std::size_t nbcols = geom::max_col(ima) - geom::min_col(ima);
- std::size_t real_nbcols = (nbcols + 1) + 2 * border;
- std::size_t start = real_nbcols * border + border;
- std::size_t s = start;
+ unsigned border = ima.border ();
+ unsigned nbrows = geom::max_row(ima) - geom::min_row(ima);
+ unsigned nbcols = geom::max_col(ima) - geom::min_col(ima);
+ unsigned real_nbcols = (nbcols + 1) + 2 * border;
+ unsigned start = real_nbcols * border + border;
+ unsigned s = start;
// mirror top left corner
- for (std::size_t i = 0; i < border; ++i)
- for (std::size_t j = 0; j < border; ++j)
+ for (unsigned i = 0; i < border; ++i)
+ for (unsigned j = 0; j < border; ++j)
ima.element(i * ((nbcols + 1) + 2 * border) + j) = ima.element(s);
// mirror top left corner
s = start + nbcols;
- for (std::size_t i = 0; i < border; ++i)
- for (std::size_t j = 1; j <= border; ++j)
+ for (unsigned i = 0; i < border; ++i)
+ for (unsigned j = 1; j <= border; ++j)
ima.element(i * ((nbcols + 1) + 2 * border) + (nbcols + border +
j)) = ima.element(s);
// mirror bottom left corner
s = start + (nbrows * real_nbcols);
- for (std::size_t i = 1; i <= border; ++i)
- for (std::size_t j = 1; j <= border; ++j)
+ for (unsigned i = 1; i <= border; ++i)
+ for (unsigned j = 1; j <= border; ++j)
ima.element(s - i + (j * (real_nbcols))) = ima.element(s);
// mirror bottom right corner
s = start + (nbrows * real_nbcols) + nbcols;
- for (std::size_t i = 1; i <= border; ++i)
- for (std::size_t j = 1; j <= border; ++j)
+ for (unsigned i = 1; i <= border; ++i)
+ for (unsigned j = 1; j <= border; ++j)
ima.element(s + i + (j * real_nbcols)) = ima.element(s);
// mirror top border
s = start;
- for (std::size_t i = 0; i <= nbcols; ++i)
- for (std::size_t j = 1; j <= border; ++j)
+ for (unsigned i = 0; i <= nbcols; ++i)
+ for (unsigned j = 1; j <= border; ++j)
ima.element(s + i - (j * real_nbcols)) = ima.element(s + i + ((j
- 1)* real_nbcols));
// mirror left border
s = start;
- for (std::size_t i = 0; i <= nbrows; ++i)
- for (std::size_t j = 1; j <= border; ++j)
+ for (unsigned i = 0; i <= nbrows; ++i)
+ for (unsigned j = 1; j <= border; ++j)
ima.element(s + (i * real_nbcols) - j) = ima.element(s + (i *
real_nbcols) + (j - 1));
// mirror right border
s = start;
- for (std::size_t i = 0; i <= nbrows; ++i)
- for (std::size_t j = 1; j <= border; ++j)
+ for (unsigned i = 0; i <= nbrows; ++i)
+ for (unsigned j = 1; j <= border; ++j)
ima.element(s + (i * real_nbcols + nbcols) + j) = ima.element(s +
(i * real_nbcols + nbcols) - (j - 1));
// mirror bottom border
s = start + (nbrows * real_nbcols);
- for (std::size_t i = 0; i <= nbcols; ++i)
- for (std::size_t j = 1; j <= border; ++j)
+ for (unsigned i = 0; i <= nbcols; ++i)
+ for (unsigned j = 1; j <= border; ++j)
ima.element(s + i + (j * real_nbcols)) = ima.element(s + i - ((j
- 1)* real_nbcols));
trace::exiting("border::impl::mirror_");
Index: mln/geom/resize.hh
--- mln/geom/resize.hh (revision 2741)
+++ mln/geom/resize.hh (working copy)
@@ -77,15 +77,15 @@
trace::entering("mln::geom::impl::resize_1d_");
typedef mln_value(I) V;
- std::size_t cols = input.bbox().len(0);
- std::size_t new_cols = (std::size_t)(ratio * cols);
+ unsigned cols = input.bbox().len(0);
+ unsigned new_cols = (unsigned)(ratio * cols);
- std::size_t n = (std::size_t)(1 / ratio);
+ unsigned n = (unsigned)(1 / ratio);
I output (new_cols);
level::fill(output, 0);
- for (std::size_t j = 0; j < cols; ++j)
+ for (unsigned j = 0; j < cols; ++j)
{
output(point1d(j / n)) += input(point1d(j));
if (!((j + 1) % n))
@@ -103,30 +103,30 @@
trace::entering("mln::geom::impl::resize_2d_");
typedef mln_sum(mln_value(I)) V;
- std::size_t rows = input.bbox().len(0);
- std::size_t cols = input.bbox().len(1);
- std::size_t new_rows = (std::size_t)(ratio * rows);
- std::size_t new_cols = (std::size_t)(ratio * cols);
+ unsigned rows = input.bbox().len(0);
+ unsigned cols = input.bbox().len(1);
+ unsigned new_rows = (unsigned)(ratio * rows);
+ unsigned new_cols = (unsigned)(ratio * cols);
- std::size_t n = (std::size_t)(1 / ratio);
- std::size_t nn = n * n;
+ unsigned n = (unsigned)(1 / ratio);
+ unsigned nn = n * n;
I output (new_rows, new_cols);
std::vector<V> v (new_cols);
- for (std::size_t i = 0; i < rows; ++i)
+ for (unsigned i = 0; i < rows; ++i)
{
- std::size_t in = i / n;
+ unsigned in = i / n;
if (!(i % n))
- for (std::size_t j = 0; j < new_cols; ++j)
+ for (unsigned j = 0; j < new_cols; ++j)
v[j] = 0;
- for (std::size_t j = 0; j < cols; ++j)
+ for (unsigned j = 0; j < cols; ++j)
v[j / n] += input(point2d(i, j));
if (!((i + 1) % n))
- for (std::size_t j = 0; j < cols; ++j)
+ for (unsigned j = 0; j < cols; ++j)
output(point2d(in, j / n)) = v[j / n] / nn;
}
Index: mln/morpho/closing_volume.hh
--- mln/morpho/closing_volume.hh (revision 2741)
+++ mln/morpho/closing_volume.hh (working copy)
@@ -46,11 +46,11 @@
/// Morphological volume closing.
template <typename I, typename N, typename O>
void closing_volume(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output);
+ unsigned lambda, Image<O>& output);
template <typename I, typename N>
mln_concrete(I)
- closing_volume(const Image<I>& input, const Neighborhood<N>& nbh,
std::size_t lambda)
+ closing_volume(const Image<I>& input, const Neighborhood<N>& nbh,
unsigned lambda)
{
mln_concrete(I) output;
initialize(output, input);
@@ -64,7 +64,7 @@
template <typename I, typename N, typename O>
inline
void closing_volume(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output)
+ unsigned lambda, Image<O>& output)
{
trace::entering("morpho::closing_volume");
mln_precondition(exact(output).domain() == exact(input).domain());
Index: mln/morpho/closing_area.hh
--- mln/morpho/closing_area.hh (revision 2741)
+++ mln/morpho/closing_area.hh (working copy)
@@ -46,11 +46,11 @@
/// Morphological area closing.
template <typename I, typename N, typename O>
void closing_area(const Image<I>& input, const Neighborhood<N>&
nbh,
- std::size_t lambda, Image<O>& output);
+ unsigned lambda, Image<O>& output);
template <typename I, typename N>
mln_concrete(I) closing_area(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda);
+ unsigned lambda);
# ifndef MLN_INCLUDE_ONLY
@@ -58,7 +58,7 @@
template <typename I, typename N, typename O>
inline
void closing_area(const Image<I>& input, const Neighborhood<N>&
nbh,
- std::size_t lambda, Image<O>& output)
+ unsigned lambda, Image<O>& output)
{
mln_precondition(exact(output).domain() == exact(input).domain());
typedef util::pix<I> pix_t;
@@ -68,7 +68,7 @@
template <typename I, typename N>
mln_concrete(I) closing_area(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda)
+ unsigned lambda)
{
mln_concrete(I) output;
initialize(output, input);
Index: mln/morpho/closing_height.hh
--- mln/morpho/closing_height.hh (revision 2741)
+++ mln/morpho/closing_height.hh (working copy)
@@ -44,7 +44,7 @@
/// Morphological height closing.
template <typename I, typename N, typename O>
void closing_height(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output);
+ unsigned lambda, Image<O>& output);
# ifndef MLN_INCLUDE_ONLY
@@ -52,7 +52,7 @@
template <typename I, typename N, typename O>
inline
void closing_height(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output)
+ unsigned lambda, Image<O>& output)
{
mln_precondition(exact(output).domain() == exact(input).domain());
// FIXME: Change sig of closing_attribute!
Index: mln/morpho/opening_area_on_vertices.hh
--- mln/morpho/opening_area_on_vertices.hh (revision 2741)
+++ mln/morpho/opening_area_on_vertices.hh (working copy)
@@ -48,7 +48,7 @@
template <typename P, typename V, typename N, typename O>
void opening_area_on_vertices(const line_graph_image<P, V>& input,
const Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output);
+ unsigned lambda, Image<O>& output);
# ifndef MLN_INCLUDE_ONLY
@@ -57,7 +57,7 @@
inline
void opening_area_on_vertices(const line_graph_image<P, V>& input,
const Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output)
+ unsigned lambda, Image<O>& output)
{
mln_precondition(exact(output).domain() == exact(input).domain());
typedef accu::count_adjacent_vertices<P, V> attribute_t;
Index: mln/morpho/opening_volume.hh
--- mln/morpho/opening_volume.hh (revision 2741)
+++ mln/morpho/opening_volume.hh (working copy)
@@ -44,7 +44,7 @@
/// Morphological volume opening.
template <typename I, typename N, typename O>
void opening_volume(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output);
+ unsigned lambda, Image<O>& output);
# ifndef MLN_INCLUDE_ONLY
@@ -52,7 +52,7 @@
template <typename I, typename N, typename O>
inline
void opening_volume(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output)
+ unsigned lambda, Image<O>& output)
{
mln_precondition(exact(output).domain() == exact(input).domain());
// FIXME: Change sig of opening_attribute!
Index: mln/morpho/closing_area_on_vertices.hh
--- mln/morpho/closing_area_on_vertices.hh (revision 2741)
+++ mln/morpho/closing_area_on_vertices.hh (working copy)
@@ -49,7 +49,7 @@
template <typename P, typename V, typename N, typename O>
void closing_area_on_vertices(const line_graph_image<P, V>& input,
const Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output);
+ unsigned lambda, Image<O>& output);
# ifndef MLN_INCLUDE_ONLY
@@ -58,7 +58,7 @@
inline
void closing_area_on_vertices(const line_graph_image<P, V>& input,
const Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output)
+ unsigned lambda, Image<O>& output)
{
mln_precondition(exact(output).domain() == exact(input).domain());
typedef accu::count_adjacent_vertices<P, V> attribute_t;
Index: mln/morpho/opening_height.hh
--- mln/morpho/opening_height.hh (revision 2741)
+++ mln/morpho/opening_height.hh (working copy)
@@ -44,7 +44,7 @@
/// Morphological height opening.
template <typename I, typename N, typename O>
void opening_height(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output);
+ unsigned lambda, Image<O>& output);
# ifndef MLN_INCLUDE_ONLY
@@ -52,7 +52,7 @@
template <typename I, typename N, typename O>
inline
void opening_height(const Image<I>& input, const
Neighborhood<N>& nbh,
- std::size_t lambda, Image<O>& output)
+ unsigned lambda, Image<O>& output)
{
mln_precondition(exact(output).domain() == exact(input).domain());
// FIXME: Change sig of opening_attribute!
Index: mln/morpho/opening_area.hh
--- mln/morpho/opening_area.hh (revision 2741)
+++ mln/morpho/opening_area.hh (working copy)
@@ -46,7 +46,7 @@
/// Morphological area opening.
template <typename I, typename N, typename O>
void opening_area(const Image<I>& input, const Neighborhood<N>&
nbh,
- std::size_t lambda, Image<O>& output);
+ unsigned lambda, Image<O>& output);
# ifndef MLN_INCLUDE_ONLY
@@ -54,7 +54,7 @@
template <typename I, typename N, typename O>
inline
void opening_area(const Image<I>& input, const Neighborhood<N>&
nbh,
- std::size_t lambda, Image<O>& output)
+ unsigned lambda, Image<O>& output)
{
mln_precondition(exact(output).domain() == exact(input).domain());
typedef util::pix<I> pix_t;