27 #ifndef MLN_VALUE_GRAYLEVEL_F_HH
28 # define MLN_VALUE_GRAYLEVEL_F_HH
36 # include <mln/value/ops.hh>
38 # include <mln/core/contract.hh>
39 # include <mln/metal/math/pow.hh>
40 # include <mln/metal/bexpr.hh>
41 # include <mln/literal/ops.hh>
43 # include <mln/value/float01_f.hh>
44 # include <mln/trait/value_.hh>
52 # ifdef MLN_INCLUDE_ONLY
53 # include <mln/value/internal/gray_f.hh>
55 # define MLN_INCLUDE_ONLY
56 # include <mln/value/internal/gray_f.hh>
57 # undef MLN_INCLUDE_ONLY
84 template <
unsigned n>
struct graylevel;
100 template <
unsigned n>
105 template <
unsigned n>
129 template <
typename I >
130 struct set_binary_< op::
times,
137 template <
typename I >
138 struct set_binary_< op::
times,
146 template <
typename F >
147 struct set_binary_< op::
times,
154 template <
typename F >
155 struct set_binary_< op::
times,
163 template <
typename S >
169 template <
typename S >
177 template <
typename T>
struct value_;
181 struct value_<mln::value::graylevel_f>
191 nbits = mln_nbits(equiv_),
195 typedef trait::value::nature::floating
nature;
196 typedef trait::value::kind::gray
kind;
197 typedef mln_trait_value_quant_(equiv_) quant;
199 static const equiv_
min() {
return 0; }
200 static const equiv_
max() {
return 1; }
201 static const equiv_ epsilon() {
return mln_epsilon(equiv_); }
238 template <
unsigned n>
241 template <
unsigned n>
259 template <
unsigned n>
274 template <
typename I>
289 template <
unsigned n>
291 operator+(const graylevel_f& lhs, const
graylevel<n>& rhs);
293 template <
unsigned n>
294 mln_trait_op_plus(graylevel_f,
graylevel<n>)
295 operator+(const
graylevel<n>& lhs, const graylevel_f& rhs);
298 template <typename I>
300 operator+(const graylevel_f& lhs, const I& i);
302 template <typename I>
304 operator+(const I& i, const graylevel_f& rhs);
308 mln_trait_op_minus_(graylevel_f, graylevel_f)
309 operator-(const graylevel_f& lhs, const graylevel_f& rhs);
312 template <typename I>
314 operator-(const graylevel_f& lhs, const I& i);
316 template <typename I>
318 operator-(const I& i, const graylevel_f& rhs);
322 mln_trait_op_times_(graylevel_f, graylevel_f)
323 operator*(const graylevel_f& lhs, const graylevel_f& rhs);
332 template <
unsigned n,
typename T>
333 mln_trait_op_times(graylevel_f,
T)
334 operator*(const graylevel_f& lhs, const
T& rhs);
337 template <
unsigned n, typename
T>
338 mln_trait_op_times(graylevel_f,
T)
339 operator*(const
T& lhs, const graylevel_f& rhs);
342 template <
unsigned n, typename
T>
344 operator/(const graylevel_f& lhs, const
T& rhs);
351 template <
typename I>
352 mln_trait_op_times(graylevel_f, I)
353 operator*(const graylevel_f& lhs, const
Integer<I>& rhs);
356 template <typename I>
357 mln_trait_op_times(I, graylevel_f)
358 operator*(const
Integer<I>& lhs, const graylevel_f& rhs);
365 template <
typename I>
366 mln_trait_op_div(graylevel_f, I)
367 operator/(const graylevel_f& lhs, const
Integer<I>& rhs);
370 template <typename I>
371 mln_trait_op_div(I, graylevel_f)
372 operator/(const
Integer<I>& lhs, const graylevel_f& rhs);
379 template <
typename F>
380 mln_trait_op_times(graylevel_f, F)
381 operator*(const graylevel_f& lhs, const
Floating<F>& rhs);
384 template <typename F>
385 mln_trait_op_times(F, graylevel_f)
386 operator*(const
Floating<F>& lhs, const graylevel_f& rhs);
393 template <
typename F>
394 mln_trait_op_div(graylevel_f, F)
395 operator/(const graylevel_f& lhs, const
Floating<F>& rhs);
398 template <typename F>
399 mln_trait_op_div(F, graylevel_f)
400 operator/(const
Floating<F>& lhs, const graylevel_f& rhs);
407 template <
typename S>
408 mln_trait_op_times(graylevel_f, S)
409 operator*(const graylevel_f& lhs, const
scalar_<S>& rhs);
412 template <typename S>
413 mln_trait_op_div(graylevel_f, S)
414 operator/(const graylevel_f& lhs, const
scalar_<S>& rhs);
421 # ifndef MLN_INCLUDE_ONLY
422 # include <mln/value/graylevel_f.hxx>
423 # include <mln/value/internal/gray_f.hxx>
424 # endif // ! MLN_INCLUDE_ONLY
427 #endif // ! MLN_VALUE_GRAYLEVEL_F_HH