RetroArch
d2d1_3helper.h
Go to the documentation of this file.
1 
2 /*=========================================================================*\
3 
4  Copyright (c) Microsoft Corporation. All rights reserved.
5 
6  File: D2D1_3Helper.h
7 
8  Module Name: D2D
9 
10  Description: Helper files over the D2D interfaces and APIs.
11 
12 \*=========================================================================*/
13 
14 #ifdef _MSC_VER
15 #pragma once
16 #endif // _MSC_VER
17 
18 #ifndef _D2D1_3HELPER_H_
19 #define _D2D1_3HELPER_H_
20 
21 #if NTDDI_VERSION >= NTDDI_WINTHRESHOLD
22 
23 #ifndef _D2D1_3_H_
24 #include <d2d1_3.h>
25 #endif // #ifndef _D2D1_3_H_
26 
27 #ifndef D2D_USE_C_DEFINITIONS
28 
29 /*#include <winapifamily.h>*/
30 
31 /*#pragma region Application Family*/
32 /*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/
33 
34 namespace D2D1
35 {
36  COM_DECLSPEC_NOTHROW
39  GradientMeshPatch(
40  D2D1_POINT_2F point00,
41  D2D1_POINT_2F point01,
42  D2D1_POINT_2F point02,
43  D2D1_POINT_2F point03,
44  D2D1_POINT_2F point10,
45  D2D1_POINT_2F point11,
46  D2D1_POINT_2F point12,
47  D2D1_POINT_2F point13,
48  D2D1_POINT_2F point20,
49  D2D1_POINT_2F point21,
50  D2D1_POINT_2F point22,
51  D2D1_POINT_2F point23,
52  D2D1_POINT_2F point30,
53  D2D1_POINT_2F point31,
54  D2D1_POINT_2F point32,
55  D2D1_POINT_2F point33,
56  D2D1_COLOR_F color00,
57  D2D1_COLOR_F color03,
58  D2D1_COLOR_F color30,
59  D2D1_COLOR_F color33,
60  D2D1_PATCH_EDGE_MODE topEdgeMode,
61  D2D1_PATCH_EDGE_MODE leftEdgeMode,
62  D2D1_PATCH_EDGE_MODE bottomEdgeMode,
63  D2D1_PATCH_EDGE_MODE rightEdgeMode
64  )
65  {
66  D2D1_GRADIENT_MESH_PATCH newPatch;
67  newPatch.point00 = point00;
68  newPatch.point01 = point01;
69  newPatch.point02 = point02;
70  newPatch.point03 = point03;
71  newPatch.point10 = point10;
72  newPatch.point11 = point11;
73  newPatch.point12 = point12;
74  newPatch.point13 = point13;
75  newPatch.point20 = point20;
76  newPatch.point21 = point21;
77  newPatch.point22 = point22;
78  newPatch.point23 = point23;
79  newPatch.point30 = point30;
80  newPatch.point31 = point31;
81  newPatch.point32 = point32;
82  newPatch.point33 = point33;
83 
84  newPatch.color00 = color00;
85  newPatch.color03 = color03;
86  newPatch.color30 = color30;
87  newPatch.color33 = color33;
88 
89  newPatch.topEdgeMode = topEdgeMode;
90  newPatch.leftEdgeMode = leftEdgeMode;
91  newPatch.bottomEdgeMode = bottomEdgeMode;
92  newPatch.rightEdgeMode = rightEdgeMode;
93 
94  return newPatch;
95  }
96 
97  COM_DECLSPEC_NOTHROW
100  GradientMeshPatchFromCoonsPatch(
101  D2D1_POINT_2F point0,
102  D2D1_POINT_2F point1,
103  D2D1_POINT_2F point2,
104  D2D1_POINT_2F point3,
105  D2D1_POINT_2F point4,
106  D2D1_POINT_2F point5,
107  D2D1_POINT_2F point6,
108  D2D1_POINT_2F point7,
109  D2D1_POINT_2F point8,
110  D2D1_POINT_2F point9,
111  D2D1_POINT_2F point10,
112  D2D1_POINT_2F point11,
113  D2D1_COLOR_F color0,
114  D2D1_COLOR_F color1,
115  D2D1_COLOR_F color2,
116  D2D1_COLOR_F color3,
117  D2D1_PATCH_EDGE_MODE topEdgeMode,
118  D2D1_PATCH_EDGE_MODE leftEdgeMode,
119  D2D1_PATCH_EDGE_MODE bottomEdgeMode,
120  D2D1_PATCH_EDGE_MODE rightEdgeMode
121  )
122  {
123  D2D1_GRADIENT_MESH_PATCH newPatch;
124  newPatch.point00 = point0;
125  newPatch.point01 = point1;
126  newPatch.point02 = point2;
127  newPatch.point03 = point3;
128  newPatch.point13 = point4;
129  newPatch.point23 = point5;
130  newPatch.point33 = point6;
131  newPatch.point32 = point7;
132  newPatch.point31 = point8;
133  newPatch.point30 = point9;
134  newPatch.point20 = point10;
135  newPatch.point10 = point11;
136 
138  &point0,
139  &point1,
140  &point2,
141  &point3,
142  &point4,
143  &point5,
144  &point6,
145  &point7,
146  &point8,
147  &point9,
148  &point10,
149  &point11,
150  &newPatch.point11,
151  &newPatch.point12,
152  &newPatch.point21,
153  &newPatch.point22
154  );
155 
156  newPatch.color00 = color0;
157  newPatch.color03 = color1;
158  newPatch.color33 = color2;
159  newPatch.color30 = color3;
160  newPatch.topEdgeMode = topEdgeMode;
161  newPatch.leftEdgeMode = leftEdgeMode;
162  newPatch.bottomEdgeMode = bottomEdgeMode;
163  newPatch.rightEdgeMode = rightEdgeMode;
164 
165  return newPatch;
166  }
167 
168  COM_DECLSPEC_NOTHROW
171  InkPoint(
172  const D2D1_POINT_2F &point,
173  FLOAT radius
174  )
175  {
176  D2D1_INK_POINT inkPoint;
177 
178  inkPoint.x = point.x;
179  inkPoint.y = point.y;
180  inkPoint.radius = radius;
181 
182  return inkPoint;
183  }
184 
185  COM_DECLSPEC_NOTHROW
188  InkBezierSegment(
189  const D2D1_INK_POINT &point1,
190  const D2D1_INK_POINT &point2,
191  const D2D1_INK_POINT &point3
192  )
193  {
194  D2D1_INK_BEZIER_SEGMENT inkBezierSegment;
195 
196  inkBezierSegment.point1 = point1;
197  inkBezierSegment.point2 = point2;
198  inkBezierSegment.point3 = point3;
199 
200  return inkBezierSegment;
201  }
202 
203  COM_DECLSPEC_NOTHROW
206  InkStyleProperties(
207  D2D1_INK_NIB_SHAPE nibShape,
208  const D2D1_MATRIX_3X2_F &nibTransform
209  )
210  {
211  D2D1_INK_STYLE_PROPERTIES inkStyleProperties;
212 
213  inkStyleProperties.nibShape = nibShape;
214  inkStyleProperties.nibTransform = nibTransform;
215 
216  return inkStyleProperties;
217  }
218 
219  COM_DECLSPEC_NOTHROW
222  InfiniteRectU()
223  {
224  D2D1_RECT_U rect = { 0u, 0u, UINT_MAX, UINT_MAX };
225 
226  return rect;
227  }
228 
229  COM_DECLSPEC_NOTHROW
232  SimpleColorProfile(
233  const D2D1_POINT_2F &redPrimary,
234  const D2D1_POINT_2F &greenPrimary,
235  const D2D1_POINT_2F &bluePrimary,
236  const D2D1_GAMMA1 gamma,
237  const D2D1_POINT_2F &whitePointXZ
238  )
239  {
240  D2D1_SIMPLE_COLOR_PROFILE simpleColorProfile;
241 
242  simpleColorProfile.redPrimary = redPrimary;
243  simpleColorProfile.greenPrimary = greenPrimary;
244  simpleColorProfile.bluePrimary = bluePrimary;
245  simpleColorProfile.gamma = gamma;
246  simpleColorProfile.whitePointXZ = whitePointXZ;
247 
248  return simpleColorProfile;
249  }
250 } // namespace D2D1
251 
252 /*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
253 /*#pragma endregion*/
254 
255 #endif // #ifndef D2D_USE_C_DEFINITIONS
256 
257 #endif // #if NTDDI_VERSION >= NTDDI_WINTHRESHOLD
258 
259 #endif // #ifndef _D2D1_HELPER_H_
260 
D2D1_POINT_2F point21
The gradient mesh patch control point at position 21.
Definition: d2d1_3.h:277
FLOAT y
Definition: d2d1_3.h:155
D2D1_INK_POINT point3
Definition: d2d1_3.h:170
FLOAT y
Definition: dcommon.h:178
D2D1_POINT_2F greenPrimary
The XY coordinates of the green primary in CIEXYZ space.
Definition: d2d1_3.h:430
#define D2D1FORCEINLINE
Definition: d2d1.h:3704
Defines the general pen tip shape and the transform used in an ID2D1InkStyle object.
Definition: d2d1_3.h:179
D2D1_POINT_2F point22
The gradient mesh patch control point at position 22.
Definition: d2d1_3.h:282
D2D1_PATCH_EDGE_MODE leftEdgeMode
The edge mode for the left edge of the patch.
Definition: d2d1_3.h:337
Definition: glslang_tab.cpp:129
D2D1_COLOR_F color30
The color associated with control point at position 30.
Definition: d2d1_3.h:322
FLOAT x
Definition: d2d1_3.h:154
D2D1_POINT_2F point11
The gradient mesh patch control point at position 11.
Definition: d2d1_3.h:257
D2D1_POINT_2F point02
The gradient mesh patch control point at position 02.
Definition: d2d1_3.h:242
D2D1_POINT_2F redPrimary
The XY coordinates of the red primary in CIEXYZ space.
Definition: d2d1_3.h:425
Simple description of a color space.
Definition: d2d1_3.h:419
D2D1_PATCH_EDGE_MODE topEdgeMode
The edge mode for the top edge of the patch.
Definition: d2d1_3.h:332
D2D1_INK_NIB_SHAPE nibShape
The general shape of the nib used to draw a given ink object.
Definition: d2d1_3.h:185
Represents a Bezier segment to be used in the creation of an ID2D1Ink object. This structure differs ...
Definition: d2d1_3.h:166
D2D1_COLOR_F color00
The color associated with control point at position 00.
Definition: d2d1_3.h:312
D2D1_POINT_2F point10
The gradient mesh patch control point at position 10.
Definition: d2d1_3.h:252
D2D1_POINT_2F point12
The gradient mesh patch control point at position 12.
Definition: d2d1_3.h:262
D2D1_INK_NIB_SHAPE
Specifies the appearance of the ink nib (pen tip) as part of an D2D1_INK_STYLE_PROPERTIES structure.
Definition: d2d1_3.h:37
D2D1_POINT_2F whitePointXZ
The X/Z tristimulus values for the whitepoint, normalized for relative luminance.
Definition: d2d1_3.h:441
D2D1_POINT_2F point33
The gradient mesh patch control point at position 33.
Definition: d2d1_3.h:307
D2D1_COLOR_F color03
The color associated with control point at position 03.
Definition: d2d1_3.h:317
FLOAT x
Definition: dcommon.h:177
D2D1_GAMMA1
This determines what gamma is used for interpolation/blending.
Definition: d2d1_3.h:394
D2D1_POINT_2F point20
The gradient mesh patch control point at position 20.
Definition: d2d1_3.h:272
D2D1_PATCH_EDGE_MODE bottomEdgeMode
The edge mode for the bottom edge of the patch.
Definition: d2d1_3.h:342
D2D1_POINT_2F point00
The gradient mesh patch control point at position 00.
Definition: d2d1_3.h:232
D2D1_PATCH_EDGE_MODE
Specifies how to render gradient mesh edges.
Definition: d2d1_3.h:198
D2D1_POINT_2F point01
The gradient mesh patch control point at position 01.
Definition: d2d1_3.h:237
D2D1_INK_POINT point2
Definition: d2d1_3.h:169
Represents an x-coordinate and y-coordinate pair in two-dimensional space.
Definition: dcommon.h:175
D2D1_POINT_2F point23
The gradient mesh patch control point at position 23.
Definition: d2d1_3.h:287
Represents a 3-by-2 matrix.
Definition: dcommon.h:275
void WINAPI D2D1GetGradientMeshInteriorPointsFromCoonsPatch(_In_ CONST D2D1_POINT_2F *pPoint0, _In_ CONST D2D1_POINT_2F *pPoint1, _In_ CONST D2D1_POINT_2F *pPoint2, _In_ CONST D2D1_POINT_2F *pPoint3, _In_ CONST D2D1_POINT_2F *pPoint4, _In_ CONST D2D1_POINT_2F *pPoint5, _In_ CONST D2D1_POINT_2F *pPoint6, _In_ CONST D2D1_POINT_2F *pPoint7, _In_ CONST D2D1_POINT_2F *pPoint8, _In_ CONST D2D1_POINT_2F *pPoint9, _In_ CONST D2D1_POINT_2F *pPoint10, _In_ CONST D2D1_POINT_2F *pPoint11, _Out_ D2D1_POINT_2F *pTensorPoint11, _Out_ D2D1_POINT_2F *pTensorPoint12, _Out_ D2D1_POINT_2F *pTensorPoint21, _Out_ D2D1_POINT_2F *pTensorPoint22)
D2D1_GAMMA1 gamma
The gamma encoding to use for this color space.
Definition: d2d1_3.h:446
Represents a rectangle defined by the coordinates of the upper-left corner (left, top) and the coordi...
Definition: dcommon.h:238
D2D1_MATRIX_3X2_F nibTransform
The transform applied to shape of the nib. _31 and _32 are ignored.
Definition: d2d1_3.h:190
D2D1_POINT_2F point32
The gradient mesh patch control point at position 32.
Definition: d2d1_3.h:302
D2D1_POINT_2F point03
The gradient mesh patch control point at position 03.
Definition: d2d1_3.h:247
D2D1_INK_POINT point1
Definition: d2d1_3.h:168
FLOAT radius
Definition: d2d1_3.h:156
Represents a tensor patch with 16 control points, 4 corner colors, and boundary flags....
Definition: d2d1_3.h:226
D2D1_POINT_2F point13
The gradient mesh patch control point at position 13.
Definition: d2d1_3.h:267
D2D1_POINT_2F point30
The gradient mesh patch control point at position 30.
Definition: d2d1_3.h:292
D2D1_PATCH_EDGE_MODE rightEdgeMode
The edge mode for the right edge of the patch.
Definition: d2d1_3.h:347
D2D1_POINT_2F point31
The gradient mesh patch control point at position 31.
Definition: d2d1_3.h:297
D2D1_COLOR_F color33
The color associated with control point at position 33.
Definition: d2d1_3.h:327
Represents a point, radius pair that makes up part of a D2D1_INK_BEZIER_SEGMENT.
Definition: d2d1_3.h:152
The text renderer interface represents a set of application-defined callbacks that perform rendering ...
Definition: d3d8types.h:57
D2D1_POINT_2F bluePrimary
The XY coordinates of the blue primary in CIEXYZ space.
Definition: d2d1_3.h:435