1 module aurora.directx.d2d1.d2d1_3;
2 
3 version(Windows):
4 
5 public import aurora.directx.d2d1.d2d1_2;
6 public import aurora.directx.dwrite.dwrite_3;
7 public import aurora.directx.d2d1.d2d1svg;
8 public import aurora.directx.d2d1.d2d1effects_2;
9 
10 public:
11 
12 ///
13 ///	Enumerations
14 ///
15 
16 enum D2D1_INK_NIB_SHAPE : int
17 {
18     ROUND = 0,
19     SQUARE = 1,
20     FORCE_DWORD = 0xffffffff
21 }
22 
23 enum D2D1_ORIENTATION : int
24 {
25     DEFAULT = 1,
26     FLIP_HORIZONTAL = 2,
27     ROTATE_CLOCKWISE180 = 3,
28     ROTATE_CLOCKWISE180_FLIP_HORIZONTAL = 4,
29     ROTATE_CLOCKWISE90_FLIP_HORIZONTAL = 5,
30     ROTATE_CLOCKWISE270 = 6,
31     ROTATE_CLOCKWISE270_FLIP_HORIZONTAL = 7,
32     ROTATE_CLOCKWISE90 = 8,
33     FORCE_DWORD = 0xffffffff
34 }
35 
36 enum D2D1_IMAGE_SOURCE_LOADING_OPTIONS : int
37 {
38     NONE = 0,
39     RELEASE_SOURCE = 1,
40     CACHE_ON_DEMAND = 2,
41     FORCE_DWORD = 0xffffffff
42 }
43 
44 enum D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS : int
45 {
46     NONE = 0,
47     DISABLE_DPI_SCALE = 1,
48     FORCE_DWORD = 0xffffffff
49 }
50 
51 enum D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS
52 {
53     NONE = 0,
54     LOW_QUALITY_PRIMARY_CONVERSION = 1,
55     FORCE_DWORD = 0xffffffff
56 }
57 
58 enum D2D1_PATCH_EDGE_MODE : int
59 {
60     ALIASED = 0,
61     ANTIALIASED = 1,
62     ALIASED_INFLATED = 2,
63     FORCE_DWORD = 0xffffffff
64 }
65 
66 enum D2D1_SPRITE_OPTIONS : int
67 {
68     NONE = 0,
69     CLAMP_TO_SOURCE_RECTANGLE = 1,
70     FORCE_DWORD = 0xffffffff
71 }
72 
73 enum D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION : int
74 {
75     DEFAULT = 0,
76     DISABLE = 1,
77     FORCE_DWORD = 0xffffffff
78 }
79 
80 enum D2D1_GAMMA1 : int
81 {
82     G22 = D2D1_GAMMA.GAMMA_2_2,
83     G10 = D2D1_GAMMA.GAMMA_1_0,
84     G2084 = 2,
85     FORCE_DWORD = 0xffffffff
86 }
87 
88 enum D2D1_COLOR_CONTEXT_TYPE : int
89 {
90     ICC = 0,
91     SIMPLE = 1,
92     DXGI = 2,
93     FORCE_DWORD = 0xffffffff
94 }
95 
96 ///
97 /// Structures
98 ///
99 
100 struct D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES
101 {
102     D2D1_ORIENTATION orientation;
103     float scaleX;
104     float scaleY;
105     D2D1_INTERPOLATION_MODE interpolationMode;
106     D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS options;
107 }
108 
109 struct D2D1_INK_POINT
110 {
111     float x;
112     float y;
113     float radius;
114 }
115 
116 struct D2D1_INK_BEZIER_SEGMENT
117 {
118     D2D1_INK_POINT point1;
119     D2D1_INK_POINT point2;
120     D2D1_INK_POINT point3;
121 }
122 
123 struct D2D1_INK_STYLE_PROPERTIES
124 {
125     D2D1_INK_NIB_SHAPE nibShape;
126     D2D1_MATRIX_3X2_F nibTransform;
127 }
128 
129 struct D2D1_GRADIENT_MESH_PATCH
130 {
131     D2D1_POINT_2F point00;
132     D2D1_POINT_2F point01;
133     D2D1_POINT_2F point02;
134     D2D1_POINT_2F point03;
135     D2D1_POINT_2F point10;
136     D2D1_POINT_2F point11;
137     D2D1_POINT_2F point12;
138     D2D1_POINT_2F point13;
139     D2D1_POINT_2F point20;
140     D2D1_POINT_2F point21;
141     D2D1_POINT_2F point22;
142     D2D1_POINT_2F point23;
143     D2D1_POINT_2F point30;
144     D2D1_POINT_2F point31;
145     D2D1_POINT_2F point32;
146     D2D1_POINT_2F point33;
147     D2D1_COLOR_F color00;
148     D2D1_COLOR_F color03;
149     D2D1_COLOR_F color30;
150     D2D1_COLOR_F color33;
151     D2D1_PATCH_EDGE_MODE topEdgeMode;
152     D2D1_PATCH_EDGE_MODE leftEdgeMode;
153     D2D1_PATCH_EDGE_MODE bottomEdgeMode;
154     D2D1_PATCH_EDGE_MODE rightEdgeMode;
155 }
156 
157 struct D2D1_SIMPLE_COLOR_PROFILE
158 {
159     D2D1_POINT_2F redPrimary;
160     D2D1_POINT_2F greenPrimary;
161     D2D1_POINT_2F bluePrimary;
162     D2D1_POINT_2F whitePointXZ;
163     D2D1_GAMMA1 gamma;
164 }
165 
166 ///
167 /// Interfaces
168 ///
169 
170 mixin(uuid!(ID2D1InkStyle, "bae8b344-23fc-4071-8cb5-d05d6f073848"));
171 public interface ID2D1InkStyle : ID2D1Resource
172 {
173 extern(Windows):
174 	D2D1_INK_NIB_SHAPE GetNibShape();
175     void GetNibTransform(D2D1_MATRIX_3X2_F *transform);
176     void SetNibShape(D2D1_INK_NIB_SHAPE nibShape);
177     void SetNibTransform(const D2D1_MATRIX_3X2_F *transform);
178     final void SetNibTransform(const D2D1_MATRIX_3X2_F transform) {
179         SetNibTransform(&transform);
180     }
181 }
182 
183 mixin(uuid!(ID2D1Ink, "b499923b-7029-478f-a8b3-432c7c5f5312"));
184 public interface ID2D1Ink : ID2D1Resource
185 {
186 extern(Windows):
187 	HRESULT AddSegments(const D2D1_INK_BEZIER_SEGMENT *segments, uint segmentsCount);
188     HRESULT GetBounds(ID2D1InkStyle inkStyle, const D2D1_MATRIX_3X2_F *worldTransform, D2D1_RECT_F *bounds);
189     uint GetSegmentCount();
190     HRESULT GetSegments(uint startSegment, D2D1_INK_BEZIER_SEGMENT *segments, uint segmentsCount);
191     D2D1_INK_POINT GetStartPoint();
192     HRESULT RemoveSegmentsAtEnd(uint segmentsCount);
193     HRESULT SetSegmentAtEnd(const D2D1_INK_BEZIER_SEGMENT *segment);
194     HRESULT SetSegments(uint startSegment, const D2D1_INK_BEZIER_SEGMENT *segments, uint segmentsCount);
195     void SetStartPoint(const D2D1_INK_POINT *startPoint);
196     HRESULT StreamAsGeometry(ID2D1InkStyle inkStyle, const D2D1_MATRIX_3X2_F *worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
197 
198     final void SetStartPoint(const D2D1_INK_POINT startPoint) {
199         SetStartPoint(&startPoint);
200     }
201     
202     final HRESULT SetSegmentAtEnd(const D2D1_INK_BEZIER_SEGMENT segment) {
203         return SetSegmentAtEnd(&segment);
204     }
205     
206     final HRESULT StreamAsGeometry(ID2D1InkStyle inkStyle, const D2D1_MATRIX_3X2_F *worldTransform, ID2D1SimplifiedGeometrySink geometrySink ) {
207         return StreamAsGeometry(inkStyle, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
208     }
209     
210     final HRESULT StreamAsGeometry(ID2D1InkStyle inkStyle, const D2D1_MATRIX_3X2_F worldTransform, ID2D1SimplifiedGeometrySink geometrySink) {
211         return StreamAsGeometry(inkStyle, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink);
212     }
213 
214     final HRESULT StreamAsGeometry(ID2D1InkStyle inkStyle, const D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink) {
215         return StreamAsGeometry(inkStyle, &worldTransform, flatteningTolerance, geometrySink);
216     }
217 }
218 
219 mixin(uuid!(ID2D1GradientMesh, "f292e401-c050-4cde-83d7-04962d3b23c2"));
220 public interface ID2D1GradientMesh : ID2D1Resource
221 {
222 extern(Windows):
223 	uint GetPatchCount();
224     HRESULT GetPatches(uint startIndex, D2D1_GRADIENT_MESH_PATCH *patches, uint patchesCount);
225 }
226 
227 mixin(uuid!(ID2D1ImageSource, "c9b664e5-74a1-4378-9ac2-eefc37a3f4d8"));
228 public interface ID2D1ImageSource : ID2D1Image
229 {
230 extern(Windows):
231 	HRESULT OfferResources();
232     HRESULT TryReclaimResources(bool *resourcesDiscarded);
233 }
234 
235 mixin(uuid!(ID2D1ImageSourceFromWic, "77395441-1c8f-4555-8683-f50dab0fe792"));
236 public interface ID2D1ImageSourceFromWic : ID2D1ImageSource
237 {
238 extern(Windows):
239 	HRESULT EnsureCached(const D2D1_RECT_U *rectangleToFill);
240     final HRESULT EnsureCached(const D2D1_RECT_U rectangleToFill) {
241         return EnsureCached(&rectangleToFill);
242     }
243     void GetSource(IWICBitmapSource wicBitmapSource);
244     HRESULT TrimCache(const D2D1_RECT_U *rectangleToPreserve);
245     final HRESULT TrimCache(const D2D1_RECT_U rectangleToPreserve) {
246         return TrimCache(&rectangleToPreserve);
247     }
248 }
249 
250 mixin(uuid!(ID2D1TransformedImageSource, "7f1f79e5-2796-416c-8f55-700f911445e5"));
251 public interface ID2D1TransformedImageSource : ID2D1Image
252 {
253 extern(Windows):
254 	void GetProperties(D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES *properties);
255     void GetSource(ID2D1ImageSource *imageSource);
256 }
257 
258 mixin(uuid!(ID2D1LookupTable3D, "53dd9855-a3b0-4d5b-82e1-26e25c5e5797"));
259 public interface ID2D1LookupTable3D : ID2D1Resource
260 {
261 extern(Windows):
262 }
263 
264 mixin(uuid!(ID2D1DeviceContext2, "394ea6a3-0c34-4321-950b-6ca20f0be6c7"));
265 public interface ID2D1DeviceContext2 : ID2D1DeviceContext1
266 {
267 extern(Windows):
268     HRESULT CreateGradientMesh(const D2D1_GRADIENT_MESH_PATCH *patches, uint patchesCount, ID2D1GradientMesh *gradientMesh);
269     HRESULT CreateImageSourceFromDxgi(IDXGISurface *surfaces, const D2D1_RECT_U *sourceRectangles, uint surfaceCount, DXGI_COLOR_SPACE_TYPE colorSpace, D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS options, ID2D1ImageSource *imageSource);
270     HRESULT CreateLookupTable3D(D2D1_BUFFER_PRECISION precision, const uint *extents, const byte *data, uint dataCount, const uint *strides, ID2D1LookupTable3D *lookupTable);
271     HRESULT CreateTransformedImageSource(ID2D1ImageSource imageSource, const D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES *properties, ID2D1TransformedImageSource *transformedImageSource);
272 
273     HRESULT CreateInk(const D2D1_INK_POINT *startPoint, ID2D1Ink *ink);
274     final HRESULT CreateInk(const D2D1_INK_POINT startPoint, ID2D1Ink *ink) {
275         return CreateInk(&startPoint, ink);
276     }
277     HRESULT CreateInkStyle(const D2D1_INK_STYLE_PROPERTIES *inkStyleProperties, ID2D1InkStyle *inkStyle);
278     final HRESULT CreateInkStyle(const D2D1_INK_STYLE_PROPERTIES inkStyleProperties, ID2D1InkStyle *inkStyle) {
279         return CreateInkStyle(&inkStyleProperties, inkStyle);
280     }
281     HRESULT CreateImageSourceFromWic(IWICBitmapSource wicBitmapSource, D2D1_IMAGE_SOURCE_LOADING_OPTIONS loadingOptions, D2D1_ALPHA_MODE alphaMode, ID2D1ImageSourceFromWic *imageSource);
282     final HRESULT CreateImageSourceFromWic(IWICBitmapSource wicBitmapSource, D2D1_IMAGE_SOURCE_LOADING_OPTIONS loadingOptions, ID2D1ImageSourceFromWic *imageSource) {
283         return CreateImageSourceFromWic(wicBitmapSource, loadingOptions, D2D1_ALPHA_MODE.UNKNOWN, imageSource);
284     }    
285     final HRESULT CreateImageSourceFromWic(IWICBitmapSource wicBitmapSource, ID2D1ImageSourceFromWic *imageSource) {
286         return CreateImageSourceFromWic(wicBitmapSource, D2D1_IMAGE_SOURCE_LOADING_OPTIONS.NONE, D2D1_ALPHA_MODE.UNKNOWN, imageSource);
287     }    
288     void DrawGdiMetafile(ID2D1GdiMetafile gdiMetafile, const D2D1_RECT_F *destinationRectangle, const D2D1_RECT_F *sourceRectangle = NULL);
289     final void DrawGdiMetafile(ID2D1GdiMetafile gdiMetafile, const D2D1_RECT_F destinationRectangle, const D2D1_RECT_F sourceRectangle) {
290         return DrawGdiMetafile(gdiMetafile, &destinationRectangle, &sourceRectangle);
291     }
292     final void DrawGdiMetafile(ID2D1GdiMetafile gdiMetafile, const D2D1_RECT_F destinationRectangle, const D2D1_RECT_F *sourceRectangle = null) {
293         return DrawGdiMetafile(gdiMetafile, &destinationRectangle, sourceRectangle);
294     }
295     void DrawGradientMesh(ID2D1GradientMesh gradientMesh);
296     void DrawInk(ID2D1Ink ink, ID2D1Brush brush, ID2D1InkStyle inkStyle);
297     HRESULT GetGradientMeshWorldBounds(ID2D1GradientMesh gradientMesh, D2D1_RECT_F *pBounds);
298 }
299 
300 mixin(uuid!(ID2D1Device2, "a44472e1-8dfb-4e60-8492-6e2861c9ca8b"));
301 public interface ID2D1Device2 : ID2D1Device1
302 {
303 extern(Windows):
304     HRESULT CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext2 *deviceContext2);
305     void FlushDeviceContexts(ID2D1Bitmap bitmap);
306     HRESULT GetDxgiDevice(IDXGIDevice *dxgiDevice);
307 }
308 
309 mixin(uuid!(ID2D1Factory3, "0869759f-4f00-413f-b03e-2bda45404d0f"));
310 public interface ID2D1Factory3 : ID2D1Factory2
311 {
312 extern(Windows):
313     HRESULT CreateDevice(IDXGIDevice dxgiDevice, ID2D1Device2 *d2dDevice2);
314 }
315 
316 mixin(uuid!(ID2D1CommandSink2, "3bab440e-417e-47df-a2e2-bc0be6a00916"));
317 public interface ID2D1CommandSink2 : ID2D1CommandSink1
318 {
319 extern(Windows):
320     void DrawGdiMetafile(ID2D1GdiMetafile gdiMetafile, const D2D1_RECT_F *destinationRectangle, const D2D1_RECT_F *sourceRectangle);
321     void DrawGradientMesh(ID2D1GradientMesh gradientMesh);
322     void DrawInk(ID2D1Ink ink, ID2D1Brush brush, ID2D1InkStyle inkStyle);
323 }
324 
325 mixin(uuid!(ID2D1GdiMetafile1, "2e69f9e8-dd3f-4bf9-95ba-c04f49d788df"));
326 public interface ID2D1GdiMetafile1 : ID2D1GdiMetafile
327 {
328 extern(Windows):
329     HRESULT GetDpi(float *dpiX, float *dpiY);
330     HRESULT GetSourceBounds(out D2D1_RECT_F *bounds);
331 }
332 
333 mixin(uuid!(ID2D1GdiMetafileSink1, "fd0ecb6b-91e6-411e-8655-395e760f91b4"));
334 public interface ID2D1GdiMetafileSink1 : ID2D1GdiMetafileSink
335 {
336 extern(Windows):
337     HRESULT ProcessRecord( DWORD recordType, const void *recordData, uint recordDataSize, uint flags);
338 }
339 
340 mixin(uuid!(ID2D1SpriteBatch, "4dc583bf-3a10-438a-8722-e9765224f1f1"));
341 public interface ID2D1SpriteBatch : ID2D1Resource
342 {
343 extern(Windows):
344     HRESULT AddSprites(uint spriteCount, const D2D1_RECT_F *destinationRectangles, const D2D1_RECT_U *sourceRectangles = null, const D2D1_COLOR_F *colors = null, const D2D1_MATRIX_3X2_F *transforms = null, uint destinationRectanglesStride = D2D1_RECT_F.sizeof, uint sourceRectangleStride = D2D1_RECT_U.sizeof, uint colorStride = D2D1_COLOR_F.sizeof, uint transformStride = D2D1_MATRIX_3X2_F.sizeof);
345     void Clear();
346     uint GetSpriteCount();
347     HRESULT GetSprites(uint startIndex, uint spriteCount, D2D1_RECT_F *destinationRectangles = NULL, D2D1_RECT_U *sourceRectangles = null, D2D1_COLOR_F *colors = null, D2D1_MATRIX_3X2_F *transforms = null);
348     HRESULT SetSprites(uint startIndex, uint spriteCount, const D2D1_RECT_F *destinationRectangles = NULL, const D2D1_RECT_U *sourceRectangles = null, const D2D1_COLOR_F *colors = null, const D2D1_MATRIX_3X2_F *transforms = null, uint destinationRectanglesStride = D2D1_RECT_F.sizeof, uint sourceRectangleStride = D2D1_RECT_U.sizeof, uint colorStride = D2D1_COLOR_F.sizeof, uint transformStride = D2D1_MATRIX_3X2_F.sizeof);
349 }
350 
351 mixin(uuid!(ID2D1DeviceContext3, "235a7496-8351-414c-bcd4-6672ab2d8e00"));
352 public interface ID2D1DeviceContext3 : ID2D1DeviceContext2
353 {
354 extern(Windows):
355     HRESULT CreateSpriteBatch(ID2D1SpriteBatch *spriteBatch);
356     void DrawSpriteBatch(ID2D1SpriteBatch spriteBatch, uint startIndex, uint spriteCount, ID2D1Bitmap bitmap, D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE.LINEAR, D2D1_SPRITE_OPTIONS spriteOptions = D2D1_SPRITE_OPTIONS.NONE);
357     final void DrawSpriteBatch(ID2D1SpriteBatch spriteBatch, ID2D1Bitmap bitmap, D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE.LINEAR, D2D1_SPRITE_OPTIONS spriteOptions = D2D1_SPRITE_OPTIONS.NONE) {
358         return DrawSpriteBatch(spriteBatch, 0, spriteBatch.GetSpriteCount(), bitmap, interpolationMode, spriteOptions);
359     }
360 }
361 
362 mixin(uuid!(ID2D1Device3, "852f2087-802c-4037-ab60-ff2e7ee6fc01"));
363 public interface ID2D1Device3 : ID2D1Device2
364 {
365 extern(Windows):
366     HRESULT CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext3 *deviceContext3);
367 }
368 
369 mixin(uuid!(ID2D1Factory4, "bd4ec2d2-0662-4bee-ba8e-6f29f032e096"));
370 public interface ID2D1Factory4 : ID2D1Factory3
371 {
372 extern(Windows):
373     HRESULT CreateDevice(IDXGIDevice  dxgiDevice, ID2D1Device3 *d2dDevice3);
374 }
375 
376 mixin(uuid!(ID2D1CommandSink3, "18079135-4cf3-4868-bc8e-06067e6d242d"));
377 public interface ID2D1CommandSink3 : ID2D1CommandSink2
378 {
379 extern(Windows):
380     HRESULT DrawSpriteBatch(ID2D1SpriteBatch spriteBatch, uint startIndex, uint spriteCount, ID2D1Bitmap bitmap, D2D1_BITMAP_INTERPOLATION_MODE interpolationMode, D2D1_SPRITE_OPTIONS spriteOptions);
381 }
382 
383 mixin(uuid!(ID2D1SvgGlyphStyle, "af671749-d241-4db8-8e41-dcc2e5c1a438"));
384 public interface ID2D1SvgGlyphStyle : ID2D1Resource
385 {
386 extern(Windows):
387     void GetFill(ID2D1Brush *brush);
388     void GetStroke(ID2D1Brush *brush, float*strokeWidth = NULL, float *dashes = NULL, uint dashesCount = 0, float *dashOffset = null);
389     uint GetStrokeDashesCount();
390     HRESULT SetFill(ID2D1Brush brush);
391     HRESULT SetStroke(ID2D1Brush brush, float strokeWidth = 1.0f, const float *dashes = NULL, uint dashesCount = 0, float dashOffset = 1.0f);
392 }
393 
394 mixin(uuid!(ID2D1DeviceContext4, "8c427831-3d90-4476-b647-c4fae349e4db"));
395 public interface ID2D1DeviceContext4 : ID2D1DeviceContext3
396 {
397 extern(Windows):
398     HRESULT CreateSvgGlyphStyle(ID2D1SvgGlyphStyle *svgGlyphStyle);
399     void DrawColorBitmapGlyphRun(DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat, D2D1_POINT_2F baselineOrigin, const DWRITE_GLYPH_RUN *glyphRun, DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE.NATURAL, D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION bitmapSnapOption = D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION.DEFAULT);
400     void DrawSvgGlyphRun(D2D1_POINT_2F baselineOrigin, const DWRITE_GLYPH_RUN *glyphRun, ID2D1Brush defaultFillBrush = null, ID2D1SvgGlyphStyle svgGlyphStyle = null, uint colorPaletteIndex = 0, DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE.NATURAL);
401     void DrawText(const WCHAR *string, uint stringLength, IDWriteTextFormat textFormat, const D2D1_RECT_F *layoutRect, ID2D1Brush defaultFillBrush, ID2D1SvgGlyphStyle svgGlyphStyle, uint colorPaletteIndex = 0, D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS.ENABLE_COLOR_FONT, DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE.NATURAL);
402     final void DrawText(const WCHAR *string, uint stringLength, IDWriteTextFormat textFormat, const D2D1_RECT_F layoutRect, ID2D1Brush defaultFillBrush, ID2D1SvgGlyphStyle svgGlyphStyle, uint colorPaletteIndex = 0, D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS.ENABLE_COLOR_FONT, DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE.NATURAL) {
403         return DrawText(string, stringLength, textFormat, &layoutRect, defaultFillBrush, svgGlyphStyle, colorPaletteIndex, options, measuringMode);
404     }
405     void DrawTextLayout(D2D1_POINT_2F origin, IDWriteTextLayout textLayout, ID2D1Brush defaultFillBrush, ID2D1SvgGlyphStyle svgGlyphStyle, uint colorPaletteIndex = 0, D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS.ENABLE_COLOR_FONT);
406     HRESULT GetColorBitmapGlyphImage(DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat, D2D1_POINT_2F glyphOrigin, IDWriteFontFace fontFace, float fontEmSize, ushort glyphIndex, bool isSideways, const D2D1_MATRIX_3X2_F *worldTransform, float dpiX, float dpiY, D2D1_MATRIX_3X2_F *glyphTransform, ID2D1Image *glyphImage);
407     HRESULT GetSvgGlyphImage(D2D1_POINT_2F glyphOrigin, IDWriteFontFace fontFace, float fontEmSize, ushort glyphIndex, bool isSideways, const D2D1_MATRIX_3X2_F *worldTransform, ID2D1Brush defaultFillBrush, ID2D1SvgGlyphStyle svgGlyphStyle, uint colorPaletteIndex, D2D1_MATRIX_3X2_F *glyphTransform, ID2D1CommandList *glyphImage);
408 }
409 
410 mixin(uuid!(ID2D1Device4, "d7bdb159-5683-4a46-bc9c-72dc720b858b"));
411 public interface ID2D1Device4 : ID2D1Device3
412 {
413 extern(Windows):
414     HRESULT CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext4 *deviceContext4);
415     ulong GetMaximumColorGlyphCacheMemory();
416     void SetMaximumColorGlyphCacheMemory(ulong maximumInBytes);
417 }
418 
419 mixin(uuid!(ID2D1Factory5, "c4349994-838e-4b0f-8cab-44997d9eeacc"));
420 public interface ID2D1Factory5 : ID2D1Factory4
421 {
422 extern(Windows):
423     HRESULT CreateDevice(IDXGIDevice dxgiDevice, ID2D1Device4 *d2dDevice4);
424 }
425 
426 mixin(uuid!(ID2D1CommandSink4, "c78a6519-40d6-4218-b2de-beeeb744bb3e"));
427 public interface ID2D1CommandSink4 : ID2D1CommandSink3
428 {
429 extern(Windows):
430     HRESULT SetPrimitiveBlend2(D2D1_PRIMITIVE_BLEND primitiveBlend);
431 }
432 
433 mixin(uuid!(ID2D1ColorContext1, "1ab42875-c57f-4be9-bd85-9cd78d6f55ee"));
434 public interface ID2D1ColorContext1 : ID2D1ColorContext
435 {
436 extern(Windows):
437     D2D1_COLOR_CONTEXT_TYPE GetColorContextType();
438     DXGI_COLOR_SPACE_TYPE GetDXGIColorSpace();
439     HRESULT GetSimpleColorProfile(D2D1_SIMPLE_COLOR_PROFILE *simpleProfile);
440 }
441 
442 mixin(uuid!(ID2D1DeviceContext5, "7836d248-68cc-4df6-b9e8-de991bf62eb7"));
443 public interface ID2D1DeviceContext5 : ID2D1DeviceContext4
444 {
445 extern(Windows):
446     HRESULT CreateColorContextFromDxgiColorSpace(DXGI_COLOR_SPACE_TYPE colorSpace, ID2D1ColorContext1 *colorContext);
447     HRESULT CreateColorContextFromSimpleColorProfile(const D2D1_SIMPLE_COLOR_PROFILE *simpleProfile, ID2D1ColorContext1 *colorContext);
448     final HRESULT CreateColorContextFromSimpleColorProfile(const D2D1_SIMPLE_COLOR_PROFILE simpleProfile, ID2D1ColorContext1 *colorContext) {
449         return CreateColorContextFromSimpleColorProfile(&simpleProfile, colorContext);
450     }
451     HRESULT CreateSvgDocument(IStream inputXmlStream, D2D1_SIZE_F viewportSize, ID2D1SvgDocument *svgDocument);
452     void DrawSvgDocument(ID2D1SvgDocument svgDocument);
453 }
454 
455 mixin(uuid!(ID2D1Device5, "d55ba0a4-6405-4694-aef5-08ee1a4358b4"));
456 public interface ID2D1Device5 : ID2D1Device4
457 {
458 extern(Windows):
459     HRESULT CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext5 *deviceContext5);
460 }
461 
462 mixin(uuid!(ID2D1Factory6, "f9976f46-f642-44c1-97ca-da32ea2a2635"));
463 public interface ID2D1Factory6 : ID2D1Factory5
464 {
465 extern(Windows):
466     HRESULT CreateDevice(IDXGIDevice dxgiDevice, ID2D1Device5 *d2dDevice5);
467 }
468 
469 mixin(uuid!(ID2D1CommandSink5, "7047dd26-b1e7-44a7-959a-8349e2144fa8"));
470 public interface ID2D1CommandSink5 : ID2D1CommandSink4
471 {
472 extern(Windows):
473     HRESULT BlendImage(ID2D1Image image, D2D1_BLEND_MODE blendMode, const D2D1_POINT_2F *targetOffset, const D2D1_RECT_F *imageRectangle, D2D1_INTERPOLATION_MODE interpolationMode);
474 }
475 
476 mixin(uuid!(ID2D1DeviceContext6, "985f7e37-4ed0-4a19-98a3-15b0edfde306"));
477 public interface ID2D1DeviceContext6 : ID2D1DeviceContext5
478 {
479 extern(Windows):
480     void BlendImage(ID2D1Image image, D2D1_BLEND_MODE blendMode, const D2D1_POINT_2F *targetOffset = null, const D2D1_RECT_F *imageRectangle = null, D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE.LINEAR);
481 }
482 
483 mixin(uuid!(ID2D1Device6, "7bfef914-2d75-4bad-be87-e18ddb077b6d"));
484 public interface ID2D1Device6 : ID2D1Device5
485 {
486 extern(Windows):
487     HRESULT CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext5 *deviceContext5);
488 }
489 
490 mixin(uuid!(ID2D1Factory7, "bdc2bdd3-b96c-4de6-bdf7-99d4745454de"));
491 public interface ID2D1Factory7 : ID2D1Factory6
492 {
493 extern(Windows):
494     HRESULT CreateDevice(IDXGIDevice dxgiDevice,ID2D1Device6 *d2dDevice6);
495 }
496 
497 ///
498 /// Functions
499 ///
500 
501 extern(Windows) {
502     void D2D1GetGradientMeshInteriorPointsFromCoonsPatch(const D2D1_POINT_2F *pPoint0, const D2D1_POINT_2F *pPoint1, const D2D1_POINT_2F *pPoint2, const D2D1_POINT_2F *pPoint3, const D2D1_POINT_2F *pPoint4, const D2D1_POINT_2F *pPoint5, const D2D1_POINT_2F *pPoint6, const D2D1_POINT_2F *pPoint7, const D2D1_POINT_2F *pPoint8, const D2D1_POINT_2F *pPoint9, const D2D1_POINT_2F *pPoint10, const D2D1_POINT_2F *pPoint11, D2D1_POINT_2F *pTensorPoint11, D2D1_POINT_2F *pTensorPoint12, D2D1_POINT_2F *pTensorPoint21, D2D1_POINT_2F *pTensorPoint22);
503 }