27 #include <mln/value/gl8.hh>
28 #include <mln/value/gl16.hh>
29 #include <mln/value/glf.hh>
31 #include <mln/value/int_u8.hh>
32 #include <mln/value/int_s8.hh>
33 #include <mln/value/float01_f.hh>
34 #include <mln/value/float01_.hh>
36 #include <mln/literal/black.hh>
37 #include <mln/literal/white.hh>
40 template<
typename From,
typename To,
typename T>
42 test_conversion (
const T& val)
45 To test = (From)(val);
53 using namespace mln::value::internal;
63 mln_assertion(a == b);
107 mln_assertion(a / 2.0 ==
glf(0.5));
110 mln_assertion(a /
true == a);
135 test_conversion<i_gray_8, gl8>(255);
138 test_conversion<gray_f, gl8>(0.4);
140 test_conversion<glf, gl8>(0.4);
143 test_conversion<i_gray_8, glf>(255);
145 test_conversion<gray_f, glf>(0.4);
147 test_conversion<gl8, glf>(142);
150 test_conversion<i_gray_8, gray_f>(4);
154 test_conversion<gray_f, i_gray_8>(0.4);
157 test_conversion<glf, gray_f>(0.4);
160 test_conversion<gl8, i_gray_8>(142);