26 #ifndef MLN_MORPHO_TREE_FILTER_SUBTRACTIVE_HH
27 # define MLN_MORPHO_TREE_FILTER_SUBTRACTIVE_HH
29 # include <mln/core/concept/function.hh>
30 # include <mln/fun/ops.hh>
32 # include <mln/morpho/tree/data.hh>
33 # include <mln/morpho/tree/propagate_if.hh>
64 template <
typename T,
typename F,
typename P>
67 subtractive(
const T& tree, Image<F>& f_,
const Function_v2b<P>& pred_);
72 # ifndef MLN_INCLUDE_ONLY
74 template <
typename T,
typename F,
typename P>
77 subtractive(
const T& tree, Image<F>& f_,
const Function_v2b<P>& pred_)
80 const P& pred =
exact(pred_);
82 mln_trace(
"mln::morpho::tree::filter::subtractive");
86 mln_up_node_piter(
T) n(tree);
89 f(n) = f(tree.parent(n));
93 # endif // ! MLN_INCLUDE_ONLY
100 #endif // ! MLN_MORPHO_TREE_FILTER_SUBTRACTIVE_HH