26 #ifndef MLN_WORLD_INTER_PIXEL_DISPLAY_EDGE_HH
27 # define MLN_WORLD_INTER_PIXEL_DISPLAY_EDGE_HH
34 # include <mln/core/image/image2d.hh>
35 # include <mln/core/image/dmorph/image_if.hh>
36 # include <mln/data/fill.hh>
37 # include <mln/world/inter_pixel/is_separator.hh>
38 # include <mln/opt/at.hh>
62 I
display_edge(
const I& ima, mln_value(I) bg,
unsigned zoom);
64 # ifndef MLN_INCLUDE_ONLY
69 I
display_edge(
const I& ima, mln_value(I) bg,
unsigned zoom)
72 I output(
make::box2d(((b.pmin()[0] + 1) / 2) * (zoom + 1),
73 ((b.pmin()[1] + 1) / 2) * (zoom + 1),
74 ((b.pmax()[0] + 1) / 2 + 1) * (zoom + 1) - 2,
75 ((b.pmax()[1] + 1) / 2 + 1) * (zoom + 1) - 2));
77 typedef image_if<const I, is_separator> edge_t;
78 edge_t
edge = ima | is_separator();
79 mln_piter(edge_t)
p(edge.domain());
83 unsigned row = (
p.row() / 2 + 1) * (zoom + 1) - 1;
84 unsigned col = (
p.col() / 2) * (zoom + 1);
85 for (
unsigned i = 0; i < zoom; ++i)
86 opt::at(output, row, col + i) = ima(
p);
90 unsigned row = (
p.row() / 2) * (zoom + 1);
91 unsigned col = (
p.col() / 2 + 1) * (zoom + 1) - 1;
92 for (
unsigned i = 0; i < zoom; ++i)
93 opt::at(output, row + i, col) = ima(
p);
99 # endif // ! MLN_INCLUDE_ONLY
107 #endif // ! MLN_WORLD_INTER_PIXEL_DISPLAY_EDGE_HH