28 #include <mln/core/image/image1d.hh>
29 #include <mln/core/image/image2d.hh>
30 #include <mln/core/image/image3d.hh>
31 #include <mln/core/image/dmorph/sub_image.hh>
33 #include <mln/core/image/dmorph/image_if.hh>
34 #include <mln/fun/p2b/chess.hh>
36 #include <mln/literal/origin.hh>
38 #include <mln/value/int_u8.hh>
39 #include <mln/value/int_u16.hh>
41 #include <mln/value/int_s8.hh>
42 #include <mln/value/int_s16.hh>
44 #include <mln/data/fill.hh>
45 #include <mln/data/transform.hh>
47 #include <mln/debug/iota.hh>
49 #include <mln/arith/plus.hh>
56 typedef unsigned short result;
57 result operator()(
int c)
const
59 return result(c % 42);
68 chck(
const Image<I>& ref_)
70 const I& ref = exact(ref_);
72 mln_ch_value(I, mln_result_(mysqrt)) out;
75 mln_piter(I) p (ref.domain ());
77 mln_assertion ((mln_value(I))(ref(p) % 42) == out(p) );
90 (std::cerr <<
"in 1d ... ").flush ();
93 typedef sub_image<I, box1d> J;
95 for (
unsigned i = 1; i < col; ++i)
102 std::cerr <<
"OK" << std::endl;
104 (std::cerr <<
"in 2d ... ").flush ();
106 typedef image2d<V> I;
108 for (
unsigned i = 1; i < col; ++i)
109 for (
unsigned j = 1; j < row; ++j)
116 std::cerr <<
"OK" << std::endl;
118 (std::cerr <<
"in 3d ... ").flush ();
120 typedef image3d<V> I;
122 for (
unsigned i = 1; i < col; ++i)
123 for (
unsigned j = 1; j < row; ++j)
124 for (
unsigned k = 1; k < sli; ++k)
131 std::cerr <<
"OK" << std::endl;
144 std::cerr <<
"Tests data::transform:" << std::endl;
145 std::cerr <<
"on int:" << std::endl;
147 std::cerr <<
"on unsigned:" << std::endl;
149 std::cerr <<
"on int_u8:" << std::endl;
150 chk<value::int_u8>();
151 std::cerr <<
"on int_u16:" << std::endl;
152 chk<value::int_u16>();
153 std::cerr <<
"on int_s8:" << std::endl;
154 chk<value::int_s8>();
155 std::cerr <<
"on int_s16:" << std::endl;
156 chk<value::int_s16>();