27 #ifndef MLN_CORE_ALIAS_WINDOW3D_HH
28 # define MLN_CORE_ALIAS_WINDOW3D_HH
36 # include <mln/core/window.hh>
37 # include <mln/core/alias/dpoint3d.hh>
38 # include <mln/convert/from_to.hh>
93 typedef window<mln::dpoint3d> window3d;
147 template <
unsigned M>
148 void from_to_(
bool const (&values)[M], window3d& win);
152 # ifndef MLN_INCLUDE_ONLY
154 inline const window3d&
170 inline const window3d&
193 template <
unsigned M>
195 from_to_(
bool const (&values)[M], window3d& win)
197 const int h =
unsigned(std::pow(
float(M),
float(1. / 3.))) / 2;
198 mln_precondition((2 * h + 1) * (2 * h + 1) * (2 * h + 1) == M);
201 for (
int sli = - h; sli <= h; ++sli)
202 for (
int row = - h; row <= h; ++row)
203 for (
int col = - h; col <= h; ++col)
205 win.insert(sli, row, col);
208 # endif // ! MLN_INCLUDE_ONLY
214 #endif // ! MLN_CORE_ALIAS_WINDOW3D_HH