27 #ifndef SCRIBO_FILTER_INTERNAL_COMPUTE_HH
28 # define SCRIBO_FILTER_INTERNAL_COMPUTE_HH
34 # include <mln/core/concept/image.hh>
35 # include <mln/core/concept/neighborhood.hh>
37 # include <mln/util/array.hh>
39 # include <scribo/core/component_set.hh>
40 # include <scribo/primitive/extract/components.hh>
65 template <
typename I,
typename N,
typename V,
typename F>
80 template <typename L, typename F>
86 # ifndef MLN_INCLUDE_ONLY
89 template <
typename I,
typename N,
typename V,
typename F>
97 mln_trace(
"scribo::filter::internal::compute");
99 const I& input =
exact(input_);
102 mln_precondition(input.is_valid());
103 mln_precondition(nbh.is_valid());
107 component_set<lbl_t> components
108 = primitive::extract::components(input, nbh, nlabels);
110 filter.update_objects(components);
113 mln_concrete(I) output =
duplicate(input);
114 data::
fill((output | pw::
value(components) == literal::zero).rw(), false);
120 template <typename L, typename F>
123 compute(const component_set<L>& components,
126 mln_trace(
"scribo::filter::internal::compute");
128 mln_precondition(components.is_valid());
130 component_set<L> output = components.duplicate();
136 # endif // ! MLN_INCLUDE_ONLY
145 #endif // ! SCRIBO_FILTER_INTERNAL_COMPUTE_HH