|
36 | 36 | #define _IO2D_API |
37 | 37 | #endif |
38 | 38 |
|
39 | | -namespace std::experimental::io2d { |
40 | | - inline namespace v1 { |
41 | | - |
42 | | - using dashes = tuple<vector<float>, float>; |
43 | | - |
44 | | - template <class T> |
45 | | - constexpr T pi = T(3.14159265358979323846264338327950288L); |
46 | | - template <class T> |
47 | | - constexpr T two_pi = T(6.28318530717958647692528676655900577L); |
48 | | - template <class T> |
49 | | - constexpr T half_pi = T(1.57079632679489661923132169163975144L); |
50 | | - template <class T> |
51 | | - constexpr T three_pi_over_two = T(4.71238898038468985769396507491925432L); |
52 | | - |
53 | | - template <class T> |
54 | | - constexpr T tau = T(6.28318530717958647692528676655900577L); |
55 | | - template <class T> |
56 | | - constexpr T three_quarters_tau = T(4.71238898038468985769396507491925432L); |
57 | | - template <class T> |
58 | | - constexpr T half_tau = T(3.14159265358979323846264338327950288L); |
59 | | - template <class T> |
60 | | - constexpr T quarter_tau = T(1.57079632679489661923132169163975144L); |
| 39 | +namespace std { |
| 40 | + namespace experimental { |
| 41 | + namespace io2d { |
| 42 | + inline namespace v1 { |
61 | 43 |
|
| 44 | + template <class T> |
| 45 | + constexpr T pi = T(3.14159265358979323846264338327950288L); |
| 46 | + |
| 47 | + template <class T> |
| 48 | + constexpr T two_pi = T(6.28318530717958647692528676655900577L); |
| 49 | + |
| 50 | + template <class T> |
| 51 | + constexpr T half_pi = T(1.57079632679489661923132169163975144L); |
| 52 | + |
| 53 | + template <class T> |
| 54 | + constexpr T three_pi_over_two = T(4.71238898038468985769396507491925432L); |
| 55 | + |
| 56 | + template <class T> |
| 57 | + constexpr T tau = T(6.28318530717958647692528676655900577L); |
| 58 | + |
| 59 | + template <class T> |
| 60 | + constexpr T three_quarters_tau = T(4.71238898038468985769396507491925432L); |
| 61 | + |
| 62 | + template <class T> |
| 63 | + constexpr T half_tau = T(3.14159265358979323846264338327950288L); |
| 64 | + |
| 65 | + template <class T> |
| 66 | + constexpr T quarter_tau = T(1.57079632679489661923132169163975144L); |
| 67 | + } |
| 68 | + } |
62 | 69 | } |
63 | 70 | } |
64 | 71 |
|
65 | | -#include "xenumclasses.h" |
66 | 72 | #include "xcolor.h" |
67 | 73 | #include "xlinear_algebra.h" |
68 | 74 | #include "xgeometry.h" |
69 | | - |
70 | | -namespace std::experimental::io2d { |
71 | | - inline namespace v1 { |
72 | | - |
73 | | - class image_surface; |
74 | | - class display_surface; |
75 | | - |
76 | | - _IO2D_API int format_stride_for_width(format format, int width) noexcept; |
77 | | - _IO2D_API display_surface make_display_surface(int preferredWidth, |
78 | | - int preferredHeight, format preferredFormat, |
79 | | - scaling scl = scaling::letterbox, |
80 | | - refresh_rate rr = refresh_rate::as_fast_as_possible, float fps = 30.0f); |
81 | | - display_surface make_display_surface(int preferredWidth, |
82 | | - int preferredHeight, format preferredFormat, error_code& ec, |
83 | | - scaling scl = scaling::letterbox, |
84 | | - refresh_rate rr = refresh_rate::as_fast_as_possible, float fps = 30.0f) noexcept; |
85 | | - _IO2D_API display_surface make_display_surface(int preferredWidth, |
86 | | - int preferredHeight, format preferredFormat, int preferredDisplayWidth, |
87 | | - int preferredDisplayHeight, scaling scl = scaling::letterbox, |
88 | | - refresh_rate rr = refresh_rate::as_fast_as_possible, float fps = 30.0f); |
89 | | - display_surface make_display_surface(int preferredWidth, |
90 | | - int preferredHeight, format preferredFormat, int preferredDisplayWidth, |
91 | | - int preferredDisplayHeight, error_code& ec, |
92 | | - scaling scl = scaling::letterbox, |
93 | | - refresh_rate rr = refresh_rate::as_fast_as_possible, float fps = 30.0f) noexcept; |
94 | | - _IO2D_API image_surface make_image_surface(format format, int width, int height); |
95 | | - _IO2D_API image_surface make_image_surface(format format, int width, int height, |
96 | | - error_code& ec) noexcept; |
97 | | - image_surface copy_image_surface(image_surface& sfc) noexcept; |
98 | | - float angle_for_point(point_2d ctr, point_2d pt, |
99 | | - point_2d scl = point_2d{ 1.0f, 1.0f }) noexcept; |
100 | | - point_2d point_for_angle(float ang, float rad = 1.0f) noexcept; |
101 | | - point_2d point_for_angle(float ang, point_2d rad) noexcept; |
102 | | - point_2d arc_start(point_2d ctr, float sang, point_2d rad, |
103 | | - const matrix_2d& m = matrix_2d{}) noexcept; |
104 | | - point_2d arc_center(point_2d cpt, float sang, point_2d rad, |
105 | | - const matrix_2d& m = matrix_2d{}) noexcept; |
106 | | - point_2d arc_end(point_2d cpt, float eang, point_2d rad, |
107 | | - const matrix_2d& m = matrix_2d{}) noexcept; |
108 | | - } |
109 | | -} |
110 | | - |
| 75 | +#include "xtext.h" |
111 | 76 | #include "xpath.h" |
112 | 77 | #include "xbrushes.h" |
113 | 78 | #include "xsurfaces.h" |
| 79 | +#include "xinput.h" |
| 80 | + |
| 81 | +namespace std { |
| 82 | + namespace experimental { |
| 83 | + namespace io2d { |
| 84 | + inline namespace v1 { |
| 85 | + |
| 86 | + using dashes = tuple<vector<float>, float>; |
| 87 | + |
| 88 | + enum class wrap_mode; |
| 89 | + enum class filter; |
| 90 | + enum class brush_type; |
| 91 | + enum class antialias; |
| 92 | + enum class fill_rule; |
| 93 | + enum class line_cap; |
| 94 | + enum class line_join; |
| 95 | + enum class compositing_op; |
| 96 | + enum class format; |
| 97 | + enum class scaling; |
| 98 | + enum class refresh_rate; |
| 99 | + enum class image_file_format; |
| 100 | + |
| 101 | + class bounding_box; |
| 102 | + constexpr bool operator==(const bounding_box& lhs, const bounding_box& rhs) |
| 103 | + noexcept; |
| 104 | + constexpr bool operator!=(const bounding_box& lhs, const bounding_box& rhs) |
| 105 | + noexcept; |
| 106 | + |
| 107 | + class circle; |
| 108 | + constexpr bool operator==(const circle& lhs, const circle& rhs) noexcept; |
| 109 | + constexpr bool operator!=(const circle& lhs, const circle& rhs) noexcept; |
| 110 | + |
| 111 | + class rgba_color; |
| 112 | + constexpr bool operator==(const rgba_color& lhs, const rgba_color& rhs) |
| 113 | + noexcept; |
| 114 | + constexpr bool operator!=(const rgba_color& lhs, const rgba_color& rhs) |
| 115 | + noexcept; |
| 116 | + template <class T> |
| 117 | + constexpr rgba_color operator*(const rgba_color& lhs, T rhs) noexcept; |
| 118 | + template <class U> |
| 119 | + constexpr rgba_color operator*(const rgba_color& lhs, U rhs) noexcept; |
| 120 | + template <class T> |
| 121 | + constexpr rgba_color operator*(T lhs, const rgba_color& rhs) noexcept; |
| 122 | + template <class U> |
| 123 | + constexpr rgba_color operator*(U lhs, const rgba_color& rhs) noexcept; |
| 124 | + |
| 125 | + class point_2d; |
| 126 | + constexpr bool operator==(const point_2d& lhs, const point_2d& rhs) |
| 127 | + noexcept; |
| 128 | + constexpr bool operator!=(const point_2d& lhs, const point_2d& rhs) |
| 129 | + noexcept; |
| 130 | + constexpr point_2d operator+(const point_2d& lhs) noexcept; |
| 131 | + constexpr point_2d operator+(const point_2d& lhs, const point_2d& rhs) |
| 132 | + noexcept; |
| 133 | + constexpr point_2d operator-(const point_2d& lhs) noexcept; |
| 134 | + constexpr point_2d operator-(const point_2d& lhs, const point_2d& rhs) |
| 135 | + noexcept; |
| 136 | + constexpr point_2d operator*(const point_2d& lhs, float rhs) noexcept; |
| 137 | + constexpr point_2d operator*(float lhs, const point_2d& rhs) noexcept; |
| 138 | + |
| 139 | + class matrix_2d; |
| 140 | + constexpr matrix_2d operator*(const matrix_2d& lhs, const matrix_2d& rhs) |
| 141 | + noexcept; |
| 142 | + constexpr bool operator==(const matrix_2d& lhs, const matrix_2d& rhs) |
| 143 | + noexcept; |
| 144 | + constexpr bool operator!=(const matrix_2d& lhs, const matrix_2d& rhs) |
| 145 | + noexcept; |
| 146 | + |
| 147 | + namespace figure_items { |
| 148 | + class abs_new_figure; |
| 149 | + constexpr bool operator==(const abs_new_figure&, const abs_new_figure&) |
| 150 | + noexcept; |
| 151 | + constexpr bool operator!=(const abs_new_figure&, const abs_new_figure&) |
| 152 | + noexcept; |
| 153 | + |
| 154 | + class rel_new_figure; |
| 155 | + constexpr bool operator==(const rel_new_figure&, const rel_new_figure&) |
| 156 | + noexcept; |
| 157 | + constexpr bool operator!=(const rel_new_figure&, const rel_new_figure&) |
| 158 | + noexcept; |
| 159 | + |
| 160 | + class close_figure; |
| 161 | + constexpr bool operator==(const close_figure&, const close_figure&) noexcept; |
| 162 | + constexpr bool operator!=(const close_figure&, const close_figure&) noexcept; |
| 163 | + |
| 164 | + class abs_matrix; |
| 165 | + constexpr bool operator==(const abs_matrix&, const abs_matrix&) noexcept; |
| 166 | + constexpr bool operator!=(const abs_matrix&, const abs_matrix&) noexcept; |
| 167 | + |
| 168 | + class rel_matrix; |
| 169 | + constexpr bool operator==(const rel_matrix&, const rel_matrix&) noexcept; |
| 170 | + constexpr bool operator!=(const rel_matrix&, const rel_matrix&) noexcept; |
| 171 | + |
| 172 | + class revert_matrix; |
| 173 | + constexpr bool operator==(const revert_matrix&, const revert_matrix&) |
| 174 | + noexcept; |
| 175 | + constexpr bool operator!=(const revert_matrix&, const revert_matrix&) |
| 176 | + noexcept; |
| 177 | + |
| 178 | + class abs_cubic_curve; |
| 179 | + constexpr bool operator==(const abs_cubic_curve&, const abs_cubic_curve&) |
| 180 | + noexcept; |
| 181 | + constexpr bool operator!=(const abs_cubic_curve&, const abs_cubic_curve&) |
| 182 | + noexcept; |
| 183 | + |
| 184 | + class abs_line; |
| 185 | + constexpr bool operator==(const abs_line&, const abs_line&) noexcept; |
| 186 | + constexpr bool operator!=(const abs_line&, const abs_line&) noexcept; |
| 187 | + |
| 188 | + class abs_quadratic_curve; |
| 189 | + constexpr bool operator==(const abs_quadratic_curve&, |
| 190 | + const abs_quadratic_curve&) noexcept; |
| 191 | + constexpr bool operator!=(const abs_quadratic_curve&, |
| 192 | + const abs_quadratic_curve&) noexcept; |
| 193 | + |
| 194 | + class arc; |
| 195 | + constexpr bool operator==(const arc&, const arc&) noexcept; |
| 196 | + constexpr bool operator!=(const arc&, const arc&) noexcept; |
| 197 | + |
| 198 | + class rel_cubic_curve; |
| 199 | + constexpr bool operator==(const rel_cubic_curve&, const rel_cubic_curve&) |
| 200 | + noexcept; |
| 201 | + constexpr bool operator!=(const rel_cubic_curve&, const rel_cubic_curve&) |
| 202 | + noexcept; |
| 203 | + |
| 204 | + class rel_line; |
| 205 | + constexpr bool operator==(const rel_line&, const rel_line&) noexcept; |
| 206 | + constexpr bool operator!=(const rel_line&, const rel_line&) noexcept; |
| 207 | + |
| 208 | + class rel_quadratic_curve; |
| 209 | + constexpr bool operator==(const rel_quadratic_curve&, |
| 210 | + const rel_quadratic_curve&) noexcept; |
| 211 | + constexpr bool operator!=(const rel_quadratic_curve&, |
| 212 | + const rel_quadratic_curve&) noexcept; |
| 213 | + |
| 214 | + using figure_item = variant<abs_cubic_curve, abs_line, abs_matrix, |
| 215 | + abs_new_figure, abs_quadratic_curve, arc, close_figure, |
| 216 | + rel_cubic_curve, rel_line, rel_matrix, rel_new_figure, rel_quadratic_curve, |
| 217 | + revert_matrix>; |
| 218 | + } |
| 219 | + |
| 220 | + class interpreted_path; |
| 221 | + template <class Allocator = allocator<figure_items::figure_items_types>> |
| 222 | + |
| 223 | + class path_builder; |
| 224 | + template <class Allocator> |
| 225 | + bool operator==(const path_builder<Allocator>& lhs, |
| 226 | + const path_builder<Allocator>& rhs) noexcept; |
| 227 | + template <class Allocator> |
| 228 | + bool operator!=(const path_builder<Allocator>& lhs, |
| 229 | + const path_builder<Allocator>& rhs) noexcept; |
| 230 | + template <class Allocator> |
| 231 | + void swap(path_builder<Allocator>& lhs, path_builder<Allocator>& rhs) |
| 232 | + noexcept(noexcept(lhs.swap(rhs))) { // Compiler error prevents forwrad declaration |
| 233 | + lhs.swap(rhs); |
| 234 | + } |
| 235 | + |
| 236 | + class gradient_stop; |
| 237 | + constexpr bool operator==(const gradient_stop& lhs, const gradient_stop& rhs) |
| 238 | + noexcept; |
| 239 | + constexpr bool operator!=(const gradient_stop& lhs, const gradient_stop& rhs) |
| 240 | + noexcept; |
| 241 | + |
| 242 | + class brush; |
| 243 | + class render_props; |
| 244 | + class brush_props; |
| 245 | + class clip_props; |
| 246 | + class stroke_props; |
| 247 | + class mask_props; |
| 248 | + class surface; |
| 249 | + class image_surface; |
| 250 | + class display_surface; |
| 251 | + class mapped_surface; |
| 252 | + |
| 253 | + int format_stride_for_width(format format, int width) noexcept; |
| 254 | + |
| 255 | + display_surface make_display_surface(int preferredWidth, |
| 256 | + int preferredHeight, format preferredFormat, |
| 257 | + scaling scl = scaling::letterbox); |
| 258 | + |
| 259 | + display_surface make_display_surface(int preferredWidth, |
| 260 | + int preferredHeight, format preferredFormat, error_code& ec, |
| 261 | + scaling scl = scaling::letterbox) noexcept; |
| 262 | + |
| 263 | + display_surface make_display_surface(int preferredWidth, |
| 264 | + int preferredHeight, format preferredFormat, int preferredDisplayWidth, |
| 265 | + int preferredDisplayHeight, scaling scl = scaling::letterbox); |
| 266 | + |
| 267 | + display_surface make_display_surface(int preferredWidth, |
| 268 | + int preferredHeight, format preferredFormat, int preferredDisplayWidth, |
| 269 | + int preferredDisplayHeight, error_code& ec, |
| 270 | + scaling scl = scaling::letterbox) noexcept; |
| 271 | + |
| 272 | + image_surface make_image_surface(format format, int width, int height); |
| 273 | + |
| 274 | + image_surface make_image_surface(format format, int width, int height, |
| 275 | + error_code& ec) noexcept; |
| 276 | + |
| 277 | + image_surface copy_image_surface(image_surface& sfc) noexcept; |
| 278 | + |
| 279 | + float angle_for_point(point_2d ctr, point_2d pt, |
| 280 | + point_2d scl = point_2d{ 1.0f, 1.0f }) noexcept; |
| 281 | + |
| 282 | + point_2d point_for_angle(float ang, float rad = 1.0f) noexcept; |
| 283 | + |
| 284 | + point_2d point_for_angle(float ang, point_2d rad) noexcept; |
| 285 | + |
| 286 | + point_2d arc_start(point_2d ctr, float sang, point_2d rad, |
| 287 | + const matrix_2d& m = matrix_2d{}) noexcept; |
| 288 | + |
| 289 | + point_2d arc_center(point_2d cpt, float sang, point_2d rad, |
| 290 | + const matrix_2d& m = matrix_2d{}) noexcept; |
| 291 | + |
| 292 | + point_2d arc_end(point_2d cpt, float eang, point_2d rad, |
| 293 | + const matrix_2d& m = matrix_2d{}) noexcept; |
| 294 | + } |
| 295 | + } |
| 296 | + } |
| 297 | +} |
114 | 298 |
|
115 | 299 | #include "xio2d_impl.h" |
116 | 300 | #endif |
0 commit comments