27 #ifndef MLN_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH
28 # define MLN_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH
34 # include <mln/core/concept/browsing.hh>
35 # include <mln/core/concept/image.hh>
99 # ifndef MLN_INCLUDE_ONLY
101 # ifndef MLN_WO_GLOBAL_VARS
105 # endif // ! MLN_WO_GLOBAL_VARS
112 template <
typename F>
117 mln_trace(
"canvas::browsing::dir_struct_elt_incr_update");
118 mln_precondition(f.dir < f.dim);
119 typedef typename F::I I;
122 pmin = f.input.domain().pmin(),
123 pmax = f.input.domain().pmax();
127 pmin_dir = pmin[f.dir],
128 pmax_dir = pmax[f.dir],
129 pmin_dir_plus_half_length = static_cast<C>(pmin_dir + f.length / 2),
130 pmax_dir_minus_half_length = static_cast<C>(pmax_dir - f.length / 2);
151 for (ct = pmin_dir; ct < pmin_dir_plus_half_length; ++ ct)
156 for (p_dir = pmin_dir; p_dir <= pmin_dir_plus_half_length; ++p_dir, ++ct)
165 for (; p_dir <= pmax_dir_minus_half_length; ++cu, ++p_dir, ++ct)
175 for (; p_dir <= pmax_dir; ++cu, ++p_dir)
184 for (
int c = F::dim - 1; c >= 0; --c)
188 if (f.p[c] != pmax[c])
195 }
while (f.p != pmin);
200 # endif // ! MLN_INCLUDE_ONLY
208 #endif // ! MLN_CANVAS_BROWSING_DIR_STRUCT_ELT_INCR_UPDATE_HH