Commit 696503df authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Fix warnings with g++-4.1 in Milena.

	* mln/fun/v2v/saturate.hh,
	* mln/subsampling/antialiased.hh,
	* mln/value/rgb.hh: Use convert::from_to for type conversions.
parent b265090a
2010-08-11 Guillaume Lazzara <z@lrde.epita.fr>
Fix warnings with g++-4.1 in Milena.
* mln/fun/v2v/saturate.hh,
* mln/subsampling/antialiased.hh,
* mln/value/rgb.hh: Use convert::from_to for type conversions.
2010-08-11 Guillaume Lazzara <z@lrde.epita.fr>
 
* mln/core/point.hh: Fix a warning.
// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -112,7 +113,10 @@ namespace mln
return min_;
if (w > max_W)
return max_;
return mln::value::cast<W>(w);
V output;
convert::from_to(w, output);
return output;
}
# endif // ! MLN_INCLUDE_ONLY
......
......@@ -194,7 +194,7 @@ namespace mln
for (unsigned k = 0; k < factor; ++k)
s += *ptrs[j]++;
*po++ = (s + factor_round) / factor_2;
convert::from_to((s + factor_round) / factor_2, *po++);
}
for (unsigned j = 0; j < factor; ++j)
......
......@@ -446,9 +446,9 @@ namespace mln
inline
rgb<n>::rgb(const algebra::vec<3, float>& v)
{
this->v_[0] = v[0];
this->v_[1] = v[1];
this->v_[2] = v[2];
convert::from_to(v[0], this->v_[0]);
convert::from_to(v[1], this->v_[1]);
convert::from_to(v[2], this->v_[2]);
}
template <unsigned n>
......@@ -488,27 +488,27 @@ namespace mln
inline
rgb<n>::rgb(const mln::literal::light_gray_t&)
{
this->v_[0] = mln_max(int_u<n>) * 0.75;
this->v_[1] = mln_max(int_u<n>) * 0.75;
this->v_[2] = mln_max(int_u<n>) * 0.75;
convert::from_to(mln_max(int_u<n>) * 0.75, this->v_[0]);
convert::from_to(mln_max(int_u<n>) * 0.75, this->v_[1]);
convert::from_to(mln_max(int_u<n>) * 0.75, this->v_[2]);
}
template <unsigned n>
inline
rgb<n>::rgb(const mln::literal::medium_gray_t&)
{
this->v_[0] = mln_max(int_u<n>) * 0.50;
this->v_[1] = mln_max(int_u<n>) * 0.50;
this->v_[2] = mln_max(int_u<n>) * 0.50;
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[0]);
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[1]);
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[2]);
}
template <unsigned n>
inline
rgb<n>::rgb(const mln::literal::dark_gray_t&)
{
this->v_[0] = mln_max(int_u<n>) * 0.25;
this->v_[1] = mln_max(int_u<n>) * 0.25;
this->v_[2] = mln_max(int_u<n>) * 0.25;
convert::from_to(mln_max(int_u<n>) * 0.25, this->v_[0]);
convert::from_to(mln_max(int_u<n>) * 0.25, this->v_[1]);
convert::from_to(mln_max(int_u<n>) * 0.25, this->v_[2]);
}
template <unsigned n>
......@@ -542,16 +542,16 @@ namespace mln
inline
rgb<n>::rgb(const mln::literal::brown_t&)
{
this->v_[0] = mln_max(int_u<n>) * 0.75;
this->v_[1] = mln_max(int_u<n>) * 0.50;
this->v_[2] = mln_max(int_u<n>) * 0.25;
convert::from_to(mln_max(int_u<n>) * 0.75, this->v_[0]);
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[1]);
convert::from_to(mln_max(int_u<n>) * 0.25, this->v_[2]);
}
template <unsigned n>
inline
rgb<n>::rgb(const mln::literal::lime_t&)
{
this->v_[0] = mln_max(int_u<n>) * 0.75;
convert::from_to(mln_max(int_u<n>) * 0.75, this->v_[0]);
this->v_[1] = mln_max(int_u<n>);
this->v_[2] = 0;
}
......@@ -561,7 +561,7 @@ namespace mln
rgb<n>::rgb(const mln::literal::orange_t&)
{
this->v_[0] = mln_max(int_u<n>);
this->v_[1] = mln_max(int_u<n>) * 0.50;
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[1]);
this->v_[2] = 0;
}
......@@ -570,17 +570,17 @@ namespace mln
rgb<n>::rgb(const mln::literal::pink_t&)
{
this->v_[0] = mln_max(int_u<n>);
this->v_[1] = mln_max(int_u<n>) * 0.75;
this->v_[2] = mln_max(int_u<n>) * 0.75;
convert::from_to(mln_max(int_u<n>) * 0.75, this->v_[1]);
convert::from_to(mln_max(int_u<n>) * 0.75, this->v_[2]);
}
template <unsigned n>
inline
rgb<n>::rgb(const mln::literal::purple_t&)
{
this->v_[0] = mln_max(int_u<n>) * 0.75;
convert::from_to(mln_max(int_u<n>) * 0.75, this->v_[0]);
this->v_[1] = 0;
this->v_[2] = mln_max(int_u<n>) * 0.25;
convert::from_to(mln_max(int_u<n>) * 0.25, this->v_[2]);
}
template <unsigned n>
......@@ -588,17 +588,17 @@ namespace mln
rgb<n>::rgb(const mln::literal::teal_t&)
{
this->v_[0] = 0;
this->v_[1] = mln_max(int_u<n>) * 0.50;
this->v_[2] = mln_max(int_u<n>) * 0.50;
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[1]);
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[2]);
}
template <unsigned n>
inline
rgb<n>::rgb(const mln::literal::violet_t&)
{
this->v_[0] = mln_max(int_u<n>) * 0.50;
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[0]);
this->v_[1] = 0;
this->v_[2] = mln_max(int_u<n>) * 0.50;
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[2]);
}
template <unsigned n>
......@@ -632,8 +632,8 @@ namespace mln
inline
rgb<n>::rgb(const mln::literal::olive_t&)
{
this->v_[0] = mln_max(int_u<n>) * 0.50;
this->v_[1] = mln_max(int_u<n>) * 0.50;
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[0]);
convert::from_to(mln_max(int_u<n>) * 0.50, this->v_[1]);
this->v_[2] = 0;
}
......
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