FastUIDraw
painter_enums.hpp
Go to the documentation of this file.
1 /*!
2  * \file painter_enums.hpp
3  * \brief file painter_enums.hpp
4  *
5  * Copyright 2016 by Intel.
6  *
7  * Contact: kevin.rogovin@gmail.com
8  *
9  * This Source Code Form is subject to the
10  * terms of the Mozilla Public License, v. 2.0.
11  * If a copy of the MPL was not distributed with
12  * this file, You can obtain one at
13  * http://mozilla.org/MPL/2.0/.
14  *
15  * \author Kevin Rogovin <kevin.rogovin@gmail.com>
16  *
17  */
18 
19 
20 #ifndef FASTUIDRAW_PAINTER_ENUMS_HPP
21 #define FASTUIDRAW_PAINTER_ENUMS_HPP
22 
23 #include <fastuidraw/util/util.hpp>
24 
25 namespace fastuidraw
26 {
27 /*!\addtogroup Painter
28  * @{
29  */
30 
31  /*!
32  * \brief
33  * Class to contain various enumerations needed for
34  * describing a brush.
35  */
37  {
38  public:
39  /*!
40  * Enumeration to specify how a value is interpreted
41  * outside of its natural range. For gradients the
42  * range is [0, 1] acting on its interpolate.
43  */
45  {
46  /*!
47  * Clamp the value to its range, i.e.
48  * for a value t on a range [A, B] the
49  * value is clamp(r, A, B).
50  */
52 
53  /*!
54  * Mirror the value across the start of
55  * its range, i.e. for a value t on a
56  * range [A, B] the value is
57  * clamp(A + abs(t - A), A, B)
58  */
60 
61  /*!
62  * Repeat the value to its range, i.e.
63  * for a value t on a range [A, B] the
64  * value is A + mod(t - A, B - A)
65  */
67 
68  /*!
69  * Mirror repeat the value across the start
70  * of its range, i.e. for a value t on a
71  * range [A, B] the value is
72  * B - abs(mod(t - A, 2 * (B - A)) - (B - A))
73  */
75 
76  number_spread_types
77  };
78 
79  /*!
80  * \brief
81  * Enumeration specifying what filter to apply to an image
82  */
83  enum filter_t
84  {
85  /*!
86  * Indicates to use nearest filtering (i.e
87  * choose closest pixel).
88  */
90 
91  /*!
92  * Indicates to use bilinear filtering.
93  */
95 
96  /*!
97  * Indicates to use bicubic filtering.
98  */
100  };
101 
102  /*!
103  * enumeration to specify mipmapping on an image
104  */
105  enum mipmap_t
106  {
107  /*!
108  * Indicates to apply mipmap filtering
109  */
111 
112  /*!
113  * Indicates to not apply mipmap filtering
114  */
116  };
117 
118  /*!
119  * enumeration to describe a gradient type.
120  */
122  {
123  /*!
124  * indicates the lack of a gradient.
125  */
127 
128  /*!
129  * Indicates a linear gradient; a linear gradient is defined
130  * by two points p0 and p1 where the interpolate at a point p
131  * is the value of dot(p - p0, p1 - p0) / dot(p0 - p1, p0 - p1).
132  */
134 
135  /*!
136  * Indicates a radial gradient; a radial gradient is defined
137  * by two circles C0 = Circle(p0, r0), C1 = Circle(p1, r1)
138  * where the interpolate at a point p is the time t when p
139  * is on the circle C(t) where C(t) = Circle(p(t), r(t)),
140  * p(t) = p0 + (p1 - p0) * t and r(t) = r0 + (r1 - r0) * t.
141  */
143 
144  /*!
145  * Indicates a sweep gradient; a sweep gradient is defined by
146  * a single point C, an angle theta (in radians), a sign S and
147  * a factor F. The angle theta represents at what angle the
148  * gradient starts, the point C is the center point of the
149  * sweep, the sign of S represents the angle orientation and
150  * the factor F reprsents how many times the gradient is to be
151  * repated. Precisely, the interpolate at a point p is defined
152  * as t_interpolate where
153  * \code
154  * vec2 d = p - C;
155  * float theta, v;
156  * theta = S * atan(d.y, d.x);
157  * if (theta < alpha )
158  * {
159  * theta += 2 * PI;
160  * }
161  * theta -= alpha;
162  * v = (theta - angle) / (2 * PI);
163  * t_interpolate = (S < 0.0) ? F * (1.0 - v) : F * v;
164  * \endcode
165  */
167 
168  number_gradient_types,
169  };
170  };
171 
172  /*!
173  * \brief
174  * Class to encapsulate enumerations used in Painter
175  * interface, part of the main library libFastUIDraw.
176  */
178  public PainterBrushEnums
179  {
180  public:
181  /*!
182  * \brief
183  * Enumeration to indicate in what direction the
184  * y-coordinate increases
185  */
187  {
188  y_increases_downwards, /*!< y-coordinate increases downwards */
189  y_increases_upwards, /*!< y-coordinate increases upwards */
190 
191  number_screen_orientation,
192  };
193 
194  /*!
195  * \brief
196  * Enumeration to specify orientation of a rotation
197  */
199  {
200  clockwise, /*!< indicates clockwise */
201  counter_clockwise, /*!< indicates counter-clockwise */
202 
203  number_rotation_orientation
204  };
205 
206  /*!
207  * \brief
208  * Enumeration to indicate if glyph layout is horizontal
209  * or vertical
210  */
212  {
213  /*!
214  * Glyphs are layed out horizontally, thus will use
215  * \ref GlyphMetrics::horizontal_layout_offset()
216  * to offset the glyphs.
217  */
219 
220  /*!
221  * Glyphs are layed out vertically, thus will use
222  * \ref GlyphMetrics::vertical_layout_offset()
223  * to offset the glyphs.
224  */
226 
227  number_glyph_layout
228  };
229 
230  /*!
231  * \brief
232  * Enumeration specifying if and how to draw caps when stroking.
233  */
235  {
236  flat_caps, /*!< indicates to have flat (i.e. no) caps when stroking */
237  rounded_caps, /*!< indicates to have rounded caps when stroking */
238  square_caps, /*!< indicates to have square caps when stroking */
239 
240  number_cap_styles /*!< number of cap styles */
241  };
242 
243  /*!
244  * \brief
245  * Enumeration specifying if and how to draw joins when stroking
246  */
248  {
249  /*!
250  * indicates to stroke without joins
251  */
253 
254  /*!
255  * indicates to stroke with rounded joins
256  */
258 
259  /*!
260  * indicates to stroke with bevel joins
261  */
263 
264  /*!
265  * indicates to stroke with miter joins where if miter distance
266  * is exceeded then the miter join is clipped to the miter
267  * distance.
268  */
270 
271  /*!
272  * indicates to stroke with miter joins where if miter distance
273  * is exceeded then the miter join is drawn as a bevel join.
274  */
276 
277  /*!
278  * indicates to stroke with miter joins where if miter distance
279  * is exceeded then the miter-tip is truncated to the miter
280  * distance.
281  */
283 
284  number_join_styles, /*!< number of join styles */
285  };
286 
287  /*!
288  * \brief
289  * Enumerations specifying common fill rules.
290  */
292  {
293  odd_even_fill_rule, /*!< indicates to use odd-even fill rule */
294  complement_odd_even_fill_rule, /*!< indicates to give the complement of the odd-even fill rule */
295  nonzero_fill_rule, /*!< indicates to use the non-zero fill rule */
296  complement_nonzero_fill_rule, /*!< indicates to give the complement of the non-zero fill rule */
297 
298  number_fill_rule /*!< count of enums */
299  };
300 
301  /*!
302  * Enumeration to specify how to stroke
303  */
305  {
306  /*!
307  * Use linear stroking taken directly from the
308  * Path. Thus the passed \ref StrokedPath only
309  * consists of line segments.
310  */
312 
313  /*!
314  * Use arc-stroking, i.e. the passed \ref
315  * StrokedPath has both arc-segments and
316  * line segments. This results in fewer
317  * vertices with the fragment shader
318  * computing per-pixel coverage.
319  */
321 
322  /*!
323  *
324  */
325  stroking_method_number_precise_choices,
326 
327  /* make the modes that indicate to choose to come
328  * after the modes that precisely specify a value.
329  */
330 
331  /*!
332  * Choose for optimal performance.
333  */
334  stroking_method_fastest = stroking_method_number_precise_choices,
335 
336  /*!
337  * Number of stroking enums present.
338  */
340  };
341 
342  /*!
343  * \brief
344  * Enumeration specifying blend modes. The following function-formulas
345  * are used in a number of the blend modes:
346  * \code
347  * UndoAlpha(C.rgba) = (0, 0, 0) if Ca = 0
348  * C.rgb / C.a otherwise
349  * MinColorChannel(C.rgb) = min(C.r, C.g, C.b)
350  * MaxColorChannel(C.rgb) = max(C.r, C.g, C.b)
351  * Luminosity(C.rgb) = dot(C.rgb, vec3(0.30, 0.59, 0.11))
352  * Saturation(C.rgb) = MaxColorChannel(C.rgb) - MinColorChannel(C.rgb)
353  * \endcode
354  * The next set of functions are a little messier and written in GLSL
355  * \code
356  * vec3 ClipColor(in vec3 C)
357  * {
358  * float L = Luminosity(C);
359  * float MinC = MinColorChannel(C);
360  * float MaxC = MaxColorChannel(C);
361  * if (MinC < 0.0)
362  * C = vec3(L) + (C - vec3(L)) * (L / (L - MinC));
363  * if (MaxC > 1.0)
364  * C = vec3(L) + (C - vec3(L)) * ((1 - L) / (MaxC - L));
365  * return C;
366  * }
367  *
368  * vec3 OverrideLuminosity(vec3 C, vec3 L)
369  * {
370  * float Clum = Luminosity(C);
371  * float Llum = Luminosity(L);
372  * float Delta = Llum - Clum;
373  * return ClipColor(C + vec3(Delta));
374  * }
375  *
376  * vec3 OverrideLuminosityAndSaturation(vec3 C, vec3 S, vec3 L)
377  * {
378  * float Cmin = MinColorChannel(C);
379  * float Csat = Saturation(C);
380  * float Ssat = Saturation(S);
381  * if (Csat > 0.0)
382  * {
383  * C = (C - Cmin) * Ssat / Csat;
384  * }
385  * else
386  * {
387  * C = vec3(0.0);
388  * }
389  * return OverrideLuminosity(C, L);
390  * }
391  * \endcode
392  */
394  {
395  /*!
396  * Porter-Duff clear mode. Letting S be the value from the
397  * fragment shader and D be the current value in the framebuffer,
398  * replaces the value in the framebuffer with F where
399  * F.rgba = (0, 0, 0, 0).
400  */
402 
403  /*!
404  * Porter-Duff src mode. Letting S be the value from the
405  * fragment shader and D be the current value in the framebuffer,
406  * replaces the value in the framebuffer with F where F = S.
407  */
409 
410  /*!
411  * Porter-Duff dst mode. Letting S be the value from the
412  * fragment shader and D be the current value in the framebuffer,
413  * replaces the value in the framebuffer with F = D.
414  */
416 
417  /*!
418  * Porter-Duff src-over mode. Letting S be the value from the
419  * fragment shader and D be the current value in the framebuffer,
420  * replaces the value in the framebuffer with F where F is:
421  * \code
422  * F.a = S.a + D.a * (1 - S.a)
423  * F.rgb = S.rgb + D.rgb * (1 - S.a)
424  * \endcode
425  */
427 
428  /*!
429  * Porter-Duff dst-over mode. Letting S be the value from the
430  * fragment shader and D be the current value in the framebuffer,
431  * replaces the value in the framebuffer with F where F is:
432  * \code
433  * F.a = D.a + S.a * (1 - D.a)
434  * F.rgb = D.rgb + S.rgb * (1 - D.a)
435  * \endcode
436  */
438 
439  /*!
440  * Porter-Duff src-in mode. Letting S be the value from the
441  * fragment shader and D be the current value in the framebuffer,
442  * replaces the value in the framebuffer with F where F is:
443  * \code
444  * F.a = S.a * D.a
445  * F.rgb = S.rgb * D.a
446  * \endcode
447  */
449 
450  /*!
451  * Porter-Duff dst-in mode. Letting S be the value from the
452  * fragment shader and D be the current value in the framebuffer,
453  * replaces the value in the framebuffer with F where F is
454  * \code
455  * F.a = S.a * D.a
456  * F.rgb = D.rgb * S.a
457  * \endcode
458  */
460 
461  /*!
462  * Porter-Duff mode. Letting S be the value from the
463  * fragment shader and D be the current value in the framebuffer,
464  * replaces the value in the framebuffer with F where F is:
465  * \code
466  * F.a = S.a * (1 - D.a)
467  * F.rgb = S.rgb * (1 - D.a)
468  * \endcode
469  */
471 
472  /*!
473  * Porter-Duff src-out mode. Letting S be the value from the
474  * fragment shader and D be the current value in the framebuffer,
475  * replaces the value in the framebuffer with F where F is:
476  * \code
477  * F.a = D.a * (1.0 - S.a)
478  * F.rgb = D.rgb * (1.0 - S.a)
479  * \endcode
480  */
482 
483  /*!
484  * Porter-Duff src-atop mode. Letting S be the value from the
485  * fragment shader and D be the current value in the framebuffer,
486  * replaces the value in the framebuffer with F where F is:
487  * \code
488  * F.a = D.a
489  * F.rgb = S.rgb * D.a + D.rgb * (1.0 - S.a)
490  * \endcode
491  */
493 
494  /*!
495  * Porter-Duff dst-atop mode. Letting S be the value from the
496  * fragment shader and D be the current value in the framebuffer,
497  * replaces the value in the framebuffer with F where F is:
498  * \code
499  * F.a = S.a
500  * F.rgb = D.rgb * S.a + S.rgb * (1 - D.a)
501  * \endcode
502  */
504 
505  /*!
506  * Porter-Duff xor mode. Letting S be the value from the
507  * fragment shader and D be the current value in the framebuffer,
508  * replaces the value in the framebuffer with F where F is:
509  * \code
510  * F.a = S.a * (1 - D.a) + D.a * (1 - S.a)
511  * F.rgb = S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
512  * \endcode
513  */
515 
516  /*!
517  * Plus blend mode. Letting S be the value from the
518  * fragment shader and D be the current value in the framebuffer,
519  * replaces the value in the framebuffer with F where F is:
520  * \code
521  * F.a = S.a + D.a
522  * F.rgb = S.rgb + D.rgb
523  * \endcode
524  */
526 
527  /*!
528  * Modulate blend mode. Letting S be the value from the
529  * fragment shader and D be the current value in the framebuffer,
530  * replaces the value in the framebuffer with F where F is:
531  * \code
532  * F.a = S.a * D.a
533  * F.rgb = S.rgb * D.rgb
534  * \endcode
535  */
537 
538  /*!
539  * Screen mode. Letting S be the value from the
540  * fragment shader and D be the current value in the framebuffer,
541  * replaces the value in the framebuffer with F where F is:
542  * \code
543  * F.a = S.a + D.a * (1 - S.a)
544  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
545  * \endcode
546  * where for each channel c,
547  * \code
548  * f(S, D).c = S.c + D.c - S.c * D.c
549  * \endcode
550  */
552 
553  /*!
554  * Overlay mode. Letting S be the value from the
555  * fragment shader and D be the current value in the framebuffer,
556  * replaces the value in the framebuffer with F where F is:
557  * \code
558  * F.a = S.a + D.a * (1 - S.a)
559  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
560  * \endcode
561  * where for each channel c,
562  * \code
563  * f(S, D).c =
564  * 2 * S * D, if D <= 0.5
565  * 1 - 2 * (1 - S) * (1 - D), otherwise
566  * \endcode
567  */
569 
570  /*!
571  * Darken mode. Letting S be the value from the
572  * fragment shader and D be the current value in the framebuffer,
573  * replaces the value in the framebuffer with F where F is:
574  * \code
575  * F.a = S.a + D.a * (1 - S.a)
576  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
577  * \endcode
578  * where for each channel c,
579  * \code
580  * f(S, D).c = min(S, D)
581  * \endcode
582  */
584 
585  /*!
586  * Lighten mode. Letting S be the value from the
587  * fragment shader and D be the current value in the framebuffer,
588  * replaces the value in the framebuffer with F where F is:
589  * \code
590  * F.a = S.a + D.a * (1 - S.a)
591  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
592  * \endcode
593  * where for each channel c,
594  * \code
595  * f(S, D).c = max(S.c, D.c)
596  * \endcode
597  */
599 
600  /*!
601  * Color dodge mode. Letting S be the value from the
602  * fragment shader and D be the current value in the framebuffer,
603  * replaces the value in the framebuffer with F where F is:
604  * \code
605  * F.a = S.a + D.a * (1 - S.a)
606  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
607  * \endcode
608  * where for each channel c,
609  * \code
610  * f(S, D).c =
611  * 0, if D.c <= 0
612  * min(1, D.c / (1 - S.c)), if D.c > 0 and S.c < 1
613  * 1, if D.c > 0 and S.c >= 1
614  * \endcode
615  */
617 
618  /*!
619  * Color burn mode. Letting S be the value from the
620  * fragment shader and D be the current value in the framebuffer,
621  * replaces the value in the framebuffer with F where F is:
622  * \code
623  * F.a = S.a + D.a * (1 - S.a)
624  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
625  * \endcode
626  * where for each channel c,
627  * \code
628  * f(S, D).c =
629  * 1, if D.c >= 1
630  * 1 - min(1, (1 - D.c) / S.c), if D.c < 1 and S.c > 0
631  * 0, if D.c < 1 and S.c <= 0
632  * \endcode
633  */
635 
636  /*!
637  * Harlight mode. Letting S be the value from the
638  * fragment shader and D be the current value in the framebuffer,
639  * replaces the value in the framebuffer with F where F is:
640  * \code
641  * F.a = S.a + D.a * (1 - S.a)
642  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
643  * \endcode
644  * where for each channel c,
645  * \code
646  * f(S, D).c = 2 * S.c * D.c, if S.c <= 0.5
647  * 1 - 2 * (1 - S.c) * (1 - D.c), otherwise
648  * \endcode
649  */
651 
652  /*!
653  * Softlight mode. Letting S be the value from the
654  * fragment shader and D be the current value in the framebuffer,
655  * replaces the value in the framebuffer with F where F is:
656  * \code
657  * F.a = S.a + D.a * (1 - S.a)
658  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
659  * \endcode
660  * where for each channel c,
661  * \code
662  * f(S, D).c =
663  * D.c - (1 - 2 * S.c) * D.c * (1 - D.c), if S.c <= 0.5
664  * D.c + (2 * S.c - 1) * D.c * ((16 * D.c - 12) * D.c + 3), if S.c > 0.5 and D.c <= 0.25
665  * D.c + (2 * S.c - 1) * (sqrt(D.c) - D.c), if S.c > 0.5 and D.c > 0.25
666  * \endcode
667  */
669 
670  /*!
671  * Difference mode. Letting S be the value from the
672  * fragment shader and D be the current value in the framebuffer,
673  * replaces the value in the framebuffer with F where F is:
674  * \code
675  * F.a = S.a + D.a * (1 - S.a)
676  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
677  * \endcode
678  * where for each channel c,
679  * \code
680  * f(S, D).c = abs(S.c - D.c)
681  * \endcode
682  */
684 
685  /*!
686  * Exclusion mode. Letting S be the value from the
687  * fragment shader and D be the current value in the framebuffer,
688  * replaces the value in the framebuffer with F where F is:
689  * \code
690  * F.a = S.a + D.a * (1 - S.a)
691  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
692  * \endcode
693  * where for each channel c,
694  * \code
695  * f(S, D).c = S.c + D.c - 2 * S.c * D.c
696  * \endcode
697  */
699 
700  /*!
701  * Multiply mode. Letting S be the value from the
702  * fragment shader and D be the current value in the framebuffer,
703  * replaces the value in the framebuffer with F where F is:
704  * \code
705  * F.a = S.a + D.a * (1 - S.a)
706  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
707  * \endcode
708  * where for each channel c,
709  * \code
710  * f(S, D).c = S.c * D.c
711  * \endcode
712  */
714 
715  /*!
716  * Hue mode. Letting S be the value from the
717  * fragment shader and D be the current value in the framebuffer,
718  * replaces the value in the framebuffer with F where F is:
719  * \code
720  * F.a = S.a + D.a * (1 - S.a)
721  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
722  * \endcode
723  * where
724  * \code
725  * f(S.rgb, D.rgb).rgb = OverrideLuminosityAndSaturation(S.rgb, D.rgb, D.rgb)
726  * \endcode
727  */
729 
730  /*!
731  * Saturation mode. Letting S be the value from the
732  * fragment shader and D be the current value in the framebuffer,
733  * replaces the value in the framebuffer with F where F is:
734  * \code
735  * F.a = S.a + D.a * (1 - S.a)
736  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
737  * \endcode
738  * where
739  * \code
740  * f(S.rgb, D.rgb).rgb = OverrideLuminosityAndSaturation(D.rgb, S.rgb, D.rgb)
741  * \endcode
742  */
744 
745  /*!
746  * Color mode. Letting S be the value from the
747  * fragment shader and D be the current value in the framebuffer,
748  * replaces the value in the framebuffer with F where F is:
749  * \code
750  * F.a = S.a + D.a * (1 - S.a)
751  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
752  * \endcode
753  * where
754  * \code
755  * f(S.rgb, D.rgb).rgb = OverrideLuminosity(S.rgb, D.rgb)
756  * \endcode
757  */
759 
760  /*!
761  * Luminosity mode. Letting S be the value from the
762  * fragment shader and D be the current value in the framebuffer,
763  * replaces the value in the framebuffer with F where F is:
764  * \code
765  * F.a = S.a + D.a * (1 - S.a)
766  * F.rgb = f(UndoAlpha(S), UndoAlpha(D)) * S.a * D.a + S.rgb * (1 - D.a) + D.rgb * (1 - S.a)
767  * \endcode
768  * where
769  * \code
770  * f(S.rgb, D.rgb).rgb = OverrideLuminosity(D.rgb, S.rgb)
771  * \endcode
772  */
774 
775  number_blend_mode,
776  };
777 
778  /*!
779  * \brief
780  * Enumeration to query the statistics of how
781  * much data has been packed
782  */
784  {
785  /*!
786  * Offset to how many attributes processed
787  */
789 
790  /*!
791  * Offset to how many indices processed
792  */
794 
795  /*!
796  * Offset to how many uvec4 values placed
797  * onto store buffer(s).
798  */
800 
801  /*!
802  * Offset to how many PainterDraw objects sent
803  */
805 
806  /*!
807  * Offset to how many painter headers packed.
808  */
810 
811  /*!
812  * Number of distinct render targets needed.
813  */
815 
816  /*!
817  * Number of times PainterBackend::end() was called
818  */
820 
821  /*!
822  * Number of begin_layer()/end_layer() pairs called
823  */
825 
826  /*!
827  * Number of begin_coverage_buffer()/end_coverage_buffer() pairs called
828  */
830  };
831 
832  /*!
833  * Given a fill rule, return the fill rule for the complement.
834  */
835  static
836  enum fill_rule_t
837  complement_fill_rule(enum fill_rule_t f);
838 
839  /*!
840  * Returns true if a \ref join_style is a miter-type join, i.e.
841  * one of \ref miter_clip_joins, \ref miter_bevel_joins or
842  * \ref miter_joins.
843  * \param js join style to query
844  */
845  static
846  inline
847  bool
849  {
850  return js == miter_clip_joins
851  || js == miter_bevel_joins
852  || js == miter_joins;
853  }
854 
855  /*!
856  * Returns a \ref c_string for an enumerated value.
857  * \param v value to get the label-string of.
858  */
859  static
860  c_string
861  label(enum screen_orientation v);
862 
863  /*!
864  * Returns a \ref c_string for an enumerated value.
865  * \param v value to get the label-string of.
866  */
867  static
868  c_string
869  label(enum rotation_orientation_t v);
870 
871  /*!
872  * Returns a \ref c_string for an enumerated value.
873  * \param v value to get the label-string of.
874  */
875  static
876  c_string
877  label(enum glyph_layout_type v);
878 
879  /*!
880  * Returns a \ref c_string for an enumerated value.
881  * \param v value to get the label-string of.
882  */
883  static
884  c_string
885  label(enum cap_style v);
886 
887  /*!
888  * Returns a \ref c_string for an enumerated value.
889  * \param v value to get the label-string of.
890  */
891  static
892  c_string
893  label(enum join_style v);
894 
895  /*!
896  * Returns a \ref c_string for an enumerated value.
897  * \param v value to get the label-string of.
898  */
899  static
900  c_string
901  label(enum fill_rule_t v);
902 
903  /*!
904  * Returns a \ref c_string for an enumerated value.
905  * \param v value to get the label-string of.
906  */
907  static
908  c_string
909  label(enum stroking_method_t v);
910 
911  /*!
912  * Returns a \ref c_string for an enumerated value.
913  * \param v value to get the label-string of.
914  */
915  static
916  c_string
917  label(enum blend_mode_t v);
918 
919  /*!
920  * Returns a \ref c_string for an enumerated value.
921  * \param v value to get the label-string of.
922  */
923  static
924  c_string
925  label(enum query_stats_t v);
926  };
927 /*! @} */
928 }
929 
930 #endif
screen_orientation
Enumeration to indicate in what direction the y-coordinate increases.
all classes and functions of FastUIDraw are in the namespace fastuidraw.
Definition: colorstop.hpp:28
query_stats_t
Enumeration to query the statistics of how much data has been packed.
blend_mode_t
Enumeration specifying blend modes. The following function-formulas are used in a number of the blend...
cap_style
Enumeration specifying if and how to draw caps when stroking.
Class to encapsulate enumerations used in Painter interface, part of the main library libFastUIDraw...
file util.hpp
static bool is_miter_join(enum join_style js)
join_style
Enumeration specifying if and how to draw joins when stroking.
glyph_layout_type
Enumeration to indicate if glyph layout is horizontal or vertical.
rotation_orientation_t
Enumeration to specify orientation of a rotation.
fill_rule_t
Enumerations specifying common fill rules.
filter_t
Enumeration specifying what filter to apply to an image.
const char * c_string
Conveniant typedef for C-style strings.
Definition: util.hpp:135
Class to contain various enumerations needed for describing a brush.