1 //--------------------------------------------------------------------------- 2 // Copyright (c) Microsoft Corporation. All rights reserved. 3 // 4 // This file is automatically generated. Please do not edit it directly. 5 // 6 // File name: D2D1_3.h 7 //--------------------------------------------------------------------------- 8 #ifdef _MSC_VER 9 #pragma once 10 #endif // #ifdef _MSC_VER 11 12 #ifndef _D2D1_3_H_ 13 #define _D2D1_3_H_ 14 15 #ifndef _D2D1_2_H_ 16 #include <d2d1_2.h> 17 #endif // #ifndef _D2D1_2_H_ 18 #ifndef _D2D1_EFFECTS_2_ 19 #include <d2d1effects_2.h> 20 #endif // #ifndef _D2D1_EFFECTS_2_ 21 #ifndef _D2D1_SVG_ 22 #include <d2d1svg.h> 23 #endif // #ifndef _D2D1_SVG_ 24 25 /*#include <winapifamily.h>*/ 26 27 /*#pragma region Application Family*/ 28 /*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)*/ 29 30 typedef interface IWICBitmapFrameDecode IWICBitmapFrameDecode; 31 typedef interface IDWriteFontFace IDWriteFontFace; 32 33 /// <summary> 34 /// Specifies the appearance of the ink nib (pen tip) as part of an 35 /// D2D1_INK_STYLE_PROPERTIES structure. 36 /// </summary> 37 typedef enum D2D1_INK_NIB_SHAPE 38 { 39 D2D1_INK_NIB_SHAPE_ROUND = 0, 40 D2D1_INK_NIB_SHAPE_SQUARE = 1, 41 D2D1_INK_NIB_SHAPE_FORCE_DWORD = 0xffffffff 42 43 } D2D1_INK_NIB_SHAPE; 44 45 /// <summary> 46 /// Specifies the orientation of an image. 47 /// </summary> 48 typedef enum D2D1_ORIENTATION 49 { 50 D2D1_ORIENTATION_DEFAULT = 1, 51 D2D1_ORIENTATION_FLIP_HORIZONTAL = 2, 52 D2D1_ORIENTATION_ROTATE_CLOCKWISE180 = 3, 53 D2D1_ORIENTATION_ROTATE_CLOCKWISE180_FLIP_HORIZONTAL = 4, 54 D2D1_ORIENTATION_ROTATE_CLOCKWISE90_FLIP_HORIZONTAL = 5, 55 D2D1_ORIENTATION_ROTATE_CLOCKWISE270 = 6, 56 D2D1_ORIENTATION_ROTATE_CLOCKWISE270_FLIP_HORIZONTAL = 7, 57 D2D1_ORIENTATION_ROTATE_CLOCKWISE90 = 8, 58 D2D1_ORIENTATION_FORCE_DWORD = 0xffffffff 59 60 } D2D1_ORIENTATION; 61 62 /// <summary> 63 /// Option flags controlling how images sources are loaded during 64 /// CreateImageSourceFromWic. 65 /// </summary> 66 typedef enum D2D1_IMAGE_SOURCE_LOADING_OPTIONS 67 { 68 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_NONE = 0, 69 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_RELEASE_SOURCE = 1, 70 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_CACHE_ON_DEMAND = 2, 71 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_FORCE_DWORD = 0xffffffff 72 73 } D2D1_IMAGE_SOURCE_LOADING_OPTIONS; 74 75 DEFINE_ENUM_FLAG_OPERATORS(D2D1_IMAGE_SOURCE_LOADING_OPTIONS); 76 77 /// <summary> 78 /// Option flags controlling primary conversion performed by 79 /// CreateImageSourceFromDxgi, if any. 80 /// </summary> 81 typedef enum D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS 82 { 83 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_NONE = 0, 84 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_LOW_QUALITY_PRIMARY_CONVERSION = 1, 85 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_FORCE_DWORD = 0xffffffff 86 87 } D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS; 88 89 DEFINE_ENUM_FLAG_OPERATORS(D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS); 90 91 /// <summary> 92 /// Option flags for transformed image sources. 93 /// </summary> 94 typedef enum D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS 95 { 96 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE = 0, 97 98 /// <summary> 99 /// Prevents the image source from being automatically scaled (by a ratio of the 100 /// context DPI divided by 96) while drawn. 101 /// </summary> 102 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_DISABLE_DPI_SCALE = 1, 103 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_FORCE_DWORD = 0xffffffff 104 105 } D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS; 106 107 DEFINE_ENUM_FLAG_OPERATORS(D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS); 108 109 /// <summary> 110 /// Properties of a transformed image source. 111 /// </summary> 112 typedef struct D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES 113 { 114 115 /// <summary> 116 /// The orientation at which the image source is drawn. 117 /// </summary> 118 D2D1_ORIENTATION orientation; 119 120 /// <summary> 121 /// The horizontal scale factor at which the image source is drawn. 122 /// </summary> 123 FLOAT scaleX; 124 125 /// <summary> 126 /// The vertical scale factor at which the image source is drawn. 127 /// </summary> 128 FLOAT scaleY; 129 130 /// <summary> 131 /// The interpolation mode used when the image source is drawn. This is ignored if 132 /// the image source is drawn using the DrawImage method, or using an image brush. 133 /// </summary> 134 D2D1_INTERPOLATION_MODE interpolationMode; 135 136 /// <summary> 137 /// Option flags. 138 /// </summary> 139 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS options; 140 141 } D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES; 142 143 /// <summary> 144 /// Represents a point, radius pair that makes up part of a D2D1_INK_BEZIER_SEGMENT. 145 /// </summary> 146 typedef struct D2D1_INK_POINT 147 { 148 FLOAT x; 149 FLOAT y; 150 FLOAT radius; 151 152 } D2D1_INK_POINT; 153 154 /// <summary> 155 /// Represents a Bezier segment to be used in the creation of an ID2D1Ink object. 156 /// This structure differs from D2D1_BEZIER_SEGMENT in that it is composed of 157 /// D2D1_INK_POINT s, which contain a radius in addition to x- and y-coordinates. 158 /// </summary> 159 typedef struct D2D1_INK_BEZIER_SEGMENT 160 { 161 D2D1_INK_POINT point1; 162 D2D1_INK_POINT point2; 163 D2D1_INK_POINT point3; 164 165 } D2D1_INK_BEZIER_SEGMENT; 166 167 /// <summary> 168 /// Defines the general pen tip shape and the transform used in an ID2D1InkStyle 169 /// object. 170 /// </summary> 171 typedef struct D2D1_INK_STYLE_PROPERTIES 172 { 173 174 /// <summary> 175 /// The general shape of the nib used to draw a given ink object. 176 /// </summary> 177 D2D1_INK_NIB_SHAPE nibShape; 178 179 /// <summary> 180 /// The transform applied to shape of the nib. _31 and _32 are ignored. 181 /// </summary> 182 D2D1_MATRIX_3X2_F nibTransform; 183 184 } D2D1_INK_STYLE_PROPERTIES; 185 186 /// <summary> 187 /// Specifies how to render gradient mesh edges. 188 /// </summary> 189 typedef enum D2D1_PATCH_EDGE_MODE 190 { 191 192 /// <summary> 193 /// Render this edge aliased. 194 /// </summary> 195 D2D1_PATCH_EDGE_MODE_ALIASED = 0, 196 197 /// <summary> 198 /// Render this edge antialiased. 199 /// </summary> 200 D2D1_PATCH_EDGE_MODE_ANTIALIASED = 1, 201 202 /// <summary> 203 /// Render this edge aliased and inflated out slightly. 204 /// </summary> 205 D2D1_PATCH_EDGE_MODE_ALIASED_INFLATED = 2, 206 D2D1_PATCH_EDGE_MODE_FORCE_DWORD = 0xffffffff 207 208 } D2D1_PATCH_EDGE_MODE; 209 210 /// <summary> 211 /// Represents a tensor patch with 16 control points, 4 corner colors, and boundary 212 /// flags. An ID2D1GradientMesh is made up of 1 or more gradient mesh patches. Use 213 /// the GradientMeshPatch function or the GradientMeshPatchFromCoonsPatch function 214 /// to create one. 215 /// </summary> 216 typedef struct D2D1_GRADIENT_MESH_PATCH 217 { 218 219 /// <summary> 220 /// The gradient mesh patch control point at position 00. 221 /// </summary> 222 D2D1_POINT_2F point00; 223 224 /// <summary> 225 /// The gradient mesh patch control point at position 01. 226 /// </summary> 227 D2D1_POINT_2F point01; 228 229 /// <summary> 230 /// The gradient mesh patch control point at position 02. 231 /// </summary> 232 D2D1_POINT_2F point02; 233 234 /// <summary> 235 /// The gradient mesh patch control point at position 03. 236 /// </summary> 237 D2D1_POINT_2F point03; 238 239 /// <summary> 240 /// The gradient mesh patch control point at position 10. 241 /// </summary> 242 D2D1_POINT_2F point10; 243 244 /// <summary> 245 /// The gradient mesh patch control point at position 11. 246 /// </summary> 247 D2D1_POINT_2F point11; 248 249 /// <summary> 250 /// The gradient mesh patch control point at position 12. 251 /// </summary> 252 D2D1_POINT_2F point12; 253 254 /// <summary> 255 /// The gradient mesh patch control point at position 13. 256 /// </summary> 257 D2D1_POINT_2F point13; 258 259 /// <summary> 260 /// The gradient mesh patch control point at position 20. 261 /// </summary> 262 D2D1_POINT_2F point20; 263 264 /// <summary> 265 /// The gradient mesh patch control point at position 21. 266 /// </summary> 267 D2D1_POINT_2F point21; 268 269 /// <summary> 270 /// The gradient mesh patch control point at position 22. 271 /// </summary> 272 D2D1_POINT_2F point22; 273 274 /// <summary> 275 /// The gradient mesh patch control point at position 23. 276 /// </summary> 277 D2D1_POINT_2F point23; 278 279 /// <summary> 280 /// The gradient mesh patch control point at position 30. 281 /// </summary> 282 D2D1_POINT_2F point30; 283 284 /// <summary> 285 /// The gradient mesh patch control point at position 31. 286 /// </summary> 287 D2D1_POINT_2F point31; 288 289 /// <summary> 290 /// The gradient mesh patch control point at position 32. 291 /// </summary> 292 D2D1_POINT_2F point32; 293 294 /// <summary> 295 /// The gradient mesh patch control point at position 33. 296 /// </summary> 297 D2D1_POINT_2F point33; 298 299 /// <summary> 300 /// The color associated with control point at position 00. 301 /// </summary> 302 D2D1_COLOR_F color00; 303 304 /// <summary> 305 /// The color associated with control point at position 03. 306 /// </summary> 307 D2D1_COLOR_F color03; 308 309 /// <summary> 310 /// The color associated with control point at position 30. 311 /// </summary> 312 D2D1_COLOR_F color30; 313 314 /// <summary> 315 /// The color associated with control point at position 33. 316 /// </summary> 317 D2D1_COLOR_F color33; 318 319 /// <summary> 320 /// The edge mode for the top edge of the patch. 321 /// </summary> 322 D2D1_PATCH_EDGE_MODE topEdgeMode; 323 324 /// <summary> 325 /// The edge mode for the left edge of the patch. 326 /// </summary> 327 D2D1_PATCH_EDGE_MODE leftEdgeMode; 328 329 /// <summary> 330 /// The edge mode for the bottom edge of the patch. 331 /// </summary> 332 D2D1_PATCH_EDGE_MODE bottomEdgeMode; 333 334 /// <summary> 335 /// The edge mode for the right edge of the patch. 336 /// </summary> 337 D2D1_PATCH_EDGE_MODE rightEdgeMode; 338 339 } D2D1_GRADIENT_MESH_PATCH; 340 341 typedef enum D2D1_SPRITE_OPTIONS 342 { 343 344 /// <summary> 345 /// Use default sprite rendering behavior. 346 /// </summary> 347 D2D1_SPRITE_OPTIONS_NONE = 0, 348 349 /// <summary> 350 /// Bitmap interpolation will be clamped to the sprite's source rectangle. 351 /// </summary> 352 D2D1_SPRITE_OPTIONS_CLAMP_TO_SOURCE_RECTANGLE = 1, 353 D2D1_SPRITE_OPTIONS_FORCE_DWORD = 0xffffffff 354 355 } D2D1_SPRITE_OPTIONS; 356 357 DEFINE_ENUM_FLAG_OPERATORS(D2D1_SPRITE_OPTIONS); 358 359 /// <summary> 360 /// Specifies the pixel snapping policy when rendering color bitmap glyphs. 361 /// </summary> 362 typedef enum D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION 363 { 364 365 /// <summary> 366 /// Color bitmap glyph positions are snapped to the nearest pixel if the bitmap 367 /// resolution matches that of the device context. 368 /// </summary> 369 D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DEFAULT = 0, 370 371 /// <summary> 372 /// Color bitmap glyph positions are not snapped. 373 /// </summary> 374 D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DISABLE = 1, 375 D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_FORCE_DWORD = 0xffffffff 376 377 } D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION; 378 379 /// <summary> 380 /// This determines what gamma is used for interpolation/blending. 381 /// </summary> 382 typedef enum D2D1_GAMMA1 383 { 384 385 /// <summary> 386 /// Colors are manipulated in 2.2 gamma color space. 387 /// </summary> 388 D2D1_GAMMA1_G22 = D2D1_GAMMA_2_2, 389 390 /// <summary> 391 /// Colors are manipulated in 1.0 gamma color space. 392 /// </summary> 393 D2D1_GAMMA1_G10 = D2D1_GAMMA_1_0, 394 395 /// <summary> 396 /// Colors are manipulated in ST.2084 PQ gamma color space. 397 /// </summary> 398 D2D1_GAMMA1_G2084 = 2, 399 D2D1_GAMMA1_FORCE_DWORD = 0xffffffff 400 401 } D2D1_GAMMA1; 402 403 /// <summary> 404 /// Simple description of a color space. 405 /// </summary> 406 typedef struct D2D1_SIMPLE_COLOR_PROFILE 407 { 408 409 /// <summary> 410 /// The XY coordinates of the red primary in CIEXYZ space. 411 /// </summary> 412 D2D1_POINT_2F redPrimary; 413 414 /// <summary> 415 /// The XY coordinates of the green primary in CIEXYZ space. 416 /// </summary> 417 D2D1_POINT_2F greenPrimary; 418 419 /// <summary> 420 /// The XY coordinates of the blue primary in CIEXYZ space. 421 /// </summary> 422 D2D1_POINT_2F bluePrimary; 423 424 /// <summary> 425 /// The X/Z tristimulus values for the whitepoint, normalized for relative 426 /// luminance. 427 /// </summary> 428 D2D1_POINT_2F whitePointXZ; 429 430 /// <summary> 431 /// The gamma encoding to use for this color space. 432 /// </summary> 433 D2D1_GAMMA1 gamma; 434 435 } D2D1_SIMPLE_COLOR_PROFILE; 436 437 /// <summary> 438 /// Specifies which way a color profile is defined. 439 /// </summary> 440 typedef enum D2D1_COLOR_CONTEXT_TYPE 441 { 442 D2D1_COLOR_CONTEXT_TYPE_ICC = 0, 443 D2D1_COLOR_CONTEXT_TYPE_SIMPLE = 1, 444 D2D1_COLOR_CONTEXT_TYPE_DXGI = 2, 445 D2D1_COLOR_CONTEXT_TYPE_FORCE_DWORD = 0xffffffff 446 447 } D2D1_COLOR_CONTEXT_TYPE; 448 449 EXTERN_C CONST IID IID_ID2D1InkStyle; 450 EXTERN_C CONST IID IID_ID2D1Ink; 451 EXTERN_C CONST IID IID_ID2D1GradientMesh; 452 EXTERN_C CONST IID IID_ID2D1ImageSource; 453 EXTERN_C CONST IID IID_ID2D1ImageSourceFromWic; 454 EXTERN_C CONST IID IID_ID2D1TransformedImageSource; 455 EXTERN_C CONST IID IID_ID2D1LookupTable3D; 456 EXTERN_C CONST IID IID_ID2D1DeviceContext2; 457 EXTERN_C CONST IID IID_ID2D1Device2; 458 EXTERN_C CONST IID IID_ID2D1Factory3; 459 EXTERN_C CONST IID IID_ID2D1CommandSink2; 460 EXTERN_C CONST IID IID_ID2D1GdiMetafile1; 461 EXTERN_C CONST IID IID_ID2D1GdiMetafileSink1; 462 EXTERN_C CONST IID IID_ID2D1SpriteBatch; 463 EXTERN_C CONST IID IID_ID2D1DeviceContext3; 464 EXTERN_C CONST IID IID_ID2D1Device3; 465 EXTERN_C CONST IID IID_ID2D1Factory4; 466 EXTERN_C CONST IID IID_ID2D1CommandSink3; 467 EXTERN_C CONST IID IID_ID2D1SvgGlyphStyle; 468 EXTERN_C CONST IID IID_ID2D1DeviceContext4; 469 EXTERN_C CONST IID IID_ID2D1Device4; 470 EXTERN_C CONST IID IID_ID2D1Factory5; 471 EXTERN_C CONST IID IID_ID2D1CommandSink4; 472 EXTERN_C CONST IID IID_ID2D1ColorContext1; 473 EXTERN_C CONST IID IID_ID2D1DeviceContext5; 474 EXTERN_C CONST IID IID_ID2D1Device5; 475 EXTERN_C CONST IID IID_ID2D1Factory6; 476 EXTERN_C CONST IID IID_ID2D1CommandSink5; 477 EXTERN_C CONST IID IID_ID2D1DeviceContext6; 478 EXTERN_C CONST IID IID_ID2D1Device6; 479 EXTERN_C CONST IID IID_ID2D1Factory7; 480 481 #ifndef D2D_USE_C_DEFINITIONS 482 483 /// <summary> 484 /// Represents a collection of style properties to be used by methods like 485 /// ID2D1DeviceContext2::DrawInk when rendering ink. The ink style defines the nib 486 /// (pen tip) shape and transform. 487 /// </summary> 488 interface DX_DECLARE_INTERFACE("bae8b344-23fc-4071-8cb5-d05d6f073848") ID2D1InkStyle : public ID2D1Resource 489 { 490 491 STDMETHOD_(void, SetNibTransform)( 492 _In_ CONST D2D1_MATRIX_3X2_F *transform 493 ) PURE; 494 495 STDMETHOD_(void, GetNibTransform)( 496 _Out_ D2D1_MATRIX_3X2_F *transform 497 ) CONST PURE; 498 499 STDMETHOD_(void, SetNibShape)( 500 D2D1_INK_NIB_SHAPE nibShape 501 ) PURE; 502 503 STDMETHOD_(D2D1_INK_NIB_SHAPE, GetNibShape)( 504 ) CONST PURE; 505 506 COM_DECLSPEC_NOTHROW 507 void SetNibTransform(CONST D2D1_MATRIX_3X2_F & transform)508 SetNibTransform( 509 CONST D2D1_MATRIX_3X2_F &transform 510 ) 511 { 512 SetNibTransform(&transform); 513 } 514 }; // interface ID2D1InkStyle 515 516 /// <summary> 517 /// Represents a single continuous stroke of variable-width ink, as defined by a 518 /// series of Bezier segments and widths. 519 /// </summary> 520 interface DX_DECLARE_INTERFACE("b499923b-7029-478f-a8b3-432c7c5f5312") ID2D1Ink : public ID2D1Resource 521 { 522 523 /// <summary> 524 /// Resets the ink start point. 525 /// </summary> 526 STDMETHOD_(void, SetStartPoint)( 527 _In_ CONST D2D1_INK_POINT *startPoint 528 ) PURE; 529 530 /// <summary> 531 /// Retrieve the start point with which the ink was initialized. 532 /// </summary> 533 STDMETHOD_(D2D1_INK_POINT, GetStartPoint)( 534 ) CONST PURE; 535 536 /// <summary> 537 /// Add one or more segments to the end of the ink. 538 /// </summary> 539 STDMETHOD(AddSegments)( 540 _In_reads_(segmentsCount) CONST D2D1_INK_BEZIER_SEGMENT *segments, 541 UINT32 segmentsCount 542 ) PURE; 543 544 /// <summary> 545 /// Remove one or more segments from the end of the ink. 546 /// </summary> 547 STDMETHOD(RemoveSegmentsAtEnd)( 548 UINT32 segmentsCount 549 ) PURE; 550 551 /// <summary> 552 /// Updates the specified segments with new control points. 553 /// </summary> 554 STDMETHOD(SetSegments)( 555 UINT32 startSegment, 556 _In_reads_(segmentsCount) CONST D2D1_INK_BEZIER_SEGMENT *segments, 557 UINT32 segmentsCount 558 ) PURE; 559 560 /// <summary> 561 /// Update the last segment with new control points. 562 /// </summary> 563 STDMETHOD(SetSegmentAtEnd)( 564 _In_ CONST D2D1_INK_BEZIER_SEGMENT *segment 565 ) PURE; 566 567 /// <summary> 568 /// Returns the number of segments the ink is composed of. 569 /// </summary> 570 STDMETHOD_(UINT32, GetSegmentCount)( 571 ) CONST PURE; 572 573 /// <summary> 574 /// Retrieve the segments stored in the ink. 575 /// </summary> 576 STDMETHOD(GetSegments)( 577 UINT32 startSegment, 578 _Out_writes_(segmentsCount) D2D1_INK_BEZIER_SEGMENT *segments, 579 UINT32 segmentsCount 580 ) CONST PURE; 581 582 /// <summary> 583 /// Construct a geometric representation of the ink. 584 /// </summary> 585 STDMETHOD(StreamAsGeometry)( 586 _In_opt_ ID2D1InkStyle *inkStyle, 587 _In_opt_ CONST D2D1_MATRIX_3X2_F *worldTransform, 588 FLOAT flatteningTolerance, 589 _In_ ID2D1SimplifiedGeometrySink *geometrySink 590 ) CONST PURE; 591 592 /// <summary> 593 /// Retrieve the bounds of the ink, with an optional applied transform. 594 /// </summary> 595 STDMETHOD(GetBounds)( 596 _In_opt_ ID2D1InkStyle *inkStyle, 597 _In_opt_ CONST D2D1_MATRIX_3X2_F *worldTransform, 598 _Out_ D2D1_RECT_F *bounds 599 ) CONST PURE; 600 601 /// <summary> 602 /// Resets the ink start point. 603 /// </summary> 604 COM_DECLSPEC_NOTHROW 605 void SetStartPoint(CONST D2D1_INK_POINT & startPoint)606 SetStartPoint( 607 CONST D2D1_INK_POINT &startPoint 608 ) 609 { 610 SetStartPoint(&startPoint); 611 } 612 613 COM_DECLSPEC_NOTHROW 614 HRESULT SetSegmentAtEnd(CONST D2D1_INK_BEZIER_SEGMENT & segment)615 SetSegmentAtEnd( 616 CONST D2D1_INK_BEZIER_SEGMENT &segment 617 ) 618 { 619 return SetSegmentAtEnd(&segment); 620 } 621 622 /// <summary> 623 /// Construct a geometric representation of the ink. 624 /// </summary> 625 COM_DECLSPEC_NOTHROW 626 HRESULT StreamAsGeometry(_In_opt_ ID2D1InkStyle * inkStyle,CONST D2D1_MATRIX_3X2_F & worldTransform,FLOAT flatteningTolerance,_In_ ID2D1SimplifiedGeometrySink * geometrySink)627 StreamAsGeometry( 628 _In_opt_ ID2D1InkStyle *inkStyle, 629 CONST D2D1_MATRIX_3X2_F &worldTransform, 630 FLOAT flatteningTolerance, 631 _In_ ID2D1SimplifiedGeometrySink *geometrySink 632 ) CONST 633 { 634 return StreamAsGeometry(inkStyle,&worldTransform, flatteningTolerance, geometrySink); 635 } 636 637 /// <summary> 638 /// Construct a geometric representation of the ink. 639 /// </summary> 640 COM_DECLSPEC_NOTHROW 641 HRESULT StreamAsGeometry(_In_opt_ ID2D1InkStyle * inkStyle,_In_opt_ CONST D2D1_MATRIX_3X2_F * worldTransform,_In_ ID2D1SimplifiedGeometrySink * geometrySink)642 StreamAsGeometry( 643 _In_opt_ ID2D1InkStyle *inkStyle, 644 _In_opt_ CONST D2D1_MATRIX_3X2_F *worldTransform, 645 _In_ ID2D1SimplifiedGeometrySink *geometrySink 646 ) CONST 647 { 648 return StreamAsGeometry(inkStyle,worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); 649 } 650 651 /// <summary> 652 /// Construct a geometric representation of the ink. 653 /// </summary> 654 COM_DECLSPEC_NOTHROW 655 HRESULT StreamAsGeometry(_In_opt_ ID2D1InkStyle * inkStyle,CONST D2D1_MATRIX_3X2_F & worldTransform,_In_ ID2D1SimplifiedGeometrySink * geometrySink)656 StreamAsGeometry( 657 _In_opt_ ID2D1InkStyle *inkStyle, 658 CONST D2D1_MATRIX_3X2_F &worldTransform, 659 _In_ ID2D1SimplifiedGeometrySink *geometrySink 660 ) CONST 661 { 662 return StreamAsGeometry(inkStyle,&worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE, geometrySink); 663 } 664 }; // interface ID2D1Ink 665 666 /// <summary> 667 /// Represents a device-dependent representation of a gradient mesh composed of 668 /// patches. Use the ID2D1DeviceContext2::CreateGradientMesh method to create an 669 /// instance of ID2D1GradientMesh. 670 /// </summary> 671 interface DX_DECLARE_INTERFACE("f292e401-c050-4cde-83d7-04962d3b23c2") ID2D1GradientMesh : public ID2D1Resource 672 { 673 674 /// <summary> 675 /// Returns the number of patches of the gradient mesh. 676 /// </summary> 677 STDMETHOD_(UINT32, GetPatchCount)( 678 ) CONST PURE; 679 680 /// <summary> 681 /// Retrieve the patch data stored in the gradient mesh. 682 /// </summary> 683 STDMETHOD(GetPatches)( 684 UINT32 startIndex, 685 _Out_writes_(patchesCount) D2D1_GRADIENT_MESH_PATCH *patches, 686 UINT32 patchesCount 687 ) CONST PURE; 688 }; // interface ID2D1GradientMesh 689 690 /// <summary> 691 /// Represents a producer of pixels that can fill an arbitrary 2D plane. 692 /// </summary> 693 interface DX_DECLARE_INTERFACE("c9b664e5-74a1-4378-9ac2-eefc37a3f4d8") ID2D1ImageSource : public ID2D1Image 694 { 695 696 STDMETHOD(OfferResources)( 697 ) PURE; 698 699 STDMETHOD(TryReclaimResources)( 700 _Out_ BOOL *resourcesDiscarded 701 ) PURE; 702 }; // interface ID2D1ImageSource 703 704 /// <summary> 705 /// Produces 2D pixel data that has been sourced from WIC. 706 /// </summary> 707 interface DX_DECLARE_INTERFACE("77395441-1c8f-4555-8683-f50dab0fe792") ID2D1ImageSourceFromWic : public ID2D1ImageSource 708 { 709 710 STDMETHOD(EnsureCached)( 711 _In_opt_ CONST D2D1_RECT_U *rectangleToFill 712 ) PURE; 713 714 STDMETHOD(TrimCache)( 715 _In_opt_ CONST D2D1_RECT_U *rectangleToPreserve 716 ) PURE; 717 718 STDMETHOD_(void, GetSource)( 719 _Outptr_result_maybenull_ IWICBitmapSource **wicBitmapSource 720 ) CONST PURE; 721 722 COM_DECLSPEC_NOTHROW 723 HRESULT EnsureCached(CONST D2D1_RECT_U & rectangleToFill)724 EnsureCached( 725 CONST D2D1_RECT_U &rectangleToFill 726 ) 727 { 728 return EnsureCached(&rectangleToFill); 729 } 730 731 COM_DECLSPEC_NOTHROW 732 HRESULT TrimCache(CONST D2D1_RECT_U & rectangleToPreserve)733 TrimCache( 734 CONST D2D1_RECT_U &rectangleToPreserve 735 ) 736 { 737 return TrimCache(&rectangleToPreserve); 738 } 739 }; // interface ID2D1ImageSourceFromWic 740 741 /// <summary> 742 /// Represents an image source which shares resources with an original image source. 743 /// </summary> 744 interface DX_DECLARE_INTERFACE("7f1f79e5-2796-416c-8f55-700f911445e5") ID2D1TransformedImageSource : public ID2D1Image 745 { 746 747 STDMETHOD_(void, GetSource)( 748 _Outptr_result_maybenull_ ID2D1ImageSource **imageSource 749 ) CONST PURE; 750 751 STDMETHOD_(void, GetProperties)( 752 _Out_ D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES *properties 753 ) CONST PURE; 754 }; // interface ID2D1TransformedImageSource 755 756 /// <summary> 757 /// A container for 3D lookup table data that can be passed to the LookupTable3D 758 /// effect. 759 /// </summary> 760 interface DX_DECLARE_INTERFACE("53dd9855-a3b0-4d5b-82e1-26e25c5e5797") ID2D1LookupTable3D : public ID2D1Resource 761 { 762 }; // interface ID2D1LookupTable3D 763 764 /// <summary> 765 /// This interface performs all the same functions as the ID2D1DeviceContext1 766 /// interface, plus it enables functionality such as ink rendering, gradient mesh 767 /// rendering, and improved image loading. 768 /// </summary> 769 interface DX_DECLARE_INTERFACE("394ea6a3-0c34-4321-950b-6ca20f0be6c7") ID2D1DeviceContext2 : public ID2D1DeviceContext1 770 { 771 772 STDMETHOD(CreateInk)( 773 _In_ CONST D2D1_INK_POINT *startPoint, 774 _COM_Outptr_ ID2D1Ink **ink 775 ) PURE; 776 777 /// <summary> 778 /// Creates a new ink style. 779 /// </summary> 780 STDMETHOD(CreateInkStyle)( 781 _In_opt_ CONST D2D1_INK_STYLE_PROPERTIES *inkStyleProperties, 782 _COM_Outptr_ ID2D1InkStyle **inkStyle 783 ) PURE; 784 785 STDMETHOD(CreateGradientMesh)( 786 _In_reads_(patchesCount) CONST D2D1_GRADIENT_MESH_PATCH *patches, 787 UINT32 patchesCount, 788 _COM_Outptr_ ID2D1GradientMesh **gradientMesh 789 ) PURE; 790 791 STDMETHOD(CreateImageSourceFromWic)( 792 _In_ IWICBitmapSource *wicBitmapSource, 793 D2D1_IMAGE_SOURCE_LOADING_OPTIONS loadingOptions, 794 D2D1_ALPHA_MODE alphaMode, 795 _COM_Outptr_ ID2D1ImageSourceFromWic **imageSource 796 ) PURE; 797 798 /// <summary> 799 /// Creates a 3D lookup table for mapping a 3-channel input to a 3-channel output. 800 /// The table data must be provided in 4-channel format. 801 /// </summary> 802 STDMETHOD(CreateLookupTable3D)( 803 D2D1_BUFFER_PRECISION precision, 804 _In_reads_(3) CONST UINT32 *extents, 805 _In_reads_(dataCount) CONST BYTE *data, 806 UINT32 dataCount, 807 _In_reads_(2) CONST UINT32 *strides, 808 _COM_Outptr_ ID2D1LookupTable3D **lookupTable 809 ) PURE; 810 811 STDMETHOD(CreateImageSourceFromDxgi)( 812 _In_reads_(surfaceCount) IDXGISurface **surfaces, 813 UINT32 surfaceCount, 814 DXGI_COLOR_SPACE_TYPE colorSpace, 815 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS options, 816 _COM_Outptr_ ID2D1ImageSource **imageSource 817 ) PURE; 818 819 /// <summary> 820 /// Retrieves the world-space bounds in DIPs of the gradient mesh using the device 821 /// context DPI. 822 /// </summary> 823 STDMETHOD(GetGradientMeshWorldBounds)( 824 _In_ ID2D1GradientMesh *gradientMesh, 825 _Out_ D2D1_RECT_F *pBounds 826 ) CONST PURE; 827 828 STDMETHOD_(void, DrawInk)( 829 _In_ ID2D1Ink *ink, 830 _In_ ID2D1Brush *brush, 831 _In_opt_ ID2D1InkStyle *inkStyle 832 ) PURE; 833 834 STDMETHOD_(void, DrawGradientMesh)( 835 _In_ ID2D1GradientMesh *gradientMesh 836 ) PURE; 837 838 /// <summary> 839 /// Draw a metafile to the device context. 840 /// </summary> 841 STDMETHOD_(void, DrawGdiMetafile)( 842 _In_ ID2D1GdiMetafile *gdiMetafile, 843 _In_opt_ CONST D2D1_RECT_F *destinationRectangle, 844 _In_opt_ CONST D2D1_RECT_F *sourceRectangle = NULL 845 ) PURE; 846 847 using ID2D1DeviceContext::DrawGdiMetafile; 848 849 /// <summary> 850 /// Creates an image source which shares resources with an original. 851 /// </summary> 852 STDMETHOD(CreateTransformedImageSource)( 853 _In_ ID2D1ImageSource *imageSource, 854 _In_ CONST D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES *properties, 855 _COM_Outptr_ ID2D1TransformedImageSource **transformedImageSource 856 ) PURE; 857 858 COM_DECLSPEC_NOTHROW 859 HRESULT CreateInk(CONST D2D1_INK_POINT & startPoint,_COM_Outptr_ ID2D1Ink ** ink)860 CreateInk( 861 CONST D2D1_INK_POINT &startPoint, 862 _COM_Outptr_ ID2D1Ink **ink 863 ) 864 { 865 return CreateInk(&startPoint, ink); 866 } 867 868 /// <summary> 869 /// Creates a new ink style. 870 /// </summary> 871 COM_DECLSPEC_NOTHROW 872 HRESULT CreateInkStyle(CONST D2D1_INK_STYLE_PROPERTIES & inkStyleProperties,_COM_Outptr_ ID2D1InkStyle ** inkStyle)873 CreateInkStyle( 874 CONST D2D1_INK_STYLE_PROPERTIES &inkStyleProperties, 875 _COM_Outptr_ ID2D1InkStyle **inkStyle 876 ) 877 { 878 return CreateInkStyle(&inkStyleProperties, inkStyle); 879 } 880 881 COM_DECLSPEC_NOTHROW 882 HRESULT CreateImageSourceFromWic(_In_ IWICBitmapSource * wicBitmapSource,D2D1_IMAGE_SOURCE_LOADING_OPTIONS loadingOptions,_COM_Outptr_ ID2D1ImageSourceFromWic ** imageSource)883 CreateImageSourceFromWic( 884 _In_ IWICBitmapSource *wicBitmapSource, 885 D2D1_IMAGE_SOURCE_LOADING_OPTIONS loadingOptions, 886 _COM_Outptr_ ID2D1ImageSourceFromWic **imageSource 887 ) 888 { 889 return CreateImageSourceFromWic(wicBitmapSource, loadingOptions, D2D1_ALPHA_MODE_UNKNOWN, imageSource); 890 } 891 892 COM_DECLSPEC_NOTHROW 893 HRESULT CreateImageSourceFromWic(_In_ IWICBitmapSource * wicBitmapSource,_COM_Outptr_ ID2D1ImageSourceFromWic ** imageSource)894 CreateImageSourceFromWic( 895 _In_ IWICBitmapSource *wicBitmapSource, 896 _COM_Outptr_ ID2D1ImageSourceFromWic **imageSource 897 ) 898 { 899 return CreateImageSourceFromWic(wicBitmapSource, D2D1_IMAGE_SOURCE_LOADING_OPTIONS_NONE, D2D1_ALPHA_MODE_UNKNOWN, imageSource); 900 } 901 902 /// <summary> 903 /// Draw a metafile to the device context. 904 /// </summary> 905 COM_DECLSPEC_NOTHROW 906 void DrawGdiMetafile(_In_ ID2D1GdiMetafile * gdiMetafile,CONST D2D1_RECT_F & destinationRectangle,CONST D2D1_RECT_F & sourceRectangle)907 DrawGdiMetafile( 908 _In_ ID2D1GdiMetafile *gdiMetafile, 909 CONST D2D1_RECT_F &destinationRectangle, 910 CONST D2D1_RECT_F &sourceRectangle 911 ) 912 { 913 return DrawGdiMetafile(gdiMetafile, &destinationRectangle, &sourceRectangle); 914 } 915 916 /// <summary> 917 /// Draw a metafile to the device context. 918 /// </summary> 919 COM_DECLSPEC_NOTHROW 920 void 921 DrawGdiMetafile( 922 _In_ ID2D1GdiMetafile *gdiMetafile, 923 CONST D2D1_RECT_F &destinationRectangle, 924 _In_ CONST D2D1_RECT_F *sourceRectangle = NULL 925 ) 926 { 927 return DrawGdiMetafile(gdiMetafile, &destinationRectangle, sourceRectangle); 928 } 929 }; // interface ID2D1DeviceContext2 930 931 /// <summary> 932 /// Represents a resource domain whose objects and device contexts can be used 933 /// together. This interface performs all the same functions as the existing 934 /// ID2D1Device1 interface. It also enables the creation of ID2D1DeviceContext2 935 /// objects. 936 /// </summary> 937 interface DX_DECLARE_INTERFACE("a44472e1-8dfb-4e60-8492-6e2861c9ca8b") ID2D1Device2 : public ID2D1Device1 938 { 939 940 /// <summary> 941 /// Creates a new device context with no initially assigned target. 942 /// </summary> 943 STDMETHOD(CreateDeviceContext)( 944 D2D1_DEVICE_CONTEXT_OPTIONS options, 945 _COM_Outptr_ ID2D1DeviceContext2 **deviceContext2 946 ) PURE; 947 948 using ID2D1Device1::CreateDeviceContext; 949 950 using ID2D1Device::CreateDeviceContext; 951 952 /// <summary> 953 /// Flush all device contexts that reference a given bitmap. 954 /// </summary> 955 STDMETHOD_(void, FlushDeviceContexts)( 956 _In_ ID2D1Bitmap *bitmap 957 ) PURE; 958 959 /// <summary> 960 /// Returns the DXGI device associated with this D2D device. 961 /// </summary> 962 STDMETHOD(GetDxgiDevice)( 963 _COM_Outptr_ IDXGIDevice **dxgiDevice 964 ) PURE; 965 }; // interface ID2D1Device2 966 967 /// <summary> 968 /// Creates Direct2D resources. This interface also enables the creation of 969 /// ID2D1Device2 objects. 970 /// </summary> 971 interface DX_DECLARE_INTERFACE("0869759f-4f00-413f-b03e-2bda45404d0f") ID2D1Factory3 : public ID2D1Factory2 972 { 973 974 /// <summary> 975 /// This creates a new Direct2D device from the given IDXGIDevice. 976 /// </summary> 977 STDMETHOD(CreateDevice)( 978 _In_ IDXGIDevice *dxgiDevice, 979 _COM_Outptr_ ID2D1Device2 **d2dDevice2 980 ) PURE; 981 982 using ID2D1Factory2::CreateDevice; 983 984 using ID2D1Factory1::CreateDevice; 985 }; // interface ID2D1Factory3 986 987 /// <summary> 988 /// This interface performs all the same functions as the existing ID2D1CommandSink1 989 /// interface. It also enables access to ink rendering and gradient mesh rendering. 990 /// </summary> 991 interface DX_DECLARE_INTERFACE("3bab440e-417e-47df-a2e2-bc0be6a00916") ID2D1CommandSink2 : public ID2D1CommandSink1 992 { 993 994 STDMETHOD(DrawInk)( 995 _In_ ID2D1Ink *ink, 996 _In_ ID2D1Brush *brush, 997 _In_opt_ ID2D1InkStyle *inkStyle 998 ) PURE; 999 1000 STDMETHOD(DrawGradientMesh)( 1001 _In_ ID2D1GradientMesh *gradientMesh 1002 ) PURE; 1003 1004 STDMETHOD(DrawGdiMetafile)( 1005 _In_ ID2D1GdiMetafile *gdiMetafile, 1006 _In_opt_ CONST D2D1_RECT_F *destinationRectangle, 1007 _In_opt_ CONST D2D1_RECT_F *sourceRectangle 1008 ) PURE; 1009 1010 using ID2D1CommandSink::DrawGdiMetafile; 1011 }; // interface ID2D1CommandSink2 1012 1013 /// <summary> 1014 /// Interface encapsulating a GDI/GDI+ metafile. 1015 /// </summary> 1016 interface DX_DECLARE_INTERFACE("2e69f9e8-dd3f-4bf9-95ba-c04f49d788df") ID2D1GdiMetafile1 : public ID2D1GdiMetafile 1017 { 1018 1019 /// <summary> 1020 /// Returns the DPI reported by the metafile. 1021 /// </summary> 1022 STDMETHOD(GetDpi)( 1023 _Out_ FLOAT *dpiX, 1024 _Out_ FLOAT *dpiY 1025 ) PURE; 1026 1027 /// <summary> 1028 /// Gets the bounds (in DIPs) of the metafile (as specified by the frame rect 1029 /// declared in the metafile). 1030 /// </summary> 1031 STDMETHOD(GetSourceBounds)( 1032 _Out_ D2D1_RECT_F *bounds 1033 ) PURE; 1034 }; // interface ID2D1GdiMetafile1 1035 1036 /// <summary> 1037 /// User-implementable interface for introspecting on a metafile. 1038 /// </summary> 1039 interface DX_DECLARE_INTERFACE("fd0ecb6b-91e6-411e-8655-395e760f91b4") ID2D1GdiMetafileSink1 : public ID2D1GdiMetafileSink 1040 { 1041 1042 /// <summary> 1043 /// Callback for examining a metafile record. 1044 /// </summary> 1045 STDMETHOD(ProcessRecord)( 1046 DWORD recordType, 1047 _In_opt_ CONST void *recordData, 1048 DWORD recordDataSize, 1049 UINT32 flags 1050 ) PURE; 1051 1052 using ID2D1GdiMetafileSink::ProcessRecord; 1053 }; // interface ID2D1GdiMetafileSink1 1054 1055 #if NTDDI_VERSION >= NTDDI_WIN10_TH2 1056 1057 interface DX_DECLARE_INTERFACE("4dc583bf-3a10-438a-8722-e9765224f1f1") ID2D1SpriteBatch : public ID2D1Resource 1058 { 1059 1060 /// <summary> 1061 /// Adds sprites to the end of the sprite batch. 1062 /// </summary> 1063 STDMETHOD(AddSprites)( 1064 UINT32 spriteCount, 1065 _In_reads_bytes_(sizeof(D2D1_RECT_F) + (spriteCount - 1) * destinationRectanglesStride) CONST D2D1_RECT_F *destinationRectangles, 1066 _In_reads_bytes_opt_(sizeof(D2D1_RECT_U) + (spriteCount - 1) * sourceRectanglesStride) CONST D2D1_RECT_U *sourceRectangles = NULL, 1067 _In_reads_bytes_opt_(sizeof(D2D1_COLOR_F) + (spriteCount - 1) * colorsStride) CONST D2D1_COLOR_F *colors = NULL, 1068 _In_reads_bytes_opt_(sizeof(D2D1_MATRIX_3X2_F) + (spriteCount - 1) * transformsStride) CONST D2D1_MATRIX_3X2_F *transforms = NULL, 1069 UINT32 destinationRectanglesStride = sizeof(D2D1_RECT_F), 1070 UINT32 sourceRectanglesStride = sizeof(D2D1_RECT_U), 1071 UINT32 colorsStride = sizeof(D2D1_COLOR_F), 1072 UINT32 transformsStride = sizeof(D2D1_MATRIX_3X2_F) 1073 ) PURE; 1074 1075 /// <summary> 1076 /// Set properties for existing sprites. All properties not specified are 1077 /// unmodified. 1078 /// </summary> 1079 STDMETHOD(SetSprites)( 1080 UINT32 startIndex, 1081 UINT32 spriteCount, 1082 _In_reads_bytes_opt_(sizeof(D2D1_RECT_F) + (spriteCount - 1) * destinationRectanglesStride) CONST D2D1_RECT_F *destinationRectangles = NULL, 1083 _In_reads_bytes_opt_(sizeof(D2D1_RECT_U) + (spriteCount - 1) * sourceRectanglesStride) CONST D2D1_RECT_U *sourceRectangles = NULL, 1084 _In_reads_bytes_opt_(sizeof(D2D1_COLOR_F) + (spriteCount - 1) * colorsStride) CONST D2D1_COLOR_F *colors = NULL, 1085 _In_reads_bytes_opt_(sizeof(D2D1_MATRIX_3X2_F) + (spriteCount - 1) * transformsStride) CONST D2D1_MATRIX_3X2_F *transforms = NULL, 1086 UINT32 destinationRectanglesStride = sizeof(D2D1_RECT_F), 1087 UINT32 sourceRectanglesStride = sizeof(D2D1_RECT_U), 1088 UINT32 colorsStride = sizeof(D2D1_COLOR_F), 1089 UINT32 transformsStride = sizeof(D2D1_MATRIX_3X2_F) 1090 ) PURE; 1091 1092 /// <summary> 1093 /// Retrieves sprite properties. 1094 /// </summary> 1095 STDMETHOD(GetSprites)( 1096 UINT32 startIndex, 1097 UINT32 spriteCount, 1098 _Out_writes_opt_(spriteCount) D2D1_RECT_F *destinationRectangles = NULL, 1099 _Out_writes_opt_(spriteCount) D2D1_RECT_U *sourceRectangles = NULL, 1100 _Out_writes_opt_(spriteCount) D2D1_COLOR_F *colors = NULL, 1101 _Out_writes_opt_(spriteCount) D2D1_MATRIX_3X2_F *transforms = NULL 1102 ) CONST PURE; 1103 1104 /// <summary> 1105 /// Retrieves the number of sprites in the sprite batch. 1106 /// </summary> 1107 STDMETHOD_(UINT32, GetSpriteCount)( 1108 ) CONST PURE; 1109 1110 /// <summary> 1111 /// Removes all sprites from the sprite batch. 1112 /// </summary> 1113 STDMETHOD_(void, Clear)( 1114 ) PURE; 1115 }; // interface ID2D1SpriteBatch 1116 1117 interface DX_DECLARE_INTERFACE("235a7496-8351-414c-bcd4-6672ab2d8e00") ID2D1DeviceContext3 : public ID2D1DeviceContext2 1118 { 1119 1120 /// <summary> 1121 /// Creates a new sprite batch. 1122 /// </summary> 1123 STDMETHOD(CreateSpriteBatch)( 1124 _COM_Outptr_ ID2D1SpriteBatch **spriteBatch 1125 ) PURE; 1126 1127 /// <summary> 1128 /// Draws sprites in a sprite batch. 1129 /// </summary> 1130 STDMETHOD_(void, DrawSpriteBatch)( 1131 _In_ ID2D1SpriteBatch *spriteBatch, 1132 UINT32 startIndex, 1133 UINT32 spriteCount, 1134 _In_ ID2D1Bitmap *bitmap, 1135 D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR, 1136 D2D1_SPRITE_OPTIONS spriteOptions = D2D1_SPRITE_OPTIONS_NONE 1137 ) PURE; 1138 1139 /// <summary> 1140 /// Draws all sprites in a sprite batch. 1141 /// </summary> 1142 COM_DECLSPEC_NOTHROW 1143 void 1144 DrawSpriteBatch( 1145 _In_ ID2D1SpriteBatch *spriteBatch, 1146 _In_ ID2D1Bitmap *bitmap, 1147 D2D1_BITMAP_INTERPOLATION_MODE interpolationMode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR, 1148 D2D1_SPRITE_OPTIONS spriteOptions = D2D1_SPRITE_OPTIONS_NONE 1149 ) 1150 { 1151 return DrawSpriteBatch(spriteBatch, 0, spriteBatch->GetSpriteCount(), bitmap, interpolationMode, spriteOptions); 1152 } 1153 }; // interface ID2D1DeviceContext3 1154 1155 interface DX_DECLARE_INTERFACE("852f2087-802c-4037-ab60-ff2e7ee6fc01") ID2D1Device3 : public ID2D1Device2 1156 { 1157 1158 /// <summary> 1159 /// Creates a new device context with no initially assigned target. 1160 /// </summary> 1161 STDMETHOD(CreateDeviceContext)( 1162 D2D1_DEVICE_CONTEXT_OPTIONS options, 1163 _COM_Outptr_ ID2D1DeviceContext3 **deviceContext3 1164 ) PURE; 1165 1166 using ID2D1Device2::CreateDeviceContext; 1167 1168 using ID2D1Device1::CreateDeviceContext; 1169 1170 using ID2D1Device::CreateDeviceContext; 1171 }; // interface ID2D1Device3 1172 1173 /// <summary> 1174 /// Creates Direct2D resources. This interface also enables the creation of 1175 /// ID2D1Device3 objects. 1176 /// </summary> 1177 interface DX_DECLARE_INTERFACE("bd4ec2d2-0662-4bee-ba8e-6f29f032e096") ID2D1Factory4 : public ID2D1Factory3 1178 { 1179 1180 /// <summary> 1181 /// This creates a new Direct2D device from the given IDXGIDevice. 1182 /// </summary> 1183 STDMETHOD(CreateDevice)( 1184 _In_ IDXGIDevice *dxgiDevice, 1185 _COM_Outptr_ ID2D1Device3 **d2dDevice3 1186 ) PURE; 1187 1188 using ID2D1Factory3::CreateDevice; 1189 1190 using ID2D1Factory2::CreateDevice; 1191 1192 using ID2D1Factory1::CreateDevice; 1193 }; // interface ID2D1Factory4 1194 1195 interface DX_DECLARE_INTERFACE("18079135-4cf3-4868-bc8e-06067e6d242d") ID2D1CommandSink3 : public ID2D1CommandSink2 1196 { 1197 1198 STDMETHOD(DrawSpriteBatch)( 1199 _In_ ID2D1SpriteBatch *spriteBatch, 1200 UINT32 startIndex, 1201 UINT32 spriteCount, 1202 _In_ ID2D1Bitmap *bitmap, 1203 D2D1_BITMAP_INTERPOLATION_MODE interpolationMode, 1204 D2D1_SPRITE_OPTIONS spriteOptions 1205 ) PURE; 1206 }; // interface ID2D1CommandSink3 1207 1208 #endif // #if NTDDI_VERSION >= NTDDI_WIN10_TH2 1209 #if NTDDI_VERSION >= NTDDI_WIN10_RS1 1210 1211 /// <summary> 1212 /// This object supplies the values for context-fill, context-stroke, and 1213 /// context-value that are used when rendering SVG glyphs. 1214 /// </summary> 1215 interface DX_DECLARE_INTERFACE("af671749-d241-4db8-8e41-dcc2e5c1a438") ID2D1SvgGlyphStyle : public ID2D1Resource 1216 { 1217 1218 /// <summary> 1219 /// Provides values to an SVG glyph for fill. The brush with opacity set to 1 is 1220 /// used as the 'context-fill'. The opacity of the brush is used as the 1221 /// 'context-fill-opacity' value. 1222 /// </summary> 1223 /// <param name="brush">A null brush will cause the context-fill value to come from 1224 /// the defaultFillBrush. If the defaultFillBrush is also null, the context-fill 1225 /// value will be 'none'.</param> 1226 STDMETHOD(SetFill)( 1227 _In_opt_ ID2D1Brush *brush 1228 ) PURE; 1229 1230 /// <summary> 1231 /// Returns the requested fill parameters. 1232 /// </summary> 1233 STDMETHOD_(void, GetFill)( 1234 _Outptr_result_maybenull_ ID2D1Brush **brush 1235 ) PURE; 1236 1237 /// <summary> 1238 /// Provides values to an SVG glyph for stroke properties. The brush with opacity 1239 /// set to 1 is used as the 'context-stroke'. The opacity of the brush is used as 1240 /// the 'context-stroke-opacity' value. 1241 /// </summary> 1242 /// <param name="brush">A null brush will cause the context-stroke value to be 1243 /// 'none'.</param> 1244 /// <param name="strokeWidth">Specifies the 'context-value' for the 'stroke-width' 1245 /// property.</param> 1246 /// <param name="dashes">Specifies the 'context-value' for the 'stroke-dasharray' 1247 /// property. A null value will cause the stroke-dasharray to be set to 'none'. 1248 /// </param> 1249 /// <param name="dashOffset">Specifies the 'context-value' for the 1250 /// 'stroke-dashoffset' property.</param> 1251 STDMETHOD(SetStroke)( 1252 _In_opt_ ID2D1Brush *brush, 1253 FLOAT strokeWidth = 1.0f, 1254 _In_reads_opt_(dashesCount) CONST FLOAT *dashes = NULL, 1255 UINT32 dashesCount = 0, 1256 FLOAT dashOffset = 1.0f 1257 ) PURE; 1258 1259 /// <summary> 1260 /// Returns the number of dashes in the dash array. 1261 /// </summary> 1262 STDMETHOD_(UINT32, GetStrokeDashesCount)( 1263 ) PURE; 1264 1265 /// <summary> 1266 /// Returns the requested stroke parameters. 1267 /// </summary> 1268 STDMETHOD_(void, GetStroke)( 1269 _Outptr_opt_result_maybenull_ ID2D1Brush **brush, 1270 _Out_opt_ FLOAT *strokeWidth = NULL, 1271 _Out_writes_opt_(dashesCount) FLOAT *dashes = NULL, 1272 UINT32 dashesCount = 0, 1273 _Out_opt_ FLOAT *dashOffset = NULL 1274 ) PURE; 1275 }; // interface ID2D1SvgGlyphStyle 1276 1277 interface DX_DECLARE_INTERFACE("8c427831-3d90-4476-b647-c4fae349e4db") ID2D1DeviceContext4 : public ID2D1DeviceContext3 1278 { 1279 1280 /// <summary> 1281 /// Creates an SVG glyph style object. 1282 /// </summary> 1283 STDMETHOD(CreateSvgGlyphStyle)( 1284 _COM_Outptr_ ID2D1SvgGlyphStyle **svgGlyphStyle 1285 ) PURE; 1286 1287 /// <summary> 1288 /// Draws the text within the given layout rectangle. By default, this method 1289 /// performs baseline snapping and renders color versions of glyphs in color fonts. 1290 /// </summary> 1291 /// <param name="svgGlyphStyle">Object used to style SVG glyphs.</param> 1292 /// <param name="colorPaletteIndex">The index used to select a color palette within 1293 /// a color font.</param> 1294 STDMETHOD_(void, DrawText)( 1295 _In_reads_(stringLength) CONST WCHAR *string, 1296 UINT32 stringLength, 1297 _In_ IDWriteTextFormat *textFormat, 1298 _In_ CONST D2D1_RECT_F *layoutRect, 1299 _In_opt_ ID2D1Brush *defaultFillBrush, 1300 _In_opt_ ID2D1SvgGlyphStyle *svgGlyphStyle, 1301 UINT32 colorPaletteIndex = 0, 1302 D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT, 1303 DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL 1304 ) PURE; 1305 1306 using ID2D1RenderTarget::DrawText; 1307 1308 /// <summary> 1309 /// Draw a text layout object. If the layout is not subsequently changed, this can 1310 /// be more efficient than DrawText when drawing the same layout repeatedly. 1311 /// </summary> 1312 /// <param name="svgGlyphStyle">Object used to style SVG glyphs.</param> 1313 /// <param name="colorPaletteIndex">The index used to select a color palette within 1314 /// a color font.</param> 1315 /// <param name="options">The specified text options. If D2D1_DRAW_TEXT_OPTIONS_CLIP 1316 /// is used, the text is clipped to the layout bounds. These bounds are derived from 1317 /// the origin and the layout bounds of the corresponding IDWriteTextLayout object. 1318 /// </param> 1319 STDMETHOD_(void, DrawTextLayout)( 1320 D2D1_POINT_2F origin, 1321 _In_ IDWriteTextLayout *textLayout, 1322 _In_opt_ ID2D1Brush *defaultFillBrush, 1323 _In_opt_ ID2D1SvgGlyphStyle *svgGlyphStyle, 1324 UINT32 colorPaletteIndex = 0, 1325 D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT 1326 ) PURE; 1327 1328 using ID2D1RenderTarget::DrawTextLayout; 1329 1330 /// <summary> 1331 /// Draws a color glyph run using one (and only one) of the bitmap formats- 1332 /// DWRITE_GLYPH_IMAGE_FORMATS_PNG, DWRITE_GLYPH_IMAGE_FORMATS_JPEG, 1333 /// DWRITE_GLYPH_IMAGE_FORMATS_TIFF, or 1334 /// DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8. 1335 /// </summary> 1336 STDMETHOD_(void, DrawColorBitmapGlyphRun)( 1337 DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat, 1338 D2D1_POINT_2F baselineOrigin, 1339 _In_ CONST DWRITE_GLYPH_RUN *glyphRun, 1340 DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL, 1341 D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION bitmapSnapOption = D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DEFAULT 1342 ) PURE; 1343 1344 /// <summary> 1345 /// Draws a color glyph run that has the format of DWRITE_GLYPH_IMAGE_FORMATS_SVG. 1346 /// </summary> 1347 /// <param name="svgGlyphStyle">Object used to style SVG glyphs.</param> 1348 /// <param name="colorPaletteIndex">The index used to select a color palette within 1349 /// a color font. Note that this not the same as the paletteIndex in the 1350 /// DWRITE_COLOR_GLYPH_RUN struct, which is not relevant for SVG glyphs.</param> 1351 STDMETHOD_(void, DrawSvgGlyphRun)( 1352 D2D1_POINT_2F baselineOrigin, 1353 _In_ CONST DWRITE_GLYPH_RUN *glyphRun, 1354 _In_opt_ ID2D1Brush *defaultFillBrush = NULL, 1355 _In_opt_ ID2D1SvgGlyphStyle *svgGlyphStyle = NULL, 1356 UINT32 colorPaletteIndex = 0, 1357 DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL 1358 ) PURE; 1359 1360 /// <summary> 1361 /// Retrieves an image of the color bitmap glyph from the color glyph cache. If the 1362 /// cache does not already contain the requested resource, it will be created. This 1363 /// method may be used to extend the lifetime of a glyph image even after it is 1364 /// evicted from the color glyph cache. 1365 /// </summary> 1366 /// <param name="fontEmSize">The specified font size affects the choice of which 1367 /// bitmap to use from the font. It also affects the output glyphTransform, causing 1368 /// it to properly scale the glyph.</param> 1369 /// <param name="glyphTransform">Output transform, which transforms from the glyph's 1370 /// space to the same output space as the worldTransform. This includes the input 1371 /// glyphOrigin, the glyph's offset from the glyphOrigin, and any other required 1372 /// transformations.</param> 1373 STDMETHOD(GetColorBitmapGlyphImage)( 1374 DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat, 1375 D2D1_POINT_2F glyphOrigin, 1376 _In_ IDWriteFontFace *fontFace, 1377 FLOAT fontEmSize, 1378 UINT16 glyphIndex, 1379 BOOL isSideways, 1380 _In_opt_ CONST D2D1_MATRIX_3X2_F *worldTransform, 1381 FLOAT dpiX, 1382 FLOAT dpiY, 1383 _Out_ D2D1_MATRIX_3X2_F *glyphTransform, 1384 _COM_Outptr_ ID2D1Image **glyphImage 1385 ) PURE; 1386 1387 /// <summary> 1388 /// Retrieves an image of the SVG glyph from the color glyph cache. If the cache 1389 /// does not already contain the requested resource, it will be created. This method 1390 /// may be used to extend the lifetime of a glyph image even after it is evicted 1391 /// from the color glyph cache. 1392 /// </summary> 1393 /// <param name="fontEmSize">The specified font size affects the output 1394 /// glyphTransform, causing it to properly scale the glyph.</param> 1395 /// <param name="svgGlyphStyle">Object used to style SVG glyphs.</param> 1396 /// <param name="colorPaletteIndex">The index used to select a color palette within 1397 /// a color font. Note that this not the same as the paletteIndex in the 1398 /// DWRITE_COLOR_GLYPH_RUN struct, which is not relevant for SVG glyphs.</param> 1399 /// <param name="glyphTransform">Output transform, which transforms from the glyph's 1400 /// space to the same output space as the worldTransform. This includes the input 1401 /// glyphOrigin, the glyph's offset from the glyphOrigin, and any other required 1402 /// transformations.</param> 1403 STDMETHOD(GetSvgGlyphImage)( 1404 D2D1_POINT_2F glyphOrigin, 1405 _In_ IDWriteFontFace *fontFace, 1406 FLOAT fontEmSize, 1407 UINT16 glyphIndex, 1408 BOOL isSideways, 1409 _In_opt_ CONST D2D1_MATRIX_3X2_F *worldTransform, 1410 _In_opt_ ID2D1Brush *defaultFillBrush, 1411 _In_opt_ ID2D1SvgGlyphStyle *svgGlyphStyle, 1412 UINT32 colorPaletteIndex, 1413 _Out_ D2D1_MATRIX_3X2_F *glyphTransform, 1414 _COM_Outptr_ ID2D1CommandList **glyphImage 1415 ) PURE; 1416 1417 /// <summary> 1418 /// Draws the text within the given layout rectangle. By default, this method 1419 /// performs baseline snapping and renders color versions of glyphs in color fonts. 1420 /// </summary> 1421 /// <param name="svgGlyphStyle">Object used to style SVG glyphs.</param> 1422 /// <param name="colorPaletteIndex">The index used to select a color palette within 1423 /// a color font.</param> 1424 COM_DECLSPEC_NOTHROW 1425 void 1426 DrawText( _In_reads_(stringLength)1427 _In_reads_(stringLength) CONST WCHAR *string, 1428 UINT32 stringLength, 1429 _In_ IDWriteTextFormat *textFormat, 1430 CONST D2D1_RECT_F &layoutRect, 1431 _In_opt_ ID2D1Brush *defaultFillBrush, 1432 _In_opt_ ID2D1SvgGlyphStyle *svgGlyphStyle, 1433 UINT32 colorPaletteIndex = 0, 1434 D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT, 1435 DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL 1436 ) 1437 { 1438 return DrawText(string, stringLength, textFormat, &layoutRect, defaultFillBrush, svgGlyphStyle, colorPaletteIndex, options, measuringMode); 1439 } 1440 }; // interface ID2D1DeviceContext4 1441 1442 interface DX_DECLARE_INTERFACE("d7bdb159-5683-4a46-bc9c-72dc720b858b") ID2D1Device4 : public ID2D1Device3 1443 { 1444 1445 /// <summary> 1446 /// Creates a new device context with no initially assigned target. 1447 /// </summary> 1448 STDMETHOD(CreateDeviceContext)( 1449 D2D1_DEVICE_CONTEXT_OPTIONS options, 1450 _COM_Outptr_ ID2D1DeviceContext4 **deviceContext4 1451 ) PURE; 1452 1453 using ID2D1Device3::CreateDeviceContext; 1454 1455 using ID2D1Device2::CreateDeviceContext; 1456 1457 using ID2D1Device1::CreateDeviceContext; 1458 1459 using ID2D1Device::CreateDeviceContext; 1460 1461 /// <summary> 1462 /// Sets the maximum capacity of the color glyph cache. This cache is used to store 1463 /// color bitmap glyphs and SVG glyphs, enabling faster performance if the same 1464 /// glyphs are needed again. If the application still references a glyph using 1465 /// GetColorBitmapGlyphImage or GetSvgGlyphImage after it has been evicted, this 1466 /// glyph does not count toward the cache capacity. 1467 /// </summary> 1468 STDMETHOD_(void, SetMaximumColorGlyphCacheMemory)( 1469 UINT64 maximumInBytes 1470 ) PURE; 1471 1472 /// <summary> 1473 /// Gets the maximum capacity of the color glyph cache. 1474 /// </summary> 1475 STDMETHOD_(UINT64, GetMaximumColorGlyphCacheMemory)( 1476 ) CONST PURE; 1477 }; // interface ID2D1Device4 1478 1479 /// <summary> 1480 /// Creates Direct2D resources. This interface also enables the creation of 1481 /// ID2D1Device4 objects. 1482 /// </summary> 1483 interface DX_DECLARE_INTERFACE("c4349994-838e-4b0f-8cab-44997d9eeacc") ID2D1Factory5 : public ID2D1Factory4 1484 { 1485 1486 /// <summary> 1487 /// This creates a new Direct2D device from the given IDXGIDevice. 1488 /// </summary> 1489 STDMETHOD(CreateDevice)( 1490 _In_ IDXGIDevice *dxgiDevice, 1491 _COM_Outptr_ ID2D1Device4 **d2dDevice4 1492 ) PURE; 1493 1494 using ID2D1Factory4::CreateDevice; 1495 1496 using ID2D1Factory3::CreateDevice; 1497 1498 using ID2D1Factory2::CreateDevice; 1499 1500 using ID2D1Factory1::CreateDevice; 1501 }; // interface ID2D1Factory5 1502 1503 #endif // #if NTDDI_VERSION >= NTDDI_WIN10_RS1 1504 #if NTDDI_VERSION >= NTDDI_WIN10_RS2 1505 1506 interface DX_DECLARE_INTERFACE("c78a6519-40d6-4218-b2de-beeeb744bb3e") ID2D1CommandSink4 : public ID2D1CommandSink3 1507 { 1508 1509 /// <summary> 1510 /// A new function to set blend mode that respects the new MAX blend. 1511 /// 1512 /// Implementers of SetPrimitiveBlend2 should expect and handle blend mode: 1513 /// D2D1_PRIMITIVE_BLEND_MAX 1514 /// 1515 /// Implementers of SetPrimitiveBlend1 should expect and handle blend modes: 1516 /// D2D1_PRIMITIVE_BLEND_MIN and D2D1_PRIMITIVE_BLEND_ADD 1517 /// 1518 /// Implementers of SetPrimitiveBlend should expect and handle blend modes: 1519 /// D2D1_PRIMITIVE_BLEND_SOURCE_OVER and D2D1_PRIMITIVE_BLEND_COPY 1520 /// </summary> 1521 STDMETHOD(SetPrimitiveBlend2)( 1522 D2D1_PRIMITIVE_BLEND primitiveBlend 1523 ) PURE; 1524 }; // interface ID2D1CommandSink4 1525 1526 /// <summary> 1527 /// Represents a color context to be used with the Color Management Effect. 1528 /// </summary> 1529 interface DX_DECLARE_INTERFACE("1ab42875-c57f-4be9-bd85-9cd78d6f55ee") ID2D1ColorContext1 : public ID2D1ColorContext 1530 { 1531 1532 /// <summary> 1533 /// Retrieves the color context type. 1534 /// </summary> 1535 STDMETHOD_(D2D1_COLOR_CONTEXT_TYPE, GetColorContextType)( 1536 ) CONST PURE; 1537 1538 /// <summary> 1539 /// Retrieves the DXGI color space of this context. Returns DXGI_COLOR_SPACE_CUSTOM 1540 /// when color context type is ICC. 1541 /// </summary> 1542 STDMETHOD_(DXGI_COLOR_SPACE_TYPE, GetDXGIColorSpace)( 1543 ) CONST PURE; 1544 1545 /// <summary> 1546 /// Retrieves a set simple color profile. 1547 /// </summary> 1548 STDMETHOD(GetSimpleColorProfile)( 1549 _Out_ D2D1_SIMPLE_COLOR_PROFILE *simpleProfile 1550 ) CONST PURE; 1551 }; // interface ID2D1ColorContext1 1552 1553 interface DX_DECLARE_INTERFACE("7836d248-68cc-4df6-b9e8-de991bf62eb7") ID2D1DeviceContext5 : public ID2D1DeviceContext4 1554 { 1555 1556 /// <summary> 1557 /// Creates an SVG document from a stream. 1558 /// </summary> 1559 /// <param name="inputXmlStream">An input stream containing the SVG XML document. If 1560 /// null, an empty document is created.</param> 1561 /// <param name="viewportSize">Size of the initial viewport of the document.</param> 1562 /// <param name="svgDocument">When this method returns, contains a pointer to the 1563 /// SVG document.</param> 1564 STDMETHOD(CreateSvgDocument)( 1565 _In_opt_ IStream *inputXmlStream, 1566 D2D1_SIZE_F viewportSize, 1567 _COM_Outptr_ ID2D1SvgDocument **svgDocument 1568 ) PURE; 1569 1570 /// <summary> 1571 /// Draw an SVG document. 1572 /// </summary> 1573 STDMETHOD_(void, DrawSvgDocument)( 1574 _In_ ID2D1SvgDocument *svgDocument 1575 ) PURE; 1576 1577 /// <summary> 1578 /// Creates a color context from a DXGI color space type. It is only valid to use 1579 /// this with the Color Management Effect in 'Best' mode. 1580 /// </summary> 1581 STDMETHOD(CreateColorContextFromDxgiColorSpace)( 1582 DXGI_COLOR_SPACE_TYPE colorSpace, 1583 _COM_Outptr_ ID2D1ColorContext1 **colorContext 1584 ) PURE; 1585 1586 /// <summary> 1587 /// Creates a color context from a simple color profile. It is only valid to use 1588 /// this with the Color Management Effect in 'Best' mode. 1589 /// </summary> 1590 STDMETHOD(CreateColorContextFromSimpleColorProfile)( 1591 _In_ CONST D2D1_SIMPLE_COLOR_PROFILE *simpleProfile, 1592 _COM_Outptr_ ID2D1ColorContext1 **colorContext 1593 ) PURE; 1594 1595 /// <summary> 1596 /// Creates a color context from a simple color profile. 1597 /// </summary> 1598 COM_DECLSPEC_NOTHROW 1599 HRESULT CreateColorContextFromSimpleColorProfile(CONST D2D1_SIMPLE_COLOR_PROFILE & simpleProfile,_COM_Outptr_ ID2D1ColorContext1 ** colorContext)1600 CreateColorContextFromSimpleColorProfile( 1601 CONST D2D1_SIMPLE_COLOR_PROFILE &simpleProfile, 1602 _COM_Outptr_ ID2D1ColorContext1 **colorContext 1603 ) 1604 { 1605 return CreateColorContextFromSimpleColorProfile(&simpleProfile, colorContext); 1606 } 1607 }; // interface ID2D1DeviceContext5 1608 1609 interface DX_DECLARE_INTERFACE("d55ba0a4-6405-4694-aef5-08ee1a4358b4") ID2D1Device5 : public ID2D1Device4 1610 { 1611 1612 /// <summary> 1613 /// Creates a new device context with no initially assigned target. 1614 /// </summary> 1615 STDMETHOD(CreateDeviceContext)( 1616 D2D1_DEVICE_CONTEXT_OPTIONS options, 1617 _COM_Outptr_ ID2D1DeviceContext5 **deviceContext5 1618 ) PURE; 1619 1620 using ID2D1Device4::CreateDeviceContext; 1621 1622 using ID2D1Device3::CreateDeviceContext; 1623 1624 using ID2D1Device2::CreateDeviceContext; 1625 1626 using ID2D1Device1::CreateDeviceContext; 1627 1628 using ID2D1Device::CreateDeviceContext; 1629 }; // interface ID2D1Device5 1630 1631 /// <summary> 1632 /// Creates Direct2D resources. This interface also enables the creation of 1633 /// ID2D1Device5 objects. 1634 /// </summary> 1635 interface DX_DECLARE_INTERFACE("f9976f46-f642-44c1-97ca-da32ea2a2635") ID2D1Factory6 : public ID2D1Factory5 1636 { 1637 1638 /// <summary> 1639 /// This creates a new Direct2D device from the given IDXGIDevice. 1640 /// </summary> 1641 STDMETHOD(CreateDevice)( 1642 _In_ IDXGIDevice *dxgiDevice, 1643 _COM_Outptr_ ID2D1Device5 **d2dDevice5 1644 ) PURE; 1645 1646 using ID2D1Factory5::CreateDevice; 1647 1648 using ID2D1Factory4::CreateDevice; 1649 1650 using ID2D1Factory3::CreateDevice; 1651 1652 using ID2D1Factory2::CreateDevice; 1653 1654 using ID2D1Factory1::CreateDevice; 1655 }; // interface ID2D1Factory6 1656 1657 #endif 1658 #if NTDDI_VERSION >= NTDDI_WIN10_RS3 1659 1660 interface DX_DECLARE_INTERFACE("7047dd26-b1e7-44a7-959a-8349e2144fa8") ID2D1CommandSink5 : public ID2D1CommandSink4 1661 { 1662 1663 STDMETHOD(BlendImage)( 1664 _In_ ID2D1Image *image, 1665 D2D1_BLEND_MODE blendMode, 1666 _In_opt_ CONST D2D1_POINT_2F *targetOffset, 1667 _In_opt_ CONST D2D1_RECT_F *imageRectangle, 1668 D2D1_INTERPOLATION_MODE interpolationMode 1669 ) PURE; 1670 }; // interface ID2D1CommandSink5 1671 1672 interface DX_DECLARE_INTERFACE("985f7e37-4ed0-4a19-98a3-15b0edfde306") ID2D1DeviceContext6 : public ID2D1DeviceContext5 1673 { 1674 1675 /// <summary> 1676 /// Draw an image to the device context. 1677 /// </summary> 1678 STDMETHOD_(void, BlendImage)( 1679 _In_ ID2D1Image *image, 1680 D2D1_BLEND_MODE blendMode, 1681 _In_opt_ CONST D2D1_POINT_2F *targetOffset = NULL, 1682 _In_opt_ CONST D2D1_RECT_F *imageRectangle = NULL, 1683 D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR 1684 ) PURE; 1685 }; // interface ID2D1DeviceContext6 1686 1687 interface DX_DECLARE_INTERFACE("7bfef914-2d75-4bad-be87-e18ddb077b6d") ID2D1Device6 : public ID2D1Device5 1688 { 1689 1690 /// <summary> 1691 /// Creates a new device context with no initially assigned target. 1692 /// </summary> 1693 STDMETHOD(CreateDeviceContext)( 1694 D2D1_DEVICE_CONTEXT_OPTIONS options, 1695 _COM_Outptr_ ID2D1DeviceContext6 **deviceContext6 1696 ) PURE; 1697 1698 using ID2D1Device5::CreateDeviceContext; 1699 1700 using ID2D1Device4::CreateDeviceContext; 1701 1702 using ID2D1Device3::CreateDeviceContext; 1703 1704 using ID2D1Device2::CreateDeviceContext; 1705 1706 using ID2D1Device1::CreateDeviceContext; 1707 1708 using ID2D1Device::CreateDeviceContext; 1709 }; // interface ID2D1Device6 1710 1711 /// <summary> 1712 /// Creates Direct2D resources. This interface also enables the creation of 1713 /// ID2D1Device6 objects. 1714 /// </summary> 1715 interface DX_DECLARE_INTERFACE("bdc2bdd3-b96c-4de6-bdf7-99d4745454de") ID2D1Factory7 : public ID2D1Factory6 1716 { 1717 1718 /// <summary> 1719 /// This creates a new Direct2D device from the given IDXGIDevice. 1720 /// </summary> 1721 STDMETHOD(CreateDevice)( 1722 _In_ IDXGIDevice *dxgiDevice, 1723 _COM_Outptr_ ID2D1Device6 **d2dDevice6 1724 ) PURE; 1725 1726 using ID2D1Factory6::CreateDevice; 1727 1728 using ID2D1Factory5::CreateDevice; 1729 1730 using ID2D1Factory4::CreateDevice; 1731 1732 using ID2D1Factory3::CreateDevice; 1733 1734 using ID2D1Factory2::CreateDevice; 1735 1736 using ID2D1Factory1::CreateDevice; 1737 }; // interface ID2D1Factory7 1738 1739 #endif 1740 1741 #endif 1742 1743 #ifdef D2D_USE_C_DEFINITIONS 1744 1745 typedef interface ID2D1InkStyle ID2D1InkStyle; 1746 1747 typedef interface ID2D1Ink ID2D1Ink; 1748 1749 typedef interface ID2D1GradientMesh ID2D1GradientMesh; 1750 1751 typedef interface ID2D1ImageSource ID2D1ImageSource; 1752 1753 typedef interface ID2D1ImageSourceFromWic ID2D1ImageSourceFromWic; 1754 1755 typedef interface ID2D1TransformedImageSource ID2D1TransformedImageSource; 1756 1757 typedef interface ID2D1LookupTable3D ID2D1LookupTable3D; 1758 1759 typedef interface ID2D1DeviceContext2 ID2D1DeviceContext2; 1760 1761 typedef interface ID2D1Device2 ID2D1Device2; 1762 1763 typedef interface ID2D1Factory3 ID2D1Factory3; 1764 1765 typedef interface ID2D1CommandSink2 ID2D1CommandSink2; 1766 1767 typedef interface ID2D1GdiMetafile1 ID2D1GdiMetafile1; 1768 1769 typedef interface ID2D1GdiMetafileSink1 ID2D1GdiMetafileSink1; 1770 1771 #endif 1772 1773 #ifdef __cplusplus 1774 extern "C" 1775 { 1776 #endif 1777 1778 #if NTDDI_VERSION >= NTDDI_WINTHRESHOLD 1779 void WINAPI 1780 D2D1GetGradientMeshInteriorPointsFromCoonsPatch( 1781 _In_ CONST D2D1_POINT_2F *pPoint0, 1782 _In_ CONST D2D1_POINT_2F *pPoint1, 1783 _In_ CONST D2D1_POINT_2F *pPoint2, 1784 _In_ CONST D2D1_POINT_2F *pPoint3, 1785 _In_ CONST D2D1_POINT_2F *pPoint4, 1786 _In_ CONST D2D1_POINT_2F *pPoint5, 1787 _In_ CONST D2D1_POINT_2F *pPoint6, 1788 _In_ CONST D2D1_POINT_2F *pPoint7, 1789 _In_ CONST D2D1_POINT_2F *pPoint8, 1790 _In_ CONST D2D1_POINT_2F *pPoint9, 1791 _In_ CONST D2D1_POINT_2F *pPoint10, 1792 _In_ CONST D2D1_POINT_2F *pPoint11, 1793 _Out_ D2D1_POINT_2F *pTensorPoint11, 1794 _Out_ D2D1_POINT_2F *pTensorPoint12, 1795 _Out_ D2D1_POINT_2F *pTensorPoint21, 1796 _Out_ D2D1_POINT_2F *pTensorPoint22 1797 ); 1798 #endif // #if NTDDI_VERSION >= NTDDI_WINTHRESHOLD 1799 1800 #ifdef __cplusplus 1801 } 1802 #endif 1803 1804 /*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */ 1805 /*#pragma endregion*/ 1806 #include <d2d1_3helper.h> 1807 #endif // #ifndef _D2D1_3_H_ 1808