#ifndef H_89BCEB17FBD94DE38B501C2F028FDF35 #define H_89BCEB17FBD94DE38B501C2F028FDF35 #include "colors.hpp" template class Grid { static_assert(Size % 2 == 0); static constexpr int pixels = Size*Size; std::array data; public: static constexpr std::array quad1() { std::array q; for (int i = 0; i < Size/2; i++) for (int j = 0; j < Size/2; j++) { const int count = i * Size/2 + j; q[count] = i * Size + j; } return q; } static constexpr std::array quad2() { std::array q; for (int i = 0; i < Size/2; i++) for (int j = 0; j < Size/2; j++) { const int count = i * Size/2 + j; q[count] = (Size - i - 1) * Size + j; } return q; } static constexpr std::array quad3() { std::array q; for (int i = 0; i < Size/2; i++) for (int j = 0; j < Size/2; j++) { const int count = i * Size/2 + j; q[count] = i * Size + j; } return q; } static constexpr std::array quad4() { std::array q; for (int i = 0; i < Size/2; i++) for (int j = 0; j < Size/2; j++) { const int count = i * Size/2 + j; q[count] = (Size - i - 1) * Size + (Size - j - 1); } return q; } }; #endif //H_89BCEB17FBD94DE38B501C2F028FDF35