27 #ifndef MLN_VALUE_GRAYLEVEL_F_HXX
28 # define MLN_VALUE_GRAYLEVEL_F_HXX
34 # include <mln/value/graylevel_f.hh>
54 mln_precondition(val >= 0);
55 mln_precondition(val <= 1);
63 mln_precondition(val >= 0);
64 mln_precondition(val <= 1);
72 mln_precondition(rhs.
to_float() >= 0);
73 mln_precondition(rhs.
to_float() <= 1);
81 mln_precondition(rhs.
to_float() >= 0);
82 mln_precondition(rhs.
to_float() <= 1);
98 mln_precondition(rhs.
v_ >= 0);
99 mln_precondition(rhs.
v_ <= 1);
146 template <
unsigned n>
166 return ostr << g.
value() <<
"/gl_f";
170 template <
typename I>
190 return lhs.value() + rhs.value();
194 template <
unsigned n>
202 template <
unsigned n>
210 template <
typename I>
221 template <
typename I>
237 return lhs.value() - rhs.value();
240 template <
typename I>
251 template <
typename I>
267 return lhs.value() * rhs.value();
272 template <
typename I>
277 return lhs.value() *
int(
exact(rhs));
280 template <
typename F>
285 return lhs.value() *
exact(rhs);
288 template <
typename F>
293 return rhs.value() *
exact(lhs);
297 template <
typename S>
302 return lhs.value() * rhs.to_equiv();
305 template <
typename S>
310 mln_precondition(rhs.to_equiv() != S(0));
311 return lhs.value() / rhs.to_equiv();
319 #endif // ! MLN_VALUE_GRAYLEVEL_F_HXX