27 #ifndef MLN_VALUE_INT_U_HXX
28 # define MLN_VALUE_INT_U_HXX
35 # include <mln/value/int_u.hh>
37 # include <mln/debug/format.hh>
56 mln_precondition(i >= 0);
57 mln_precondition(
unsigned(i) <= mln_max(
enc_));
58 this->v_ =
static_cast<enc_>(i);
100 template <
unsigned n>
105 return -
int(this->v_);
108 template <
unsigned n>
113 mln_precondition(i >= 0);
114 mln_precondition(
unsigned(i) <= mln_max(
enc_));
115 this->v_ =
static_cast<enc_>(i);
119 template <
unsigned n>
127 template <
unsigned n>
129 std::ostream& operator<<(std::ostream& ostr, const int_u<n>& i)
135 template <
unsigned n>
139 return istr >> i.handle_();
145 template <
unsigned n>
153 template <
unsigned n>
161 template <
unsigned n>
166 to_ =
static_cast<float>(from);
169 template <
unsigned n>
174 to_ =
static_cast<double>(from);
177 template <
unsigned m>
182 mlc_bool(m <= 8)::check();
186 template <
unsigned m>
191 to =
rgb<m>(from, from, from);
198 #endif // ! MLN_VALUE_INT_U_HXX