27 #ifndef MLN_DRAW_BOX_HH
28 # define MLN_DRAW_BOX_HH
37 # include <mln/core/concept/image.hh>
38 # include <mln/core/alias/box2d.hh>
39 # include <mln/data/paste.hh>
40 # include <mln/draw/line.hh>
41 # include <mln/pw/image.hh>
42 # include <mln/pw/cst.hh>
62 template <
typename I,
typename B>
63 void box(Image<I>& ima,
65 const mln_value(I)& v);
68 # ifndef MLN_INCLUDE_ONLY
70 template <
typename I,
typename B>
74 const mln_value(I)& v)
76 mln_precondition(exact(ima).is_valid());
78 mln_psite(I) pmin = exact(b).pmin();
79 mln_psite(I) pmax = exact(b).pmax();
81 mln_precondition(exact(ima).has(pmin) && exact(ima).has(pmax));
83 mln_psite(I) p1 (pmin[0], pmin[1]);
84 mln_psite(I) p2 (pmax[0], pmin[1]);
85 mln_psite(I) p3 (pmin[0], pmax[1]);
86 mln_psite(I) p4 (pmax[0], pmax[1]);
94 # endif // ! MLN_INCLUDE_ONLY
101 #endif // ! MLN_DRAW_BOX_HH