26 #include <mln/core/image/image1d.hh>
27 #include <mln/core/image/image2d.hh>
28 #include <mln/core/image/image3d.hh>
29 #include <mln/core/image/dmorph/sub_image.hh>
30 #include <mln/core/image/dmorph/image_if.hh>
32 #include <mln/fun/p2b/chess.hh>
33 #include <mln/literal/origin.hh>
34 #include <mln/value/int_u8.hh>
35 #include <mln/value/int_s8.hh>
36 #include <mln/value/int_s16.hh>
38 #include <mln/debug/iota.hh>
39 #include <mln/arith/revert.hh>
87 template <
typename I,
typename J>
89 chck(
const Image<I>& ref_,
const Image<J>& ima_)
91 typedef mln_value(I) V;
92 const I& ref = exact(ref_);
93 const J& ima = exact(ima_);
95 mln_piter(I) p (ima.domain ());
97 mln_assertion (ima(p) == mln_value(J)(mln_min(V) + mln_max(V) - ref(p)));
100 template <typename V>
116 typedef image1d<V> I;
119 for (
unsigned i = 1; i < col; ++i)
130 typedef image2d<V> I;
133 for (
unsigned i = 1; i < col; ++i)
134 for (
unsigned j = 1; j < row; ++j)
145 typedef image3d<V> I;
148 for (
unsigned i = 1; i < col; ++i)
149 for (
unsigned j = 1; j < row; ++j)
150 for (
unsigned k = 1; k < sli; ++k)
161 typedef image1d<V> I;
162 typedef sub_image<I, box1d> J;
166 for (
unsigned i = 1; i < col; ++i)
180 typedef image2d<V> I;
181 typedef sub_image<I, box2d> J;
184 for (
unsigned i = 1; i < col; ++i)
185 for (
unsigned j = 1; j < row; ++j)
199 typedef image3d<V> I;
200 typedef sub_image<I, box3d> J;
203 for (
unsigned i = 1; i < col; ++i)
204 for (
unsigned j = 1; j < row; ++j)
205 for (
unsigned k = 1; k < sli; ++k)
231 chk<value::int_s8>();
232 chk<value::int_s16>();
233 chk<value::int_u8>();