26 #ifndef SCRIBO_PRIMITIVE_REMOVE_SEPARATORS_HH
27 # define SCRIBO_PRIMITIVE_REMOVE_SEPARATORS_HH
33 # include <mln/core/concept/image.hh>
35 # include <mln/core/routine/duplicate.hh>
37 # include <mln/core/image/dmorph/image_if.hh>
38 # include <mln/pw/all.hh>
40 # include <mln/data/fill.hh>
42 # include <mln/border/fill.hh>
43 # include <mln/border/resize.hh>
74 # ifndef MLN_INCLUDE_ONLY
79 separators(const
Image<I>& input_, const
Image<I>& separators_)
81 mln_trace(
"scribo::primitive::remove::separators");
83 const I& input =
exact(input_);
84 const I& separators =
exact(separators_);
85 mlc_is(mln_value(I),
bool)::check();
86 mln_precondition(input.is_valid());
87 mln_precondition(separators.is_valid());
91 border::
resize(separators, output.border());
92 border::
fill(separators, 0);
95 typedef const mln_value(I)* sep_ptr_t;
97 sep_ptr = separators.buffer(),
98 end_ptr = sep_ptr + input.nelements();
99 mln_value(I) *out_ptr = output.buffer();
101 for (; sep_ptr < end_ptr; ++out_ptr)
108 # endif // ! MLN_INCLUDE_ONLY
116 #endif // ! SCRIBO_PRIMITIVE_REMOVE_SEPARATORS_HH