-
Notifications
You must be signed in to change notification settings - Fork 182
/
d2d1.h
3722 lines (3089 loc) · 108 KB
/
d2d1.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//---------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// This file is automatically generated. Please do not edit it directly.
//
// File name: D2D1.h
//---------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma once
#endif // #ifdef _MSC_VER
#ifndef _D2D1_H_
#define _D2D1_H_
#ifndef COM_NO_WINDOWS_H
#include <windows.h>
#endif // #ifndef COM_NO_WINDOWS_H
#include <unknwn.h>
#include <dcommon.h>
#include <d2derr.h>
#include <d2dbasetypes.h>
#include <dxgiformat.h>
#include <d3d10_1.h>
#ifndef D2D_USE_C_DEFINITIONS
//
// We use the 'C' definitions if C++ is not defined
//
#ifndef __cplusplus
#define D2D_USE_C_DEFINITIONS
#endif
#endif // #ifndef D2D_USE_C_DEFINITIONS
//
// Forward declarations here
//
typedef interface IDWriteTextFormat IDWriteTextFormat;
typedef interface IDWriteTextLayout IDWriteTextLayout;
typedef interface IDWriteRenderingParams IDWriteRenderingParams;
typedef interface IDXGISurface IDXGISurface;
typedef interface IWICBitmap IWICBitmap;
typedef interface IWICBitmapSource IWICBitmapSource;
typedef struct DWRITE_GLYPH_RUN DWRITE_GLYPH_RUN;
#ifndef D2D_USE_C_DEFINITIONS
interface ID2D1Factory;
interface ID2D1RenderTarget;
interface ID2D1BitmapRenderTarget;
interface ID2D1SimplifiedGeometrySink;
interface ID2D1TessellationSink;
interface ID2D1Geometry;
interface ID2D1Brush;
#else
typedef interface ID2D1Factory ID2D1Factory;
typedef interface ID2D1RenderTarget ID2D1RenderTarget;
typedef interface ID2D1BitmapRenderTarget ID2D1BitmapRenderTarget;
typedef interface ID2D1SimplifiedGeometrySink ID2D1SimplifiedGeometrySink;;
typedef interface ID2D1TessellationSink ID2D1TessellationSink;
typedef interface ID2D1Geometry ID2D1Geometry;
typedef interface ID2D1Brush ID2D1Brush;
#endif
#define D2D1_INVALID_TAG ULONGLONG_MAX
#define D2D1_DEFAULT_FLATTENING_TOLERANCE (0.25f)
/// <summary>
/// This defines the superset of interpolation mode supported by D2D APIs
/// and built-in effects
/// </summary>
enum
{
D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR = 0,
D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR = 1,
D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC = 2,
D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR = 3,
D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC = 4,
D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC = 5,
D2D1_INTERPOLATION_MODE_DEFINITION_FANT = 6,
D2D1_INTERPOLATION_MODE_DEFINITION_MIPMAP_LINEAR = 7
};
/// <summary>
/// This determines what gamma is used for interpolation/blending.
/// </summary>
typedef enum D2D1_GAMMA
{
/// <summary>
/// Colors are manipulated in 2.2 gamma color space.
/// </summary>
D2D1_GAMMA_2_2 = 0,
/// <summary>
/// Colors are manipulated in 1.0 gamma color space.
/// </summary>
D2D1_GAMMA_1_0 = 1,
D2D1_GAMMA_FORCE_DWORD = 0xffffffff
} D2D1_GAMMA;
/// <summary>
/// Specifies what the contents are of an opacity mask.
/// </summary>
typedef enum D2D1_OPACITY_MASK_CONTENT
{
/// <summary>
/// The mask contains geometries or bitmaps.
/// </summary>
D2D1_OPACITY_MASK_CONTENT_GRAPHICS = 0,
/// <summary>
/// The mask contains text rendered using one of the natural text modes.
/// </summary>
D2D1_OPACITY_MASK_CONTENT_TEXT_NATURAL = 1,
/// <summary>
/// The mask contains text rendered using one of the GDI compatible text modes.
/// </summary>
D2D1_OPACITY_MASK_CONTENT_TEXT_GDI_COMPATIBLE = 2,
D2D1_OPACITY_MASK_CONTENT_FORCE_DWORD = 0xffffffff
} D2D1_OPACITY_MASK_CONTENT;
/// <summary>
/// Enum which describes how to sample from a source outside its base tile.
/// </summary>
typedef enum D2D1_EXTEND_MODE
{
/// <summary>
/// Extend the edges of the source out by clamping sample points outside the source
/// to the edges.
/// </summary>
D2D1_EXTEND_MODE_CLAMP = 0,
/// <summary>
/// The base tile is drawn untransformed and the remainder are filled by repeating
/// the base tile.
/// </summary>
D2D1_EXTEND_MODE_WRAP = 1,
/// <summary>
/// The same as wrap, but alternate tiles are flipped The base tile is drawn
/// untransformed.
/// </summary>
D2D1_EXTEND_MODE_MIRROR = 2,
D2D1_EXTEND_MODE_FORCE_DWORD = 0xffffffff
} D2D1_EXTEND_MODE;
/// <summary>
/// Enum which describes the manner in which we render edges of non-text primitives.
/// </summary>
typedef enum D2D1_ANTIALIAS_MODE
{
/// <summary>
/// The edges of each primitive are antialiased sequentially.
/// </summary>
D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0,
/// <summary>
/// Each pixel is rendered if its pixel center is contained by the geometry.
/// </summary>
D2D1_ANTIALIAS_MODE_ALIASED = 1,
D2D1_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff
} D2D1_ANTIALIAS_MODE;
/// <summary>
/// Describes the antialiasing mode used for drawing text.
/// </summary>
typedef enum D2D1_TEXT_ANTIALIAS_MODE
{
/// <summary>
/// Render text using the current system setting.
/// </summary>
D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0,
/// <summary>
/// Render text using ClearType.
/// </summary>
D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1,
/// <summary>
/// Render text using gray-scale.
/// </summary>
D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2,
/// <summary>
/// Render text aliased.
/// </summary>
D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3,
D2D1_TEXT_ANTIALIAS_MODE_FORCE_DWORD = 0xffffffff
} D2D1_TEXT_ANTIALIAS_MODE;
/// <summary>
/// Specifies the algorithm that is used when images are scaled or rotated. Note
/// Starting in Windows 8, more interpolations modes are available. See
/// D2D1_INTERPOLATION_MODE for more info.
/// </summary>
typedef enum D2D1_BITMAP_INTERPOLATION_MODE
{
/// <summary>
/// Nearest Neighbor filtering. Also known as nearest pixel or nearest point
/// sampling.
/// </summary>
D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR = D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR,
/// <summary>
/// Linear filtering.
/// </summary>
D2D1_BITMAP_INTERPOLATION_MODE_LINEAR = D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR,
D2D1_BITMAP_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
} D2D1_BITMAP_INTERPOLATION_MODE;
/// <summary>
/// Modifications made to the draw text call that influence how the text is
/// rendered.
/// </summary>
typedef enum D2D1_DRAW_TEXT_OPTIONS
{
/// <summary>
/// Do not snap the baseline of the text vertically.
/// </summary>
D2D1_DRAW_TEXT_OPTIONS_NO_SNAP = 0x00000001,
/// <summary>
/// Clip the text to the content bounds.
/// </summary>
D2D1_DRAW_TEXT_OPTIONS_CLIP = 0x00000002,
/// <summary>
/// Render color versions of glyphs if defined by the font.
/// </summary>
D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT = 0x00000004,
/// <summary>
/// Bitmap origins of color glyph bitmaps are not snapped.
/// </summary>
D2D1_DRAW_TEXT_OPTIONS_DISABLE_COLOR_BITMAP_SNAPPING = 0x00000008,
D2D1_DRAW_TEXT_OPTIONS_NONE = 0x00000000,
D2D1_DRAW_TEXT_OPTIONS_FORCE_DWORD = 0xffffffff
} D2D1_DRAW_TEXT_OPTIONS;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_DRAW_TEXT_OPTIONS);
typedef D2D_POINT_2U D2D1_POINT_2U;
typedef D2D_POINT_2F D2D1_POINT_2F;
typedef D2D_RECT_F D2D1_RECT_F;
typedef D2D_RECT_U D2D1_RECT_U;
typedef D2D_SIZE_F D2D1_SIZE_F;
typedef D2D_SIZE_U D2D1_SIZE_U;
typedef D2D_COLOR_F D2D1_COLOR_F;
typedef D2D_MATRIX_3X2_F D2D1_MATRIX_3X2_F;
typedef UINT64 D2D1_TAG;
/// <summary>
/// Describes the pixel format and dpi of a bitmap.
/// </summary>
typedef struct D2D1_BITMAP_PROPERTIES
{
D2D1_PIXEL_FORMAT pixelFormat;
FLOAT dpiX;
FLOAT dpiY;
} D2D1_BITMAP_PROPERTIES;
/// <summary>
/// Contains the position and color of a gradient stop.
/// </summary>
typedef struct D2D1_GRADIENT_STOP
{
FLOAT position;
D2D1_COLOR_F color;
} D2D1_GRADIENT_STOP;
/// <summary>
/// Describes the opacity and transformation of a brush.
/// </summary>
typedef struct D2D1_BRUSH_PROPERTIES
{
FLOAT opacity;
D2D1_MATRIX_3X2_F transform;
} D2D1_BRUSH_PROPERTIES;
/// <summary>
/// Describes the extend modes and the interpolation mode of an ID2D1BitmapBrush.
/// </summary>
typedef struct D2D1_BITMAP_BRUSH_PROPERTIES
{
D2D1_EXTEND_MODE extendModeX;
D2D1_EXTEND_MODE extendModeY;
D2D1_BITMAP_INTERPOLATION_MODE interpolationMode;
} D2D1_BITMAP_BRUSH_PROPERTIES;
/// <summary>
/// Contains the starting point and endpoint of the gradient axis for an
/// ID2D1LinearGradientBrush.
/// </summary>
typedef struct D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES
{
D2D1_POINT_2F startPoint;
D2D1_POINT_2F endPoint;
} D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES;
/// <summary>
/// Contains the gradient origin offset and the size and position of the gradient
/// ellipse for an ID2D1RadialGradientBrush.
/// </summary>
typedef struct D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES
{
D2D1_POINT_2F center;
D2D1_POINT_2F gradientOriginOffset;
FLOAT radiusX;
FLOAT radiusY;
} D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES;
/// <summary>
/// Differentiates which of the two possible arcs could match the given arc
/// parameters.
/// </summary>
typedef enum D2D1_ARC_SIZE
{
D2D1_ARC_SIZE_SMALL = 0,
D2D1_ARC_SIZE_LARGE = 1,
D2D1_ARC_SIZE_FORCE_DWORD = 0xffffffff
} D2D1_ARC_SIZE;
/// <summary>
/// Enum which describes the drawing of the ends of a line.
/// </summary>
typedef enum D2D1_CAP_STYLE
{
/// <summary>
/// Flat line cap.
/// </summary>
D2D1_CAP_STYLE_FLAT = 0,
/// <summary>
/// Square line cap.
/// </summary>
D2D1_CAP_STYLE_SQUARE = 1,
/// <summary>
/// Round line cap.
/// </summary>
D2D1_CAP_STYLE_ROUND = 2,
/// <summary>
/// Triangle line cap.
/// </summary>
D2D1_CAP_STYLE_TRIANGLE = 3,
D2D1_CAP_STYLE_FORCE_DWORD = 0xffffffff
} D2D1_CAP_STYLE;
/// <summary>
/// Describes the sequence of dashes and gaps in a stroke.
/// </summary>
typedef enum D2D1_DASH_STYLE
{
D2D1_DASH_STYLE_SOLID = 0,
D2D1_DASH_STYLE_DASH = 1,
D2D1_DASH_STYLE_DOT = 2,
D2D1_DASH_STYLE_DASH_DOT = 3,
D2D1_DASH_STYLE_DASH_DOT_DOT = 4,
D2D1_DASH_STYLE_CUSTOM = 5,
D2D1_DASH_STYLE_FORCE_DWORD = 0xffffffff
} D2D1_DASH_STYLE;
/// <summary>
/// Enum which describes the drawing of the corners on the line.
/// </summary>
typedef enum D2D1_LINE_JOIN
{
/// <summary>
/// Miter join.
/// </summary>
D2D1_LINE_JOIN_MITER = 0,
/// <summary>
/// Bevel join.
/// </summary>
D2D1_LINE_JOIN_BEVEL = 1,
/// <summary>
/// Round join.
/// </summary>
D2D1_LINE_JOIN_ROUND = 2,
/// <summary>
/// Miter/Bevel join.
/// </summary>
D2D1_LINE_JOIN_MITER_OR_BEVEL = 3,
D2D1_LINE_JOIN_FORCE_DWORD = 0xffffffff
} D2D1_LINE_JOIN;
/// <summary>
/// This enumeration describes the type of combine operation to be performed.
/// </summary>
typedef enum D2D1_COMBINE_MODE
{
/// <summary>
/// Produce a geometry representing the set of points contained in either the first
/// or the second geometry.
/// </summary>
D2D1_COMBINE_MODE_UNION = 0,
/// <summary>
/// Produce a geometry representing the set of points common to the first and the
/// second geometries.
/// </summary>
D2D1_COMBINE_MODE_INTERSECT = 1,
/// <summary>
/// Produce a geometry representing the set of points contained in the first
/// geometry or the second geometry, but not both.
/// </summary>
D2D1_COMBINE_MODE_XOR = 2,
/// <summary>
/// Produce a geometry representing the set of points contained in the first
/// geometry but not the second geometry.
/// </summary>
D2D1_COMBINE_MODE_EXCLUDE = 3,
D2D1_COMBINE_MODE_FORCE_DWORD = 0xffffffff
} D2D1_COMBINE_MODE;
/// <summary>
/// Describes how one geometry object is spatially related to another geometry
/// object.
/// </summary>
typedef enum D2D1_GEOMETRY_RELATION
{
/// <summary>
/// The relation between the geometries couldn't be determined. This value is never
/// returned by any D2D method.
/// </summary>
D2D1_GEOMETRY_RELATION_UNKNOWN = 0,
/// <summary>
/// The two geometries do not intersect at all.
/// </summary>
D2D1_GEOMETRY_RELATION_DISJOINT = 1,
/// <summary>
/// The passed in geometry is entirely contained by the object.
/// </summary>
D2D1_GEOMETRY_RELATION_IS_CONTAINED = 2,
/// <summary>
/// The object entirely contains the passed in geometry.
/// </summary>
D2D1_GEOMETRY_RELATION_CONTAINS = 3,
/// <summary>
/// The two geometries overlap but neither completely contains the other.
/// </summary>
D2D1_GEOMETRY_RELATION_OVERLAP = 4,
D2D1_GEOMETRY_RELATION_FORCE_DWORD = 0xffffffff
} D2D1_GEOMETRY_RELATION;
/// <summary>
/// Specifies how simple the output of a simplified geometry sink should be.
/// </summary>
typedef enum D2D1_GEOMETRY_SIMPLIFICATION_OPTION
{
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES = 0,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES = 1,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_FORCE_DWORD = 0xffffffff
} D2D1_GEOMETRY_SIMPLIFICATION_OPTION;
/// <summary>
/// Indicates whether the given figure is filled or hollow.
/// </summary>
typedef enum D2D1_FIGURE_BEGIN
{
D2D1_FIGURE_BEGIN_FILLED = 0,
D2D1_FIGURE_BEGIN_HOLLOW = 1,
D2D1_FIGURE_BEGIN_FORCE_DWORD = 0xffffffff
} D2D1_FIGURE_BEGIN;
/// <summary>
/// Indicates whether the figure is open or closed on its end point.
/// </summary>
typedef enum D2D1_FIGURE_END
{
D2D1_FIGURE_END_OPEN = 0,
D2D1_FIGURE_END_CLOSED = 1,
D2D1_FIGURE_END_FORCE_DWORD = 0xffffffff
} D2D1_FIGURE_END;
/// <summary>
/// Describes a cubic bezier in a path.
/// </summary>
typedef struct D2D1_BEZIER_SEGMENT
{
D2D1_POINT_2F point1;
D2D1_POINT_2F point2;
D2D1_POINT_2F point3;
} D2D1_BEZIER_SEGMENT;
/// <summary>
/// Describes a triangle.
/// </summary>
typedef struct D2D1_TRIANGLE
{
D2D1_POINT_2F point1;
D2D1_POINT_2F point2;
D2D1_POINT_2F point3;
} D2D1_TRIANGLE;
/// <summary>
/// Indicates whether the given segment should be stroked, or, if the join between
/// this segment and the previous one should be smooth.
/// </summary>
typedef enum D2D1_PATH_SEGMENT
{
D2D1_PATH_SEGMENT_NONE = 0x00000000,
D2D1_PATH_SEGMENT_FORCE_UNSTROKED = 0x00000001,
D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN = 0x00000002,
D2D1_PATH_SEGMENT_FORCE_DWORD = 0xffffffff
} D2D1_PATH_SEGMENT;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_PATH_SEGMENT);
/// <summary>
/// Defines the direction that an elliptical arc is drawn.
/// </summary>
typedef enum D2D1_SWEEP_DIRECTION
{
D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE = 0,
D2D1_SWEEP_DIRECTION_CLOCKWISE = 1,
D2D1_SWEEP_DIRECTION_FORCE_DWORD = 0xffffffff
} D2D1_SWEEP_DIRECTION;
/// <summary>
/// Specifies how the intersecting areas of geometries or figures are combined to
/// form the area of the composite geometry.
/// </summary>
typedef enum D2D1_FILL_MODE
{
D2D1_FILL_MODE_ALTERNATE = 0,
D2D1_FILL_MODE_WINDING = 1,
D2D1_FILL_MODE_FORCE_DWORD = 0xffffffff
} D2D1_FILL_MODE;
/// <summary>
/// Describes an arc that is defined as part of a path.
/// </summary>
typedef struct D2D1_ARC_SEGMENT
{
D2D1_POINT_2F point;
D2D1_SIZE_F size;
FLOAT rotationAngle;
D2D1_SWEEP_DIRECTION sweepDirection;
D2D1_ARC_SIZE arcSize;
} D2D1_ARC_SEGMENT;
/// <summary>
/// Contains the control point and end point for a quadratic Bezier segment.
/// </summary>
typedef struct D2D1_QUADRATIC_BEZIER_SEGMENT
{
D2D1_POINT_2F point1;
D2D1_POINT_2F point2;
} D2D1_QUADRATIC_BEZIER_SEGMENT;
/// <summary>
/// Contains the center point, x-radius, and y-radius of an ellipse.
/// </summary>
typedef struct D2D1_ELLIPSE
{
D2D1_POINT_2F point;
FLOAT radiusX;
FLOAT radiusY;
} D2D1_ELLIPSE;
/// <summary>
/// Contains the dimensions and corner radii of a rounded rectangle.
/// </summary>
typedef struct D2D1_ROUNDED_RECT
{
D2D1_RECT_F rect;
FLOAT radiusX;
FLOAT radiusY;
} D2D1_ROUNDED_RECT;
/// <summary>
/// Properties, aside from the width, that allow geometric penning to be specified.
/// </summary>
typedef struct D2D1_STROKE_STYLE_PROPERTIES
{
D2D1_CAP_STYLE startCap;
D2D1_CAP_STYLE endCap;
D2D1_CAP_STYLE dashCap;
D2D1_LINE_JOIN lineJoin;
FLOAT miterLimit;
D2D1_DASH_STYLE dashStyle;
FLOAT dashOffset;
} D2D1_STROKE_STYLE_PROPERTIES;
/// <summary>
/// Specified options that can be applied when a layer resource is applied to create
/// a layer.
/// </summary>
typedef enum D2D1_LAYER_OPTIONS
{
D2D1_LAYER_OPTIONS_NONE = 0x00000000,
/// <summary>
/// The layer will render correctly for ClearType text. If the render target was set
/// to ClearType previously, the layer will continue to render ClearType. If the
/// render target was set to ClearType and this option is not specified, the render
/// target will be set to render gray-scale until the layer is popped. The caller
/// can override this default by calling SetTextAntialiasMode while within the
/// layer. This flag is slightly slower than the default.
/// </summary>
D2D1_LAYER_OPTIONS_INITIALIZE_FOR_CLEARTYPE = 0x00000001,
D2D1_LAYER_OPTIONS_FORCE_DWORD = 0xffffffff
} D2D1_LAYER_OPTIONS;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS);
/// <summary>
/// Contains the content bounds, mask information, opacity settings, and other
/// options for a layer resource.
/// </summary>
typedef struct D2D1_LAYER_PARAMETERS
{
/// <summary>
/// The rectangular clip that will be applied to the layer. The clip is affected by
/// the world transform. Content outside of the content bounds will not render.
/// </summary>
D2D1_RECT_F contentBounds;
/// <summary>
/// A general mask that can be optionally applied to the content. Content not inside
/// the fill of the mask will not be rendered.
/// </summary>
_Field_size_opt_(1) ID2D1Geometry *geometricMask;
/// <summary>
/// Specifies whether the mask should be aliased or antialiased.
/// </summary>
D2D1_ANTIALIAS_MODE maskAntialiasMode;
/// <summary>
/// An additional transform that may be applied to the mask in addition to the
/// current world transform.
/// </summary>
D2D1_MATRIX_3X2_F maskTransform;
/// <summary>
/// The opacity with which all of the content in the layer will be blended back to
/// the target when the layer is popped.
/// </summary>
FLOAT opacity;
/// <summary>
/// An additional brush that can be applied to the layer. Only the opacity channel
/// is sampled from this brush and multiplied both with the layer content and the
/// over-all layer opacity.
/// </summary>
_Field_size_opt_(1) ID2D1Brush *opacityBrush;
/// <summary>
/// Specifies if ClearType will be rendered into the layer.
/// </summary>
D2D1_LAYER_OPTIONS layerOptions;
} D2D1_LAYER_PARAMETERS;
/// <summary>
/// Describes whether a window is occluded.
/// </summary>
typedef enum D2D1_WINDOW_STATE
{
D2D1_WINDOW_STATE_NONE = 0x0000000,
D2D1_WINDOW_STATE_OCCLUDED = 0x0000001,
D2D1_WINDOW_STATE_FORCE_DWORD = 0xffffffff
} D2D1_WINDOW_STATE;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_WINDOW_STATE);
/// <summary>
/// Describes whether a render target uses hardware or software rendering, or if
/// Direct2D should select the rendering mode.
/// </summary>
typedef enum D2D1_RENDER_TARGET_TYPE
{
/// <summary>
/// D2D is free to choose the render target type for the caller.
/// </summary>
D2D1_RENDER_TARGET_TYPE_DEFAULT = 0,
/// <summary>
/// The render target will render using the CPU.
/// </summary>
D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1,
/// <summary>
/// The render target will render using the GPU.
/// </summary>
D2D1_RENDER_TARGET_TYPE_HARDWARE = 2,
D2D1_RENDER_TARGET_TYPE_FORCE_DWORD = 0xffffffff
} D2D1_RENDER_TARGET_TYPE;
/// <summary>
/// Describes the minimum DirectX support required for hardware rendering by a
/// render target.
/// </summary>
typedef enum D2D1_FEATURE_LEVEL
{
/// <summary>
/// The caller does not require a particular underlying D3D device level.
/// </summary>
D2D1_FEATURE_LEVEL_DEFAULT = 0,
/// <summary>
/// The D3D device level is DX9 compatible.
/// </summary>
D2D1_FEATURE_LEVEL_9 = D3D_FEATURE_LEVEL_9_1,
/// <summary>
/// The D3D device level is DX10 compatible.
/// </summary>
D2D1_FEATURE_LEVEL_10 = D3D_FEATURE_LEVEL_10_0,
D2D1_FEATURE_LEVEL_FORCE_DWORD = 0xffffffff
} D2D1_FEATURE_LEVEL;
/// <summary>
/// Describes how a render target is remoted and whether it should be
/// GDI-compatible. This enumeration allows a bitwise combination of its member
/// values.
/// </summary>
typedef enum D2D1_RENDER_TARGET_USAGE
{
D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000,
/// <summary>
/// Rendering will occur locally, if a terminal-services session is established, the
/// bitmap updates will be sent to the terminal services client.
/// </summary>
D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001,
/// <summary>
/// The render target will allow a call to GetDC on the ID2D1GdiInteropRenderTarget
/// interface. Rendering will also occur locally.
/// </summary>
D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002,
D2D1_RENDER_TARGET_USAGE_FORCE_DWORD = 0xffffffff
} D2D1_RENDER_TARGET_USAGE;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_RENDER_TARGET_USAGE);
/// <summary>
/// Describes how present should behave.
/// </summary>
typedef enum D2D1_PRESENT_OPTIONS
{
D2D1_PRESENT_OPTIONS_NONE = 0x00000000,
/// <summary>
/// Keep the target contents intact through present.
/// </summary>
D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS = 0x00000001,
/// <summary>
/// Do not wait for display refresh to commit changes to display.
/// </summary>
D2D1_PRESENT_OPTIONS_IMMEDIATELY = 0x00000002,
D2D1_PRESENT_OPTIONS_FORCE_DWORD = 0xffffffff
} D2D1_PRESENT_OPTIONS;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_PRESENT_OPTIONS);
/// <summary>
/// Contains rendering options (hardware or software), pixel format, DPI
/// information, remoting options, and Direct3D support requirements for a render
/// target.
/// </summary>
typedef struct D2D1_RENDER_TARGET_PROPERTIES
{
D2D1_RENDER_TARGET_TYPE type;
D2D1_PIXEL_FORMAT pixelFormat;
FLOAT dpiX;
FLOAT dpiY;
D2D1_RENDER_TARGET_USAGE usage;
D2D1_FEATURE_LEVEL minLevel;
} D2D1_RENDER_TARGET_PROPERTIES;
/// <summary>
/// Contains the HWND, pixel size, and presentation options for an
/// ID2D1HwndRenderTarget.
/// </summary>
typedef struct D2D1_HWND_RENDER_TARGET_PROPERTIES
{
HWND hwnd;
D2D1_SIZE_U pixelSize;
D2D1_PRESENT_OPTIONS presentOptions;
} D2D1_HWND_RENDER_TARGET_PROPERTIES;
/// <summary>
/// Specifies additional features supportable by a compatible render target when it
/// is created. This enumeration allows a bitwise combination of its member values.
/// </summary>
typedef enum D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS
{
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE = 0x00000000,
/// <summary>
/// The compatible render target will allow a call to GetDC on the
/// ID2D1GdiInteropRenderTarget interface. This can be specified even if the parent
/// render target is not GDI compatible.
/// </summary>
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE = 0x00000001,
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_FORCE_DWORD = 0xffffffff
} D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS);
/// <summary>
/// Allows the drawing state to be atomically created. This also specifies the
/// drawing state that is saved into an IDrawingStateBlock object.
/// </summary>
typedef struct D2D1_DRAWING_STATE_DESCRIPTION
{
D2D1_ANTIALIAS_MODE antialiasMode;
D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode;
D2D1_TAG tag1;
D2D1_TAG tag2;
D2D1_MATRIX_3X2_F transform;
} D2D1_DRAWING_STATE_DESCRIPTION;
/// <summary>
/// Specifies how a device context is initialized for GDI rendering when it is
/// retrieved from the render target.
/// </summary>
typedef enum D2D1_DC_INITIALIZE_MODE
{
/// <summary>
/// The contents of the D2D render target will be copied to the DC.
/// </summary>
D2D1_DC_INITIALIZE_MODE_COPY = 0,
/// <summary>
/// The contents of the DC will be cleared.
/// </summary>
D2D1_DC_INITIALIZE_MODE_CLEAR = 1,
D2D1_DC_INITIALIZE_MODE_FORCE_DWORD = 0xffffffff
} D2D1_DC_INITIALIZE_MODE;
/// <summary>
/// Indicates the debug level to be output by the debug layer.
/// </summary>
typedef enum D2D1_DEBUG_LEVEL
{
D2D1_DEBUG_LEVEL_NONE = 0,
D2D1_DEBUG_LEVEL_ERROR = 1,
D2D1_DEBUG_LEVEL_WARNING = 2,
D2D1_DEBUG_LEVEL_INFORMATION = 3,
D2D1_DEBUG_LEVEL_FORCE_DWORD = 0xffffffff
} D2D1_DEBUG_LEVEL;
/// <summary>
/// Specifies the threading model of the created factory and all of its derived
/// resources.
/// </summary>
typedef enum D2D1_FACTORY_TYPE
{
/// <summary>
/// The resulting factory and derived resources may only be invoked serially.
/// Reference counts on resources are interlocked, however, resource and render
/// target state is not protected from multi-threaded access.
/// </summary>
D2D1_FACTORY_TYPE_SINGLE_THREADED = 0,
/// <summary>
/// The resulting factory may be invoked from multiple threads. Returned resources
/// use interlocked reference counting and their state is protected.
/// </summary>
D2D1_FACTORY_TYPE_MULTI_THREADED = 1,
D2D1_FACTORY_TYPE_FORCE_DWORD = 0xffffffff
} D2D1_FACTORY_TYPE;
/// <summary>
/// Allows additional parameters for factory creation.
/// </summary>