26 #ifndef MLN_UTIL_TREE_FAST_TO_IMAGE_HH
27 # define MLN_UTIL_TREE_FAST_TO_IMAGE_HH
37 # include <mln/core/concept/image.hh>
38 # include <mln/util/tree_fast.hh>
39 # include <mln/core/site_set/p_set.hh>
54 template <
typename T,
typename I>
58 # ifndef MLN_INCLUDE_ONLY
63 template <
typename T,
typename I>
68 mln_trace(
"util::impl::tree_fast_to_image");
70 I& output =
exact(output_);
71 std::list<unsigned> l;
73 l.push_back (tree.root_);
76 unsigned current = l.front();
77 for (
unsigned i = 0; i < tree.child_[current].size(); ++i)
78 l.push_back(tree.child_[current][i]);
80 mln_piter(p_set<point2d>)
p(tree.data_[current].points);
84 output(p) = tree.data_[current].value;
95 template <
typename T,
typename I>
100 mln_trace(
"util::tree_fast_to_image");
106 # endif // ! MLN_INCLUDE_ONLY
112 #endif // ! MLN_UTIL_TREE_FAST_TO_IMAGE_HH