26 #ifndef MLN_CORE_ALIAS_WINDOW3D_HH
27 # define MLN_CORE_ALIAS_WINDOW3D_HH
35 # include <mln/core/window.hh>
36 # include <mln/core/alias/dpoint3d.hh>
37 # include <mln/convert/from_to.hh>
107 template <
unsigned M>
108 void from_to_(
bool const (&values)[M],
window3d& win);
116 # ifndef MLN_INCLUDE_ONLY
160 template <
unsigned M>
162 from_to_(
bool const (&values)[M],
window3d& win)
164 const int h = unsigned(std::pow(
float(M),
float(1. / 3.))) / 2;
165 mln_precondition((2 * h + 1) * (2 * h + 1) * (2 * h + 1) == M);
168 for (
int sli = - h; sli <= h; ++sli)
169 for (
int row = - h; row <= h; ++row)
170 for (
int col = - h; col <= h; ++col)
172 win.insert(sli, row, col);
179 # endif // ! MLN_INCLUDE_ONLY
185 #endif // ! MLN_CORE_ALIAS_WINDOW3D_HH