63 using std::make_tuple;
66 std::array<point_2t, 9> kernel;
69 constexpr std::array<point_2t, 9> kernelcw
71 make_tuple(-1, 1), make_tuple(0, 1), make_tuple(1, 1),
72 make_tuple(-1, 0), make_tuple(0, 0), make_tuple(1, 0),
73 make_tuple(-1, -1), make_tuple(0, -1), make_tuple(1, -1)
81 constexpr std::array<point_2t, 9> kernelcwsvg
83 make_tuple(-1, -1), make_tuple(0, -1), make_tuple(1, -1),
84 make_tuple(-1, 0), make_tuple(0, 0), make_tuple(1, 0),
85 make_tuple(-1, 1), make_tuple(0, 1), make_tuple(1, 1)
93 constexpr std::array<point_2t, 9> kernelver
95 make_tuple(-1, 0), make_tuple(0, 0), make_tuple(1, 0),
96 make_tuple(-1, 1), make_tuple(0, -1), make_tuple(0, 0),
97 make_tuple(-1, -1), make_tuple(0, 1), make_tuple(1, 0)
105 constexpr std::array<point_2t, 9> kernelslim
107 make_tuple(-1, -1), make_tuple(0, -1), make_tuple(1, -1),
108 make_tuple(0, 0), make_tuple(1, 0), make_tuple(-1, 0),
109 make_tuple(-1, 1), make_tuple(0, 1), make_tuple(1, 1)
118 string m(
"to_point_in_3x3_matrix: ");
119 m +=
"error iteration count too big for matrix, i is: ";
120 m += std::to_string(i);
122 throw std::runtime_error(
m);
126 const point_2t origin = a.center_point();
127 auto [ x, y ] = origin;
128 auto [ xm, ym ] = kernel[i];
129 auto xnew = x + (xm * delta);
130 auto ynew = y + (ym * delta);
131 return make_tuple(xnew, ynew);
150 const point_2t origin = a.center_point();
152 const auto [width, height] = a;
153 const double widthadj = width - (2 * margin);
156 const double heightadj = height - (2 * margin);
157 const ulong ydelta = heightadj / 2;
160 static std::array<point_2t, 8> kernel =
163 p2d(-1.5, -0.5), p2d(-0.5, -0.5), p2d(0.5, -0.5), p2d(1.5, -0.5),
164 p2d(-1.5, 0.5), p2d(-0.5, 0.5), p2d(0.5, 0.5), p2d(1.5, 0.5)
170 string m(
"to_point_in_2x4_matrix: ");
171 m +=
"error iteration count too big for matrix, i is: ";
172 m += std::to_string(i);
174 throw std::runtime_error(
m);
177 auto [ x, y ] = origin;
178 auto [ xm, ym ] = kernel[i];
179 auto xnew = x + (xm * xdelta);
180 auto ynew = y + (ym * ydelta);
181 return std::make_tuple(xnew, ynew);
point_2t to_point_in_1xn_matrix(const area<> a, const uint n, const uint i, const double margin, const double y, const bool centeredp=false)
For positioning a linear list of glyphs along a horizontal line.