27 #ifndef MLN_TRANSFORM_DISTANCE_AND_CLOSEST_POINT_GEODESIC_HH
28 # define MLN_TRANSFORM_DISTANCE_AND_CLOSEST_POINT_GEODESIC_HH
34 # include <mln/canvas/distance_geodesic.hh>
35 # include <mln/transform/internal/closest_point_functor.hh>
37 # include <mln/data/fill.hh>
38 # include <mln/util/couple.hh>
61 template <
typename I,
typename N,
typename D>
62 util::couple<mln_ch_value(I,D), mln_ch_value(I,mln_psite(I))>
64 const Neighborhood<N>& nbh,
83 template <
typename P,
typename N,
typename D>
84 util::couple<mln_image_from_grid(mln_grid(P),D),
85 mln_image_from_grid(mln_grid(P),
unsigned)>
87 const box<P>& closest_point_domain,
88 const Neighborhood<N>& nbh,
92 # ifndef MLN_INCLUDE_ONLY
94 template <
typename I,
typename N,
typename D>
96 util::couple<mln_ch_value(I,D), mln_ch_value(I, mln_psite(I))>
98 const Neighborhood<N>& nbh,
101 mln_trace(
"transform::distance_closest_point_geodesic");
103 mln_precondition(
exact(input).is_valid());
104 mln_precondition(
exact(nbh).is_valid());
106 internal::closest_point_functor_with_sites<I> f;
110 return make::couple(dmap, f.cp_ima);
113 template <typename P, typename N, typename D>
115 util::couple<mln_image_from_grid(mln_grid(P),D), mln_image_from_grid(mln_grid(P),
unsigned)>
117 const
box<P>& closest_point_domain,
118 const Neighborhood<N>& nbh,
121 mln_trace(
"transform::distance_and_closest_point_geodesic");
123 mln_precondition(closest_point_domain.is_valid());
124 mln_precondition(
exact(nbh).is_valid());
125 mln_precondition(
geom::bbox(pset) <= closest_point_domain);
127 typedef mln_image_from_grid(mln_grid(P),
bool) I;
128 internal::closest_point_functor_with_indexes<I> f(pset);
130 I ima(closest_point_domain);
132 data::
fill((ima | pset).rw(), true);
136 return make::couple(dmap, f.cp_ima);
139 # endif // ! MLN_INCLUDE_ONLY
146 #endif // ! MLN_TRANSFORM_DISTANCE_AND_CLOSEST_POINT_GEODESIC_HH