/
d2d1_1.h
2523 lines (2105 loc) · 73.6 KB
/
d2d1_1.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_1.h
//---------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma once
#endif // #ifdef _MSC_VER
#ifndef _D2D1_1_H_
#define _D2D1_1_H_
#ifndef _D2D1_H_
#include <d2d1.h>
#endif // #ifndef _D2D1_H_
#ifndef _D2D1_EFFECTS_
#include <d2d1effects.h>
#endif // #ifndef _D2D1_EFFECTS_
#include <dxgi.h>
typedef interface ID2D1ColorContext ID2D1ColorContext;
typedef interface IWICColorContext IWICColorContext;
typedef interface IWICImagingFactory IWICImagingFactory;
typedef interface IPrintDocumentPackageTarget IPrintDocumentPackageTarget;
typedef interface IDWriteFactory IDWriteFactory;
typedef struct DWRITE_GLYPH_RUN_DESCRIPTION DWRITE_GLYPH_RUN_DESCRIPTION;
typedef struct D2D1_PROPERTY_BINDING D2D1_PROPERTY_BINDING;
/// <summary>
/// Function pointer to construct a new effect once registered.
/// </summary>
typedef HRESULT (CALLBACK *PD2D1_EFFECT_FACTORY)(
_Outptr_ IUnknown **effectImpl
);
#ifndef D2D_USE_C_DEFINITIONS
interface ID2D1Device;
interface ID2D1Effect;
#else
typedef interface ID2D1Device ID2D1Device;
typedef interface ID2D1Effect ID2D1Effect;
#endif
#define D2D1_INVALID_PROPERTY_INDEX UINT_MAX
typedef D2D_RECT_L D2D1_RECT_L;
typedef D2D_POINT_2L D2D1_POINT_2L;
/// <summary>
/// This defines the valid property types that can be used in an effect property
/// interface.
/// </summary>
typedef enum D2D1_PROPERTY_TYPE
{
D2D1_PROPERTY_TYPE_UNKNOWN = 0,
D2D1_PROPERTY_TYPE_STRING = 1,
D2D1_PROPERTY_TYPE_BOOL = 2,
D2D1_PROPERTY_TYPE_UINT32 = 3,
D2D1_PROPERTY_TYPE_INT32 = 4,
D2D1_PROPERTY_TYPE_FLOAT = 5,
D2D1_PROPERTY_TYPE_VECTOR2 = 6,
D2D1_PROPERTY_TYPE_VECTOR3 = 7,
D2D1_PROPERTY_TYPE_VECTOR4 = 8,
D2D1_PROPERTY_TYPE_BLOB = 9,
D2D1_PROPERTY_TYPE_IUNKNOWN = 10,
D2D1_PROPERTY_TYPE_ENUM = 11,
D2D1_PROPERTY_TYPE_ARRAY = 12,
D2D1_PROPERTY_TYPE_CLSID = 13,
D2D1_PROPERTY_TYPE_MATRIX_3X2 = 14,
D2D1_PROPERTY_TYPE_MATRIX_4X3 = 15,
D2D1_PROPERTY_TYPE_MATRIX_4X4 = 16,
D2D1_PROPERTY_TYPE_MATRIX_5X4 = 17,
D2D1_PROPERTY_TYPE_COLOR_CONTEXT = 18,
D2D1_PROPERTY_TYPE_FORCE_DWORD = 0xffffffff
} D2D1_PROPERTY_TYPE;
/// <summary>
/// This defines the list of system properties present on the root effect property
/// interface.
/// </summary>
typedef enum D2D1_PROPERTY
{
D2D1_PROPERTY_CLSID = 0x80000000,
D2D1_PROPERTY_DISPLAYNAME = 0x80000001,
D2D1_PROPERTY_AUTHOR = 0x80000002,
D2D1_PROPERTY_CATEGORY = 0x80000003,
D2D1_PROPERTY_DESCRIPTION = 0x80000004,
D2D1_PROPERTY_INPUTS = 0x80000005,
D2D1_PROPERTY_CACHED = 0x80000006,
D2D1_PROPERTY_PRECISION = 0x80000007,
D2D1_PROPERTY_MIN_INPUTS = 0x80000008,
D2D1_PROPERTY_MAX_INPUTS = 0x80000009,
D2D1_PROPERTY_FORCE_DWORD = 0xffffffff
} D2D1_PROPERTY;
/// <summary>
/// This defines the indices of sub-properties that may be present on any parent
/// property.
/// </summary>
typedef enum D2D1_SUBPROPERTY
{
D2D1_SUBPROPERTY_DISPLAYNAME = 0x80000000,
D2D1_SUBPROPERTY_ISREADONLY = 0x80000001,
D2D1_SUBPROPERTY_MIN = 0x80000002,
D2D1_SUBPROPERTY_MAX = 0x80000003,
D2D1_SUBPROPERTY_DEFAULT = 0x80000004,
D2D1_SUBPROPERTY_FIELDS = 0x80000005,
D2D1_SUBPROPERTY_INDEX = 0x80000006,
D2D1_SUBPROPERTY_FORCE_DWORD = 0xffffffff
} D2D1_SUBPROPERTY;
/// <summary>
/// Specifies how the bitmap can be used.
/// </summary>
typedef enum D2D1_BITMAP_OPTIONS
{
/// <summary>
/// The bitmap is created with default properties.
/// </summary>
D2D1_BITMAP_OPTIONS_NONE = 0x00000000,
/// <summary>
/// The bitmap can be specified as a target in ID2D1DeviceContext::SetTarget
/// </summary>
D2D1_BITMAP_OPTIONS_TARGET = 0x00000001,
/// <summary>
/// The bitmap cannot be used as an input to DrawBitmap, DrawImage, in a bitmap
/// brush or as an input to an effect.
/// </summary>
D2D1_BITMAP_OPTIONS_CANNOT_DRAW = 0x00000002,
/// <summary>
/// The bitmap can be read from the CPU.
/// </summary>
D2D1_BITMAP_OPTIONS_CPU_READ = 0x00000004,
/// <summary>
/// The bitmap works with the ID2D1GdiInteropRenderTarget::GetDC API.
/// </summary>
D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE = 0x00000008,
D2D1_BITMAP_OPTIONS_FORCE_DWORD = 0xffffffff
} D2D1_BITMAP_OPTIONS;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_BITMAP_OPTIONS);
/// <summary>
/// Specifies the composite mode that will be applied.
/// </summary>
typedef enum D2D1_COMPOSITE_MODE
{
D2D1_COMPOSITE_MODE_SOURCE_OVER = 0,
D2D1_COMPOSITE_MODE_DESTINATION_OVER = 1,
D2D1_COMPOSITE_MODE_SOURCE_IN = 2,
D2D1_COMPOSITE_MODE_DESTINATION_IN = 3,
D2D1_COMPOSITE_MODE_SOURCE_OUT = 4,
D2D1_COMPOSITE_MODE_DESTINATION_OUT = 5,
D2D1_COMPOSITE_MODE_SOURCE_ATOP = 6,
D2D1_COMPOSITE_MODE_DESTINATION_ATOP = 7,
D2D1_COMPOSITE_MODE_XOR = 8,
D2D1_COMPOSITE_MODE_PLUS = 9,
D2D1_COMPOSITE_MODE_SOURCE_COPY = 10,
D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY = 11,
D2D1_COMPOSITE_MODE_MASK_INVERT = 12,
D2D1_COMPOSITE_MODE_FORCE_DWORD = 0xffffffff
} D2D1_COMPOSITE_MODE;
/// <summary>
/// This specifies the precision that should be used in buffers allocated by D2D.
/// </summary>
typedef enum D2D1_BUFFER_PRECISION
{
D2D1_BUFFER_PRECISION_UNKNOWN = 0,
D2D1_BUFFER_PRECISION_8BPC_UNORM = 1,
D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB = 2,
D2D1_BUFFER_PRECISION_16BPC_UNORM = 3,
D2D1_BUFFER_PRECISION_16BPC_FLOAT = 4,
D2D1_BUFFER_PRECISION_32BPC_FLOAT = 5,
D2D1_BUFFER_PRECISION_FORCE_DWORD = 0xffffffff
} D2D1_BUFFER_PRECISION;
/// <summary>
/// This describes how the individual mapping operation should be performed.
/// </summary>
typedef enum D2D1_MAP_OPTIONS
{
/// <summary>
/// The mapped pointer has undefined behavior.
/// </summary>
D2D1_MAP_OPTIONS_NONE = 0,
/// <summary>
/// The mapped pointer can be read from.
/// </summary>
D2D1_MAP_OPTIONS_READ = 1,
/// <summary>
/// The mapped pointer can be written to.
/// </summary>
D2D1_MAP_OPTIONS_WRITE = 2,
/// <summary>
/// The previous contents of the bitmap are discarded when it is mapped.
/// </summary>
D2D1_MAP_OPTIONS_DISCARD = 4,
D2D1_MAP_OPTIONS_FORCE_DWORD = 0xffffffff
} D2D1_MAP_OPTIONS;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_MAP_OPTIONS);
/// <summary>
/// This is used to specify the quality of image scaling with
/// ID2D1DeviceContext::DrawImage and with the 2D Affine Transform Effect.
/// </summary>
typedef enum D2D1_INTERPOLATION_MODE
{
D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR = D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR,
D2D1_INTERPOLATION_MODE_LINEAR = D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR,
D2D1_INTERPOLATION_MODE_CUBIC = D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC,
D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR,
D2D1_INTERPOLATION_MODE_ANISOTROPIC = D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC,
D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC,
D2D1_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
} D2D1_INTERPOLATION_MODE;
/// <summary>
/// This specifies what units should be accepted by the D2D API.
/// </summary>
typedef enum D2D1_UNIT_MODE
{
D2D1_UNIT_MODE_DIPS = 0,
D2D1_UNIT_MODE_PIXELS = 1,
D2D1_UNIT_MODE_FORCE_DWORD = 0xffffffff
} D2D1_UNIT_MODE;
/// <summary>
/// Defines a color space.
/// </summary>
typedef enum D2D1_COLOR_SPACE
{
/// <summary>
/// The color space is described by accompanying data, such as a color profile.
/// </summary>
D2D1_COLOR_SPACE_CUSTOM = 0,
/// <summary>
/// The sRGB color space.
/// </summary>
D2D1_COLOR_SPACE_SRGB = 1,
/// <summary>
/// The scRGB color space.
/// </summary>
D2D1_COLOR_SPACE_SCRGB = 2,
D2D1_COLOR_SPACE_FORCE_DWORD = 0xffffffff
} D2D1_COLOR_SPACE;
/// <summary>
/// This specifies options that apply to the device context for its lifetime.
/// </summary>
typedef enum D2D1_DEVICE_CONTEXT_OPTIONS
{
D2D1_DEVICE_CONTEXT_OPTIONS_NONE = 0,
/// <summary>
/// Geometry rendering will be performed on many threads in parallel, a single
/// thread is the default.
/// </summary>
D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS = 1,
D2D1_DEVICE_CONTEXT_OPTIONS_FORCE_DWORD = 0xffffffff
} D2D1_DEVICE_CONTEXT_OPTIONS;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_DEVICE_CONTEXT_OPTIONS);
/// <summary>
/// Defines how the world transform, dots per inch (dpi), and stroke width affect
/// the shape of the pen used to stroke a primitive.
/// </summary>
typedef enum D2D1_STROKE_TRANSFORM_TYPE
{
/// <summary>
/// The stroke respects the world transform, the DPI, and the stroke width.
/// </summary>
D2D1_STROKE_TRANSFORM_TYPE_NORMAL = 0,
/// <summary>
/// The stroke does not respect the world transform, but it does respect the DPI and
/// the stroke width.
/// </summary>
D2D1_STROKE_TRANSFORM_TYPE_FIXED = 1,
/// <summary>
/// The stroke is forced to one pixel wide.
/// </summary>
D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE = 2,
D2D1_STROKE_TRANSFORM_TYPE_FORCE_DWORD = 0xffffffff
} D2D1_STROKE_TRANSFORM_TYPE;
/// <summary>
/// A blend mode that applies to all primitives drawn on the context.
/// </summary>
typedef enum D2D1_PRIMITIVE_BLEND
{
D2D1_PRIMITIVE_BLEND_SOURCE_OVER = 0,
D2D1_PRIMITIVE_BLEND_COPY = 1,
D2D1_PRIMITIVE_BLEND_MIN = 2,
D2D1_PRIMITIVE_BLEND_ADD = 3,
D2D1_PRIMITIVE_BLEND_MAX = 4,
D2D1_PRIMITIVE_BLEND_FORCE_DWORD = 0xffffffff
} D2D1_PRIMITIVE_BLEND;
/// <summary>
/// This specifies the threading mode used while simultaneously creating the device,
/// factory, and device context.
/// </summary>
typedef enum D2D1_THREADING_MODE
{
/// <summary>
/// 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_THREADING_MODE_SINGLE_THREADED = D2D1_FACTORY_TYPE_SINGLE_THREADED,
/// <summary>
/// Resources may be invoked from multiple threads. Resources use interlocked
/// reference counting and their state is protected.
/// </summary>
D2D1_THREADING_MODE_MULTI_THREADED = D2D1_FACTORY_TYPE_MULTI_THREADED,
D2D1_THREADING_MODE_FORCE_DWORD = 0xffffffff
} D2D1_THREADING_MODE;
/// <summary>
/// This specifies how colors are interpolated.
/// </summary>
typedef enum D2D1_COLOR_INTERPOLATION_MODE
{
/// <summary>
/// Colors will be interpolated in straight alpha space.
/// </summary>
D2D1_COLOR_INTERPOLATION_MODE_STRAIGHT = 0,
/// <summary>
/// Colors will be interpolated in premultiplied alpha space.
/// </summary>
D2D1_COLOR_INTERPOLATION_MODE_PREMULTIPLIED = 1,
D2D1_COLOR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
} D2D1_COLOR_INTERPOLATION_MODE;
typedef D2D_VECTOR_2F D2D1_VECTOR_2F;
typedef D2D_VECTOR_3F D2D1_VECTOR_3F;
typedef D2D_VECTOR_4F D2D1_VECTOR_4F;
/// <summary>
/// Extended bitmap properties.
/// </summary>
typedef struct D2D1_BITMAP_PROPERTIES1
{
D2D1_PIXEL_FORMAT pixelFormat;
FLOAT dpiX;
FLOAT dpiY;
/// <summary>
/// Specifies how the bitmap can be used.
/// </summary>
D2D1_BITMAP_OPTIONS bitmapOptions;
_Field_size_opt_(1) ID2D1ColorContext *colorContext;
} D2D1_BITMAP_PROPERTIES1;
/// <summary>
/// Describes mapped memory from the ID2D1Bitmap1::Map API.
/// </summary>
typedef struct D2D1_MAPPED_RECT
{
UINT32 pitch;
BYTE *bits;
} D2D1_MAPPED_RECT;
/// <summary>
/// This controls advanced settings of the Direct2D imaging pipeline.
/// </summary>
typedef struct D2D1_RENDERING_CONTROLS
{
/// <summary>
/// The default buffer precision, used if the precision isn't otherwise specified.
/// </summary>
D2D1_BUFFER_PRECISION bufferPrecision;
/// <summary>
/// The size of allocated tiles used to render imaging effects.
/// </summary>
D2D1_SIZE_U tileSize;
} D2D1_RENDERING_CONTROLS;
/// <summary>
/// This identifies a certain input connection of a certain effect.
/// </summary>
typedef struct D2D1_EFFECT_INPUT_DESCRIPTION
{
/// <summary>
/// The effect whose input connection is being specified.
/// </summary>
ID2D1Effect *effect;
/// <summary>
/// The index of the input connection into the specified effect.
/// </summary>
UINT32 inputIndex;
/// <summary>
/// The rectangle which would be available on the specified input connection during
/// render operations.
/// </summary>
D2D1_RECT_F inputRectangle;
} D2D1_EFFECT_INPUT_DESCRIPTION;
typedef D2D_MATRIX_4X3_F D2D1_MATRIX_4X3_F;
typedef D2D_MATRIX_4X4_F D2D1_MATRIX_4X4_F;
typedef D2D_MATRIX_5X4_F D2D1_MATRIX_5X4_F;
/// <summary>
/// Describes a point along a path.
/// </summary>
typedef struct D2D1_POINT_DESCRIPTION
{
D2D1_POINT_2F point;
D2D1_POINT_2F unitTangentVector;
UINT32 endSegment;
UINT32 endFigure;
FLOAT lengthToEndSegment;
} D2D1_POINT_DESCRIPTION;
/// <summary>
/// Creation properties for an image brush.
/// </summary>
typedef struct D2D1_IMAGE_BRUSH_PROPERTIES
{
D2D1_RECT_F sourceRectangle;
D2D1_EXTEND_MODE extendModeX;
D2D1_EXTEND_MODE extendModeY;
D2D1_INTERPOLATION_MODE interpolationMode;
} D2D1_IMAGE_BRUSH_PROPERTIES;
/// <summary>
/// Describes the extend modes and the interpolation mode of an ID2D1BitmapBrush.
/// </summary>
typedef struct D2D1_BITMAP_BRUSH_PROPERTIES1
{
D2D1_EXTEND_MODE extendModeX;
D2D1_EXTEND_MODE extendModeY;
D2D1_INTERPOLATION_MODE interpolationMode;
} D2D1_BITMAP_BRUSH_PROPERTIES1;
/// <summary>
/// This defines how geometries should be drawn and widened.
/// </summary>
typedef struct D2D1_STROKE_STYLE_PROPERTIES1
{
D2D1_CAP_STYLE startCap;
D2D1_CAP_STYLE endCap;
D2D1_CAP_STYLE dashCap;
D2D1_LINE_JOIN lineJoin;
FLOAT miterLimit;
D2D1_DASH_STYLE dashStyle;
FLOAT dashOffset;
/// <summary>
/// How the nib of the stroke is influenced by the context properties.
/// </summary>
D2D1_STROKE_TRANSFORM_TYPE transformType;
} D2D1_STROKE_STYLE_PROPERTIES1;
/// <summary>
/// Specifies how the layer contents should be prepared.
/// </summary>
typedef enum D2D1_LAYER_OPTIONS1
{
D2D1_LAYER_OPTIONS1_NONE = 0,
D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND = 1,
D2D1_LAYER_OPTIONS1_IGNORE_ALPHA = 2,
D2D1_LAYER_OPTIONS1_FORCE_DWORD = 0xffffffff
} D2D1_LAYER_OPTIONS1;
DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS1);
/// <summary>
/// All parameters related to pushing a layer.
/// </summary>
typedef struct D2D1_LAYER_PARAMETERS1
{
D2D1_RECT_F contentBounds;
_Field_size_opt_(1) ID2D1Geometry *geometricMask;
D2D1_ANTIALIAS_MODE maskAntialiasMode;
D2D1_MATRIX_3X2_F maskTransform;
FLOAT opacity;
_Field_size_opt_(1) ID2D1Brush *opacityBrush;
D2D1_LAYER_OPTIONS1 layerOptions;
} D2D1_LAYER_PARAMETERS1;
/// <summary>
/// Defines when font resources should be subset during printing.
/// </summary>
typedef enum D2D1_PRINT_FONT_SUBSET_MODE
{
/// <summary>
/// Subset for used glyphs, send and discard font resource after every five pages
/// </summary>
D2D1_PRINT_FONT_SUBSET_MODE_DEFAULT = 0,
/// <summary>
/// Subset for used glyphs, send and discard font resource after each page
/// </summary>
D2D1_PRINT_FONT_SUBSET_MODE_EACHPAGE = 1,
/// <summary>
/// Do not subset, reuse font for all pages, send it after first page
/// </summary>
D2D1_PRINT_FONT_SUBSET_MODE_NONE = 2,
D2D1_PRINT_FONT_SUBSET_MODE_FORCE_DWORD = 0xffffffff
} D2D1_PRINT_FONT_SUBSET_MODE;
/// <summary>
/// This describes the drawing state.
/// </summary>
typedef struct D2D1_DRAWING_STATE_DESCRIPTION1
{
D2D1_ANTIALIAS_MODE antialiasMode;
D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode;
D2D1_TAG tag1;
D2D1_TAG tag2;
D2D1_MATRIX_3X2_F transform;
D2D1_PRIMITIVE_BLEND primitiveBlend;
D2D1_UNIT_MODE unitMode;
} D2D1_DRAWING_STATE_DESCRIPTION1;
/// <summary>
/// The creation properties for a ID2D1PrintControl object.
/// </summary>
typedef struct D2D1_PRINT_CONTROL_PROPERTIES
{
D2D1_PRINT_FONT_SUBSET_MODE fontSubset;
/// <summary>
/// DPI for rasterization of all unsupported D2D commands or options, defaults to
/// 150.0
/// </summary>
FLOAT rasterDPI;
/// <summary>
/// Color space for vector graphics in XPS package
/// </summary>
D2D1_COLOR_SPACE colorSpace;
} D2D1_PRINT_CONTROL_PROPERTIES;
/// <summary>
/// This specifies the options while simultaneously creating the device, factory,
/// and device context.
/// </summary>
typedef struct D2D1_CREATION_PROPERTIES
{
/// <summary>
/// Describes locking behavior of D2D resources
/// </summary>
D2D1_THREADING_MODE threadingMode;
D2D1_DEBUG_LEVEL debugLevel;
D2D1_DEVICE_CONTEXT_OPTIONS options;
} D2D1_CREATION_PROPERTIES;
EXTERN_C CONST IID IID_ID2D1GdiMetafileSink;
EXTERN_C CONST IID IID_ID2D1GdiMetafile;
EXTERN_C CONST IID IID_ID2D1CommandSink;
EXTERN_C CONST IID IID_ID2D1CommandList;
EXTERN_C CONST IID IID_ID2D1PrintControl;
EXTERN_C CONST IID IID_ID2D1ImageBrush;
EXTERN_C CONST IID IID_ID2D1BitmapBrush1;
EXTERN_C CONST IID IID_ID2D1StrokeStyle1;
EXTERN_C CONST IID IID_ID2D1PathGeometry1;
EXTERN_C CONST IID IID_ID2D1Properties;
EXTERN_C CONST IID IID_ID2D1Effect;
EXTERN_C CONST IID IID_ID2D1Bitmap1;
EXTERN_C CONST IID IID_ID2D1ColorContext;
EXTERN_C CONST IID IID_ID2D1GradientStopCollection1;
EXTERN_C CONST IID IID_ID2D1DrawingStateBlock1;
EXTERN_C CONST IID IID_ID2D1DeviceContext;
EXTERN_C CONST IID IID_ID2D1Device;
EXTERN_C CONST IID IID_ID2D1Factory1;
EXTERN_C CONST IID IID_ID2D1Multithread;
#ifndef D2D_USE_C_DEFINITIONS
/// <summary>
/// User-implementable interface for introspecting on a metafile.
/// </summary>
interface DX_DECLARE_INTERFACE("82237326-8111-4f7c-bcf4-b5c1175564fe") ID2D1GdiMetafileSink : public IUnknown
{
/// <summary>
/// Callback for examining a metafile record.
/// </summary>
STDMETHOD(ProcessRecord)(
DWORD recordType,
_In_opt_ CONST void *recordData,
DWORD recordDataSize
) PURE;
}; // interface ID2D1GdiMetafileSink
/// <summary>
/// Interface encapsulating a GDI/GDI+ metafile.
/// </summary>
interface DX_DECLARE_INTERFACE("2f543dc3-cfc1-4211-864f-cfd91c6f3395") ID2D1GdiMetafile : public ID2D1Resource
{
/// <summary>
/// Play the metafile into a caller-supplied sink interface.
/// </summary>
STDMETHOD(Stream)(
_In_ ID2D1GdiMetafileSink *sink
) PURE;
/// <summary>
/// Gets the bounds of the metafile.
/// </summary>
STDMETHOD(GetBounds)(
_Out_ D2D1_RECT_F *bounds
) PURE;
}; // interface ID2D1GdiMetafile
/// <summary>
/// Caller-supplied implementation of an interface to receive the recorded command
/// list.
/// </summary>
interface DX_DECLARE_INTERFACE("54d7898a-a061-40a7-bec7-e465bcba2c4f") ID2D1CommandSink : public IUnknown
{
STDMETHOD(BeginDraw)(
) PURE;
STDMETHOD(EndDraw)(
) PURE;
STDMETHOD(SetAntialiasMode)(
D2D1_ANTIALIAS_MODE antialiasMode
) PURE;
STDMETHOD(SetTags)(
D2D1_TAG tag1,
D2D1_TAG tag2
) PURE;
STDMETHOD(SetTextAntialiasMode)(
D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
) PURE;
STDMETHOD(SetTextRenderingParams)(
_In_opt_ IDWriteRenderingParams *textRenderingParams
) PURE;
STDMETHOD(SetTransform)(
_In_ CONST D2D1_MATRIX_3X2_F *transform
) PURE;
STDMETHOD(SetPrimitiveBlend)(
D2D1_PRIMITIVE_BLEND primitiveBlend
) PURE;
STDMETHOD(SetUnitMode)(
D2D1_UNIT_MODE unitMode
) PURE;
STDMETHOD(Clear)(
_In_opt_ CONST D2D1_COLOR_F *color
) PURE;
STDMETHOD(DrawGlyphRun)(
D2D1_POINT_2F baselineOrigin,
_In_ CONST DWRITE_GLYPH_RUN *glyphRun,
_In_opt_ CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription,
_In_ ID2D1Brush *foregroundBrush,
DWRITE_MEASURING_MODE measuringMode
) PURE;
STDMETHOD(DrawLine)(
D2D1_POINT_2F point0,
D2D1_POINT_2F point1,
_In_ ID2D1Brush *brush,
FLOAT strokeWidth,
_In_opt_ ID2D1StrokeStyle *strokeStyle
) PURE;
STDMETHOD(DrawGeometry)(
_In_ ID2D1Geometry *geometry,
_In_ ID2D1Brush *brush,
FLOAT strokeWidth,
_In_opt_ ID2D1StrokeStyle *strokeStyle
) PURE;
STDMETHOD(DrawRectangle)(
_In_ CONST D2D1_RECT_F *rect,
_In_ ID2D1Brush *brush,
FLOAT strokeWidth,
_In_opt_ ID2D1StrokeStyle *strokeStyle
) PURE;
STDMETHOD(DrawBitmap)(
_In_ ID2D1Bitmap *bitmap,
_In_opt_ CONST D2D1_RECT_F *destinationRectangle,
FLOAT opacity,
D2D1_INTERPOLATION_MODE interpolationMode,
_In_opt_ CONST D2D1_RECT_F *sourceRectangle,
_In_opt_ CONST D2D1_MATRIX_4X4_F *perspectiveTransform
) PURE;
STDMETHOD(DrawImage)(
_In_ ID2D1Image *image,
_In_opt_ CONST D2D1_POINT_2F *targetOffset,
_In_opt_ CONST D2D1_RECT_F *imageRectangle,
D2D1_INTERPOLATION_MODE interpolationMode,
D2D1_COMPOSITE_MODE compositeMode
) PURE;
STDMETHOD(DrawGdiMetafile)(
_In_ ID2D1GdiMetafile *gdiMetafile,
_In_opt_ CONST D2D1_POINT_2F *targetOffset
) PURE;
STDMETHOD(FillMesh)(
_In_ ID2D1Mesh *mesh,
_In_ ID2D1Brush *brush
) PURE;
STDMETHOD(FillOpacityMask)(
_In_ ID2D1Bitmap *opacityMask,
_In_ ID2D1Brush *brush,
_In_opt_ CONST D2D1_RECT_F *destinationRectangle,
_In_opt_ CONST D2D1_RECT_F *sourceRectangle
) PURE;
STDMETHOD(FillGeometry)(
_In_ ID2D1Geometry *geometry,
_In_ ID2D1Brush *brush,
_In_opt_ ID2D1Brush *opacityBrush
) PURE;
STDMETHOD(FillRectangle)(
_In_ CONST D2D1_RECT_F *rect,
_In_ ID2D1Brush *brush
) PURE;
STDMETHOD(PushAxisAlignedClip)(
_In_ CONST D2D1_RECT_F *clipRect,
D2D1_ANTIALIAS_MODE antialiasMode
) PURE;
STDMETHOD(PushLayer)(
_In_ CONST D2D1_LAYER_PARAMETERS1 *layerParameters1,
_In_opt_ ID2D1Layer *layer
) PURE;
STDMETHOD(PopAxisAlignedClip)(
) PURE;
STDMETHOD(PopLayer)(
) PURE;
}; // interface ID2D1CommandSink
/// <summary>
/// The commandList interface.
/// </summary>
interface DX_DECLARE_INTERFACE("b4f34a19-2383-4d76-94f6-ec343657c3dc") ID2D1CommandList : public ID2D1Image
{
/// <summary>
/// Play the command list into a caller-supplied sink interface.
/// </summary>
STDMETHOD(Stream)(
_In_ ID2D1CommandSink *sink
) PURE;
/// <summary>
/// Marks the command list as ready for use.
/// </summary>
STDMETHOD(Close)(
) PURE;
}; // interface ID2D1CommandList
/// <summary>
/// Converts Direct2D primitives stored in an ID2D1CommandList into a fixed page
/// representation. The print sub-system then consumes the primitives.
/// </summary>
interface DX_DECLARE_INTERFACE("2c1d867d-c290-41c8-ae7e-34a98702e9a5") ID2D1PrintControl : public IUnknown
{
STDMETHOD(AddPage)(
_In_ ID2D1CommandList *commandList,
D2D_SIZE_F pageSize,
_In_opt_ IStream *pagePrintTicketStream,
_Out_opt_ D2D1_TAG *tag1 = NULL,
_Out_opt_ D2D1_TAG *tag2 = NULL
) PURE;
STDMETHOD(Close)(
) PURE;
}; // interface ID2D1PrintControl
/// <summary>
/// Provides a brush that can take any effect, command list or bitmap and use it to
/// fill a 2D shape.
/// </summary>
interface DX_DECLARE_INTERFACE("fe9e984d-3f95-407c-b5db-cb94d4e8f87c") ID2D1ImageBrush : public ID2D1Brush
{
STDMETHOD_(void, SetImage)(
_In_opt_ ID2D1Image *image
) PURE;
STDMETHOD_(void, SetExtendModeX)(
D2D1_EXTEND_MODE extendModeX
) PURE;
STDMETHOD_(void, SetExtendModeY)(
D2D1_EXTEND_MODE extendModeY
) PURE;
STDMETHOD_(void, SetInterpolationMode)(
D2D1_INTERPOLATION_MODE interpolationMode
) PURE;
STDMETHOD_(void, SetSourceRectangle)(
_In_ CONST D2D1_RECT_F *sourceRectangle
) PURE;
STDMETHOD_(void, GetImage)(
_Outptr_result_maybenull_ ID2D1Image **image
) CONST PURE;
STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)(
) CONST PURE;
STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)(
) CONST PURE;
STDMETHOD_(D2D1_INTERPOLATION_MODE, GetInterpolationMode)(
) CONST PURE;
STDMETHOD_(void, GetSourceRectangle)(
_Out_ D2D1_RECT_F *sourceRectangle
) CONST PURE;
}; // interface ID2D1ImageBrush
/// <summary>
/// A bitmap brush allows a bitmap to be used to fill a geometry. Interpolation
/// mode is specified with D2D1_INTERPOLATION_MODE
/// </summary>
interface DX_DECLARE_INTERFACE("41343a53-e41a-49a2-91cd-21793bbb62e5") ID2D1BitmapBrush1 : public ID2D1BitmapBrush
{
/// <summary>
/// Sets the interpolation mode used when this brush is used.
/// </summary>
STDMETHOD_(void, SetInterpolationMode1)(
D2D1_INTERPOLATION_MODE interpolationMode
) PURE;
STDMETHOD_(D2D1_INTERPOLATION_MODE, GetInterpolationMode1)(
) CONST PURE;
}; // interface ID2D1BitmapBrush1
/// <summary>
/// Extends a stroke style to allow nominal width strokes.
/// </summary>
interface DX_DECLARE_INTERFACE("10a72a66-e91c-43f4-993f-ddf4b82b0b4a") ID2D1StrokeStyle1 : public ID2D1StrokeStyle
{
STDMETHOD_(D2D1_STROKE_TRANSFORM_TYPE, GetStrokeTransformType)(
) CONST PURE;
}; // interface ID2D1StrokeStyle1
/// <summary>
/// The ID2D1PathGeometry1 interface adds functionality to ID2D1PathGeometry. In
/// particular, it provides the path geometry-specific
/// ComputePointAndSegmentAtLength method.
/// </summary>
interface DX_DECLARE_INTERFACE("62baa2d2-ab54-41b7-b872-787e0106a421") ID2D1PathGeometry1 : public ID2D1PathGeometry
{
STDMETHOD(ComputePointAndSegmentAtLength)(
FLOAT length,
UINT32 startSegment,
_In_opt_ CONST D2D1_MATRIX_3X2_F *worldTransform,
FLOAT flatteningTolerance,
_Out_ D2D1_POINT_DESCRIPTION *pointDescription
) CONST PURE;
COM_DECLSPEC_NOTHROW
HRESULT
ComputePointAndSegmentAtLength(
FLOAT length,
UINT32 startSegment,
CONST D2D1_MATRIX_3X2_F &worldTransform,
FLOAT flatteningTolerance,
_Out_ D2D1_POINT_DESCRIPTION *pointDescription
) CONST
{
return ComputePointAndSegmentAtLength(length, startSegment, &worldTransform, flatteningTolerance, pointDescription);
}
COM_DECLSPEC_NOTHROW
HRESULT
ComputePointAndSegmentAtLength(
FLOAT length,
UINT32 startSegment,
_In_opt_ CONST D2D1_MATRIX_3X2_F *worldTransform,
_Out_ D2D1_POINT_DESCRIPTION *pointDescription
) CONST
{
return ComputePointAndSegmentAtLength(length, startSegment, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, pointDescription);
}