26 #ifndef MLN_WIN_OCTAGON2D_HH
27 # define MLN_WIN_OCTAGON2D_HH
33 # include <mln/core/internal/classical_window_base.hh>
34 # include <mln/core/alias/dpoint2d.hh>
40 mln_internal_add_classical_window_trait(octagon2d);
67 struct octagon2d :
public internal::classical_window_base< dpoint2d, octagon2d >
84 unsigned delta_()
const;
88 unsigned area()
const;
90 void print_(std::ostream& ostr)
const;
98 # ifndef MLN_INCLUDE_ONLY
104 mln_precondition(length % 6 == 1);
107 x = static_cast<def::coord>(y * 2),
115 _b = static_cast<def::coord>(-b);
126 b_max = static_cast<def::coord>(2 * x - a);
131 _b = static_cast<def::coord>(-b);
151 unsigned octagon2d::delta_()
const
159 unsigned l = (length_ - 1) / 6;
160 return l * (28 * l + 8) + 4;
164 void octagon2d::print_(std::ostream& ostr)
const
166 ostr <<
"[octagon2d: length=" << length_ <<
']';
169 # endif // ! MLN_INCLUDE_ONLY
178 # include <mln/win/hline2d.hh>
179 # include <mln/win/vline2d.hh>
180 # include <mln/win/diag2d.hh>
181 # include <mln/win/backdiag2d.hh>
183 #endif // ! MLN_WIN_OCTAGON2D_HH