1 module directx.d2d1effectauthor; 2 //--------------------------------------------------------------------------- 3 // Copyright (c) Microsoft Corporation. All rights reserved. 4 // 5 // This file is automatically generated. Please do not edit it directly. 6 // 7 // File name: D2D1EffectAuthor.h 8 //--------------------------------------------------------------------------- 9 10 version(Windows): 11 12 public import directx.d2d1_1; 13 14 public import directx.com; 15 16 /// <summary> 17 /// Function pointer that sets a property on an effect. 18 /// </summary> 19 alias PD2D1_PROPERTY_SET_FUNCTION = extern(Windows) HRESULT function(IUnknown effect, const(BYTE)* data, UINT32 dataSize); 20 21 /// <summary> 22 /// Function pointer that gets a property from an effect. 23 /// </summary> 24 alias PD2D1_PROPERTY_GET_FUNCTION = extern(Windows) HRESULT function(const IUnknown effect, BYTE* data, UINT32 dataSize, UINT32* actualSize); 25 26 /// <summary> 27 /// Indicates what has changed since the last time the effect was asked to prepare 28 /// to render. 29 /// </summary> 30 alias D2D1_CHANGE_TYPE = uint; 31 enum : D2D1_CHANGE_TYPE 32 { 33 34 /// <summary> 35 /// Nothing has changed. 36 /// </summary> 37 D2D1_CHANGE_TYPE_NONE = 0, 38 39 /// <summary> 40 /// The effect's properties have changed. 41 /// </summary> 42 D2D1_CHANGE_TYPE_PROPERTIES = 1, 43 44 /// <summary> 45 /// The internal context has changed and should be inspected. 46 /// </summary> 47 D2D1_CHANGE_TYPE_CONTEXT = 2, 48 49 /// <summary> 50 /// A new graph has been set due to a change in the input count. 51 /// </summary> 52 D2D1_CHANGE_TYPE_GRAPH = 3 53 } 54 55 56 /// <summary> 57 /// Indicates options for drawing using a pixel shader. 58 /// </summary> 59 alias D2D1_PIXEL_OPTIONS = uint; 60 enum : D2D1_PIXEL_OPTIONS 61 { 62 63 /// <summary> 64 /// Default pixel processing. 65 /// </summary> 66 D2D1_PIXEL_OPTIONS_NONE = 0, 67 68 /// <summary> 69 /// Indicates that the shader samples its inputs only at exactly the same scene 70 /// coordinate as the output pixel, and that it returns transparent black whenever 71 /// the input pixels are also transparent black. 72 /// </summary> 73 D2D1_PIXEL_OPTIONS_TRIVIAL_SAMPLING = 1 74 } 75 76 77 /// <summary> 78 /// Indicates options for drawing custom vertices set by transforms. 79 /// </summary> 80 alias D2D1_VERTEX_OPTIONS = uint; 81 enum : D2D1_VERTEX_OPTIONS 82 { 83 84 /// <summary> 85 /// Default vertex processing. 86 /// </summary> 87 D2D1_VERTEX_OPTIONS_NONE = 0, 88 89 /// <summary> 90 /// Indicates that the output rectangle does not need to be cleared before drawing 91 /// custom vertices. This must only be used by transforms whose custom vertices 92 /// completely cover their output rectangle. 93 /// </summary> 94 D2D1_VERTEX_OPTIONS_DO_NOT_CLEAR = 1, 95 96 /// <summary> 97 /// Causes a depth buffer to be used while drawing custom vertices. This impacts 98 /// drawing behavior when primitives overlap one another. 99 /// </summary> 100 D2D1_VERTEX_OPTIONS_USE_DEPTH_BUFFER = 2, 101 102 /// <summary> 103 /// Indicates that custom vertices do not form primitives which overlap one another. 104 /// </summary> 105 D2D1_VERTEX_OPTIONS_ASSUME_NO_OVERLAP = 4 106 } 107 108 109 /// <summary> 110 /// Describes how a vertex buffer is to be managed. 111 /// </summary> 112 alias D2D1_VERTEX_USAGE = uint; 113 enum : D2D1_VERTEX_USAGE 114 { 115 116 /// <summary> 117 /// The vertex buffer content do not change frequently from frame to frame. 118 /// </summary> 119 D2D1_VERTEX_USAGE_STATIC = 0, 120 121 /// <summary> 122 /// The vertex buffer is intended to be updated frequently. 123 /// </summary> 124 D2D1_VERTEX_USAGE_DYNAMIC = 1 125 126 } 127 128 129 /// <summary> 130 /// Describes a particular blend in the D2D1_BLEND_DESCRIPTION structure. 131 /// </summary> 132 alias D2D1_BLEND_OPERATION = uint; 133 enum : D2D1_BLEND_OPERATION 134 { 135 D2D1_BLEND_OPERATION_ADD = 1, 136 D2D1_BLEND_OPERATION_SUBTRACT = 2, 137 D2D1_BLEND_OPERATION_REV_SUBTRACT = 3, 138 D2D1_BLEND_OPERATION_MIN = 4, 139 D2D1_BLEND_OPERATION_MAX = 5 140 } 141 142 143 /// <summary> 144 /// Describes a particular blend in the D2D1_BLEND_DESCRIPTION structure. 145 /// </summary> 146 alias D2D1_BLEND = uint; 147 enum : D2D1_BLEND 148 { 149 D2D1_BLEND_ZERO = 1, 150 D2D1_BLEND_ONE = 2, 151 D2D1_BLEND_SRC_COLOR = 3, 152 D2D1_BLEND_INV_SRC_COLOR = 4, 153 D2D1_BLEND_SRC_ALPHA = 5, 154 D2D1_BLEND_INV_SRC_ALPHA = 6, 155 D2D1_BLEND_DEST_ALPHA = 7, 156 D2D1_BLEND_INV_DEST_ALPHA = 8, 157 D2D1_BLEND_DEST_COLOR = 9, 158 D2D1_BLEND_INV_DEST_COLOR = 10, 159 D2D1_BLEND_SRC_ALPHA_SAT = 11, 160 D2D1_BLEND_BLEND_FACTOR = 14, 161 D2D1_BLEND_INV_BLEND_FACTOR = 15 162 } 163 164 165 /// <summary> 166 /// Allows a caller to control the channel depth of a stage in the rendering 167 /// pipeline. 168 /// </summary> 169 alias D2D1_CHANNEL_DEPTH = uint; 170 enum : D2D1_CHANNEL_DEPTH 171 { 172 D2D1_CHANNEL_DEPTH_DEFAULT = 0, 173 D2D1_CHANNEL_DEPTH_1 = 1, 174 D2D1_CHANNEL_DEPTH_4 = 4 175 } 176 177 178 /// <summary> 179 /// Represents filtering modes transforms may select to use on their input textures. 180 /// </summary> 181 alias D2D1_FILTER = uint; 182 enum : D2D1_FILTER 183 { 184 D2D1_FILTER_MIN_MAG_MIP_POINT = 0x00, 185 D2D1_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x01, 186 D2D1_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04, 187 D2D1_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x05, 188 D2D1_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, 189 D2D1_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, 190 D2D1_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, 191 D2D1_FILTER_MIN_MAG_MIP_LINEAR = 0x15, 192 D2D1_FILTER_ANISOTROPIC = 0x55 193 } 194 195 196 /// <summary> 197 /// Defines capabilities of the underlying D3D device which may be queried using 198 /// CheckFeatureSupport. 199 /// </summary> 200 alias D2D1_FEATURE = uint; 201 enum : D2D1_FEATURE 202 { 203 D2D1_FEATURE_DOUBLES = 0, 204 D2D1_FEATURE_D3D10_X_HARDWARE_OPTIONS = 1 205 } 206 207 208 /// <summary> 209 /// Defines a property binding to a function. The name must match the property 210 /// defined in the registration schema. 211 /// </summary> 212 struct D2D1_PROPERTY_BINDING 213 { 214 215 /// <summary> 216 /// The name of the property. 217 /// </summary> 218 PCWSTR propertyName; 219 220 /// <summary> 221 /// The function that will receive the data to set. 222 /// </summary> 223 PD2D1_PROPERTY_SET_FUNCTION setFunction; 224 225 /// <summary> 226 /// The function that will be asked to write the output data. 227 /// </summary> 228 PD2D1_PROPERTY_GET_FUNCTION getFunction; 229 } 230 231 232 /// <summary> 233 /// This is used to define a resource texture when that resource texture is created. 234 /// </summary> 235 struct D2D1_RESOURCE_TEXTURE_PROPERTIES 236 { 237 const(UINT32)* extents; 238 UINT32 dimensions; 239 D2D1_BUFFER_PRECISION bufferPrecision; 240 D2D1_CHANNEL_DEPTH channelDepth; 241 D2D1_FILTER filter; 242 const(D2D1_EXTEND_MODE)* extendModes; 243 } 244 245 246 /// <summary> 247 /// This defines a single element of the vertex layout. 248 /// </summary> 249 struct D2D1_INPUT_ELEMENT_DESC 250 { 251 PCSTR semanticName; 252 UINT32 semanticIndex; 253 DXGI_FORMAT format; 254 UINT32 inputSlot; 255 UINT32 alignedByteOffset; 256 } 257 258 259 // 260 // Set to alignedByteOffset within D2D1_INPUT_ELEMENT_DESC for elements that 261 // immediately follow preceding elements in memory 262 // 263 enum D2D1_APPEND_ALIGNED_ELEMENT = 0xffffffff; 264 265 266 /// <summary> 267 /// This defines the properties of a vertex buffer which uses the default vertex 268 /// layout. 269 /// </summary> 270 struct D2D1_VERTEX_BUFFER_PROPERTIES 271 { 272 UINT32 inputCount; 273 D2D1_VERTEX_USAGE usage; 274 const(BYTE)* data; 275 UINT32 byteWidth; 276 } 277 278 279 /// <summary> 280 /// This defines the input layout of vertices and the vertex shader which processes 281 /// them. 282 /// </summary> 283 struct D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES 284 { 285 const(BYTE)* shaderBufferWithInputSignature; 286 UINT32 shaderBufferSize; 287 const(D2D1_INPUT_ELEMENT_DESC)* inputElements; 288 UINT32 elementCount; 289 UINT32 stride; 290 } 291 292 293 /// <summary> 294 /// This defines the range of vertices from a vertex buffer to draw. 295 /// </summary> 296 struct D2D1_VERTEX_RANGE 297 { 298 UINT32 startVertex; 299 UINT32 vertexCount; 300 } 301 302 303 /// <summary> 304 /// Blend description which configures a blend transform object. 305 /// </summary> 306 struct D2D1_BLEND_DESCRIPTION 307 { 308 D2D1_BLEND sourceBlend; 309 D2D1_BLEND destinationBlend; 310 D2D1_BLEND_OPERATION blendOperation; 311 D2D1_BLEND sourceBlendAlpha; 312 D2D1_BLEND destinationBlendAlpha; 313 D2D1_BLEND_OPERATION blendOperationAlpha; 314 FLOAT[4] blendFactor; 315 }; 316 317 318 /// <summary> 319 /// Describes options transforms may select to use on their input textures. 320 /// </summary> 321 struct D2D1_INPUT_DESCRIPTION 322 { 323 D2D1_FILTER filter; 324 UINT32 levelOfDetailCount; 325 } 326 327 328 /// <summary> 329 /// Indicates whether shader support for doubles is present on the underlying 330 /// hardware. This may be populated using CheckFeatureSupport. 331 /// </summary> 332 struct D2D1_FEATURE_DATA_DOUBLES 333 { 334 BOOL doublePrecisionFloatShaderOps; 335 } 336 337 338 /// <summary> 339 /// Indicates support for features which are optional on D3D10 feature levels. This 340 /// may be populated using CheckFeatureSupport. 341 /// </summary> 342 struct D2D1_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS 343 { 344 BOOL computeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x; 345 } 346 347 mixin(uuid!(ID2D1VertexBuffer, "9b8b1336-00a5-4668-92b7-ced5d8bf9b7b")); 348 /// <summary> 349 /// A transform uses this interface to write new vertices to a vertex buffer. 350 /// </summary> 351 interface ID2D1VertexBuffer : IUnknown 352 { 353 extern(Windows): 354 HRESULT Map( 355 BYTE** data, 356 UINT32 bufferSize 357 ); 358 359 HRESULT Unmap(); 360 } // interface ID2D1VertexBuffer 361 362 mixin(uuid!(ID2D1ResourceTexture, "688d15c3-02b0-438d-b13a-d1b44c32c39a")); 363 interface ID2D1ResourceTexture : IUnknown 364 { 365 extern(Windows): 366 /// <summary> 367 /// Update the vertex text. 368 /// </summary> 369 HRESULT Update( 370 const(UINT32)* minimumExtents, 371 const(UINT32)* maximimumExtents, 372 const(UINT32)* strides, 373 UINT32 dimensions, 374 const(BYTE)* data, 375 UINT32 dataCount 376 ); 377 } // interface ID2D1ResourceTexture 378 379 380 mixin(uuid!(ID2D1RenderInfo, "519ae1bd-d19a-420d-b849-364f594776b7")); 381 /// <summary> 382 /// A transform uses this interface to specify how to render a particular pass in 383 /// D2D. 384 /// </summary> 385 interface ID2D1RenderInfo : IUnknown 386 { 387 extern(Windows): 388 /// <summary> 389 /// Sets options for sampling the specified image input 390 /// </summary> 391 HRESULT SetInputDescription( 392 UINT32 inputIndex, 393 D2D1_INPUT_DESCRIPTION inputDescription 394 ); 395 396 /// <summary> 397 /// Controls the output precision and channel-depth for the associated transform. 398 /// </summary> 399 HRESULT SetOutputBuffer( 400 D2D1_BUFFER_PRECISION bufferPrecision, 401 D2D1_CHANNEL_DEPTH channelDepth 402 ); 403 404 /// <summary> 405 /// Controls whether the output of the associated transform is cached. 406 /// </summary> 407 void SetCached(BOOL isCached); 408 409 /// <summary> 410 /// Provides a hint of the approximate shader instruction count per pixel. If 411 /// provided, it may improve performance when processing large images. Instructions 412 /// should be counted multiple times if occurring within loops. 413 /// </summary> 414 void SetInstructionCountHint(UINT32 instructionCount); 415 } // interface ID2D1RenderInfo 416 417 418 mixin(uuid!(ID2D1DrawInfo, "693ce632-7f2f-45de-93fe-18d88b37aa21")); 419 /// <summary> 420 /// A transform uses this interface to specify how to render a particular pass using 421 /// pixel and vertex shaders. 422 /// </summary> 423 interface ID2D1DrawInfo : ID2D1RenderInfo 424 { 425 extern(Windows): 426 /// <summary> 427 /// Set the constant buffer for this transform's pixel shader. 428 /// </summary> 429 HRESULT SetPixelShaderConstantBuffer( 430 const(BYTE)* buffer, 431 UINT32 bufferCount 432 ); 433 434 /// <summary> 435 /// Sets the resource texture corresponding to the given shader texture index. 436 /// </summary> 437 HRESULT SetResourceTexture( 438 UINT32 textureIndex, 439 ID2D1ResourceTexture resourceTexture 440 ); 441 442 /// <summary> 443 /// Set the constant buffer for this transform's vertex shader. 444 /// </summary> 445 HRESULT SetVertexShaderConstantBuffer( 446 const(BYTE)* buffer, 447 UINT32 bufferCount 448 ); 449 450 /// <summary> 451 /// Set the shader instructions for this transform. 452 /// </summary> 453 HRESULT SetPixelShader( 454 REFGUID shaderId, 455 D2D1_PIXEL_OPTIONS pixelOptions = D2D1_PIXEL_OPTIONS_NONE 456 ); 457 458 /// <summary> 459 /// Set custom vertices for the associated transform. A blend mode if 460 /// foreground-over will be used if blendDescription is null. 461 /// </summary> 462 HRESULT SetVertexProcessing( 463 ID2D1VertexBuffer vertexBuffer, 464 D2D1_VERTEX_OPTIONS vertexOptions, 465 const(D2D1_BLEND_DESCRIPTION)* blendDescription = null, 466 const(D2D1_VERTEX_RANGE)* vertexRange = null, 467 const(GUID)* vertexShader = null 468 ); 469 } // interface ID2D1DrawInfo 470 471 472 mixin(uuid!(ID2D1ComputeInfo, "5598b14b-9fd7-48b7-9bdb-8f0964eb38bc")); 473 /// <summary> 474 /// A transform uses this interface to specify how to render a particular pass using 475 /// compute shader. 476 /// </summary> 477 interface ID2D1ComputeInfo : ID2D1RenderInfo 478 { 479 extern(Windows): 480 /// <summary> 481 /// Set the constant buffer for this transform. 482 /// </summary> 483 HRESULT SetComputeShaderConstantBuffer( 484 const(BYTE)* buffer, 485 UINT32 bufferCount 486 ); 487 488 /// <summary> 489 /// Set the shader instructions for this transform. 490 /// </summary> 491 HRESULT SetComputeShader(REFGUID shaderId); 492 493 /// <summary> 494 /// Sets the resource texture corresponding to the given shader texture index. 495 /// </summary> 496 HRESULT SetResourceTexture( 497 UINT32 textureIndex, 498 ID2D1ResourceTexture resourceTexture 499 ); 500 } // interface ID2D1ComputeInfo 501 502 503 mixin(uuid!(ID2D1TransformNode, "b2efe1e7-729f-4102-949f-505fa21bf666")); 504 /// <summary> 505 /// A base object which can be inserted into a transform graph. 506 /// </summary> 507 interface ID2D1TransformNode : IUnknown 508 { 509 extern(Windows): 510 /// <summary> 511 /// Return the number of input this node has. 512 /// </summary> 513 UINT32 GetInputCount() const; 514 } // interface ID2D1TransformNode 515 516 517 mixin(uuid!(ID2D1TransformGraph, "13d29038-c3e6-4034-9081-13b53a417992")); 518 /// <summary> 519 /// The implementation of the actual graph. 520 /// </summary> 521 interface ID2D1TransformGraph : IUnknown 522 { 523 extern(Windows): 524 /// <summary> 525 /// Return the number of input this graph has. 526 /// </summary> 527 UINT32 GetInputCount() const; 528 529 /// <summary> 530 /// Sets the graph to contain a single transform whose inputs map 1:1 with effect 531 /// inputs. 532 /// </summary> 533 HRESULT SetSingleTransformNode(ID2D1TransformNode node); 534 535 /// <summary> 536 /// Adds the given transform node to the graph. 537 /// </summary> 538 HRESULT AddNode(ID2D1TransformNode node); 539 540 /// <summary> 541 /// Removes the given transform node from the graph. 542 /// </summary> 543 HRESULT RemoveNode(ID2D1TransformNode node); 544 545 /// <summary> 546 /// Indicates that the given transform node should be considered to be the output 547 /// node of the graph. 548 /// </summary> 549 HRESULT SetOutputNode(ID2D1TransformNode node); 550 551 /// <summary> 552 /// Connects one node to another node inside the graph. 553 /// </summary> 554 HRESULT ConnectNode( 555 ID2D1TransformNode fromNode, 556 ID2D1TransformNode toNode, 557 UINT32 toNodeInputIndex 558 ); 559 560 /// <summary> 561 /// Connects a transform node inside the graph to the corresponding input of the 562 /// encapsulating effect. 563 /// </summary> 564 HRESULT ConnectToEffectInput( 565 UINT32 toEffectInputIndex, 566 ID2D1TransformNode node, 567 UINT32 toNodeInputIndex 568 ); 569 570 /// <summary> 571 /// Clears all nodes and connections from the transform graph. 572 /// </summary> 573 void Clear(); 574 575 /// <summary> 576 /// Uses the specified input as the effect output. 577 /// </summary> 578 HRESULT SetPassthroughGraph( 579 UINT32 effectInputIndex 580 ); 581 } // interface ID2D1TransformGraph 582 583 584 mixin(uuid!(ID2D1Transform, "ef1a287d-342a-4f76-8fdb-da0d6ea9f92b")); 585 /// <summary> 586 /// The interface implemented by a transform author. 587 /// </summary> 588 interface ID2D1Transform : ID2D1TransformNode 589 { 590 extern(Windows): 591 HRESULT MapOutputRectToInputRects( 592 const(D2D1_RECT_L)* outputRect, 593 D2D1_RECT_L* inputRects, 594 UINT32 inputRectsCount 595 ) const; 596 597 HRESULT MapInputRectsToOutputRect( 598 const(D2D1_RECT_L)* inputRects, 599 const(D2D1_RECT_L)* inputOpaqueSubRects, 600 UINT32 inputRectCount, 601 D2D1_RECT_L* outputRect, 602 D2D1_RECT_L* outputOpaqueSubRect 603 ); 604 605 HRESULT MapInvalidRect( 606 UINT32 inputIndex, 607 D2D1_RECT_L invalidInputRect, 608 D2D1_RECT_L* invalidOutputRect 609 ) const; 610 } // interface ID2D1Transform 611 612 613 mixin(uuid!(ID2D1DrawTransform, "36bfdcb6-9739-435d-a30d-a653beff6a6f")); 614 /// <summary> 615 /// The interface implemented by a transform author to provide a GPU-based effect. 616 /// </summary> 617 interface ID2D1DrawTransform : ID2D1Transform 618 { 619 extern(Windows): 620 HRESULT SetDrawInfo(ID2D1DrawInfo drawInfo); 621 } // interface ID2D1DrawTransform 622 623 624 mixin(uuid!(ID2D1ComputeTransform, "0d85573c-01e3-4f7d-bfd9-0d60608bf3c3")); 625 /// <summary> 626 /// The interface implemented by a transform author to provide a Compute Shader 627 /// based effect. 628 /// </summary> 629 interface ID2D1ComputeTransform : ID2D1Transform 630 { 631 extern(Windows): 632 HRESULT SetComputeInfo(ID2D1ComputeInfo computeInfo); 633 634 HRESULT CalculateThreadgroups( 635 const(D2D1_RECT_L)* outputRect, 636 UINT32* dimensionX, 637 UINT32* dimensionY, 638 UINT32* dimensionZ 639 ); 640 } // interface ID2D1ComputeTransform 641 642 643 mixin(uuid!(ID2D1AnalysisTransform, "0359dc30-95e6-4568-9055-27720d130e93")); 644 /// <summary> 645 /// The interface implemented by a transform author to indicate that it should 646 /// receive an analysis result callback. 647 /// </summary> 648 interface ID2D1AnalysisTransform : IUnknown 649 { 650 extern(Windows): 651 HRESULT ProcessAnalysisResults( 652 const(BYTE)* analysisData, 653 UINT32 analysisDataCount 654 ); 655 } // interface ID2D1AnalysisTransform 656 657 658 mixin(uuid!(ID2D1SourceTransform, "db1800dd-0c34-4cf9-be90-31cc0a5653e1")); 659 /// <summary> 660 /// The interface implemented by a transform author to provide a CPU based source 661 /// effect. 662 /// </summary> 663 interface ID2D1SourceTransform : ID2D1Transform 664 { 665 extern(Windows): 666 HRESULT SetRenderInfo(ID2D1RenderInfo renderInfo); 667 668 HRESULT Draw( 669 ID2D1Bitmap1 target, 670 const(D2D1_RECT_L)* drawRect, 671 D2D1_POINT_2U targetOrigin 672 ); 673 } // interface ID2D1SourceTransform 674 675 676 mixin(uuid!(ID2D1ConcreteTransform, "1a799d8a-69f7-4e4c-9fed-437ccc6684cc")); 677 /// <summary> 678 /// Base interface for built-in transforms on which precision and caching may be 679 /// controlled. 680 /// </summary> 681 interface ID2D1ConcreteTransform : ID2D1TransformNode 682 { 683 extern(Windows): 684 /// <summary> 685 /// Controls the output precision and channel-depth for this transform. 686 /// </summary> 687 HRESULT SetOutputBuffer( 688 D2D1_BUFFER_PRECISION bufferPrecision, 689 D2D1_CHANNEL_DEPTH channelDepth 690 ); 691 692 /// <summary> 693 /// Controls whether the output of this transform is cached. 694 /// </summary> 695 void SetCached(BOOL isCached); 696 } // interface ID2D1ConcreteTransform 697 698 699 mixin(uuid!(ID2D1BlendTransform, "63ac0b32-ba44-450f-8806-7f4ca1ff2f1b")); 700 /// <summary> 701 /// An effect uses this interface to configure a blending operation. 702 /// </summary> 703 interface ID2D1BlendTransform : ID2D1ConcreteTransform 704 { 705 extern(Windows): 706 void SetDescription(const(D2D1_BLEND_DESCRIPTION)* description); 707 708 void GetDescription(D2D1_BLEND_DESCRIPTION* description) const; 709 } // interface ID2D1BlendTransform 710 711 712 mixin(uuid!(ID2D1BorderTransform, "4998735c-3a19-473c-9781-656847e3a347")); 713 /// <summary> 714 /// An effect uses this interface to configure border generation. 715 /// </summary> 716 interface ID2D1BorderTransform :ID2D1ConcreteTransform 717 { 718 extern(Windows): 719 void SetExtendModeX(D2D1_EXTEND_MODE extendMode); 720 721 void SetExtendModeY(D2D1_EXTEND_MODE extendMode); 722 723 D2D1_EXTEND_MODE GetExtendModeX() const; 724 725 D2D1_EXTEND_MODE GetExtendModeY() const; 726 } // interface ID2D1BorderTransform 727 728 729 mixin(uuid!(ID2D1OffsetTransform, "3fe6adea-7643-4f53-bd14-a0ce63f24042")); 730 /// <summary> 731 /// An effect uses this interface to offset an image without inserting a rendering 732 /// pass. 733 /// </summary> 734 interface ID2D1OffsetTransform : ID2D1TransformNode 735 { 736 extern(Windows): 737 void SetOffset(D2D1_POINT_2L offset); 738 739 D2D1_POINT_2L GetOffset() const; 740 } // interface ID2D1OffsetTransform 741 742 743 mixin(uuid!(ID2D1BoundsAdjustmentTransform, "90f732e2-5092-4606-a819-8651970baccd")); 744 /// <summary> 745 /// An effect uses this interface to alter the image rectangle of its input. 746 /// </summary> 747 interface ID2D1BoundsAdjustmentTransform : ID2D1TransformNode 748 { 749 extern(Windows): 750 void SetOutputBounds(const(D2D1_RECT_L)* outputBounds); 751 752 void GetOutputBounds(D2D1_RECT_L* outputBounds) const; 753 } // interface ID2D1BoundsAdjustmentTransform 754 755 756 mixin(uuid!(ID2D1EffectImpl, "a248fd3f-3e6c-4e63-9f03-7f68ecc91db9")); 757 /// <summary> 758 /// This is the interface implemented by an effect author, along with the 759 /// constructor and registration information. 760 /// </summary> 761 interface ID2D1EffectImpl : IUnknown 762 { 763 extern(Windows): 764 /// <summary> 765 /// Initialize the effect with a context and a transform graph. The effect must 766 /// populate the transform graph with a topology and can update it later. 767 /// </summary> 768 HRESULT Initialize( 769 ID2D1EffectContext effectContext, 770 ID2D1TransformGraph transformGraph 771 ); 772 773 /// <summary> 774 /// Initialize the effect with a context and a transform graph. The effect must 775 /// populate the transform graph with a topology and can update it later. 776 /// </summary> 777 HRESULT PrepareForRender( 778 D2D1_CHANGE_TYPE changeType 779 ); 780 781 /// <summary> 782 /// Sets a new transform graph to the effect. This happens when the number of 783 /// inputs to the effect changes, if the effect support a variable number of inputs. 784 /// </summary> 785 HRESULT SetGraph( 786 ID2D1TransformGraph transformGraph 787 ); 788 } // interface ID2D1EffectImpl 789 790 791 mixin(uuid!(ID2D1EffectContext, "3d9f916b-27dc-4ad7-b4f1-64945340f563")); 792 /// <summary> 793 /// The internal context handed to effect authors to create transforms from effects 794 /// and any other operation tied to context which is not useful to the application 795 /// facing API. 796 /// </summary> 797 interface ID2D1EffectContext : IUnknown 798 { 799 800 void GetDpi( 801 FLOAT* dpiX, 802 FLOAT* dpiY 803 ) const; 804 805 /// <summary> 806 /// Create a new effect, the effect must either be built in or previously registered 807 /// through ID2D1Factory1::RegisterEffect. 808 /// </summary> 809 HRESULT CreateEffect( 810 REFCLSID effectId, 811 ID2D1Effect *effect 812 ); 813 814 HRESULT GetMaximumSupportedFeatureLevel( 815 const(D3D_FEATURE_LEVEL)* featureLevels, 816 UINT32 featureLevelsCount, 817 D3D_FEATURE_LEVEL* maximumSupportedFeatureLevel 818 ) const; 819 820 /// <summary> 821 /// Create a transform node from the passed in effect. 822 /// </summary> 823 HRESULT CreateTransformNodeFromEffect( 824 ID2D1Effect effect, 825 ID2D1TransformNode *transformNode 826 ); 827 828 HRESULT CreateBlendTransform( 829 UINT32 numInputs, 830 const(D2D1_BLEND_DESCRIPTION)* blendDescription, 831 ID2D1BlendTransform *transform 832 ); 833 834 HRESULT CreateBorderTransform( 835 D2D1_EXTEND_MODE extendModeX, 836 D2D1_EXTEND_MODE extendModeY, 837 ID2D1BorderTransform *transform 838 ); 839 840 HRESULT CreateOffsetTransform( 841 D2D1_POINT_2L offset, 842 ID2D1OffsetTransform *transform 843 ); 844 845 HRESULT CreateBoundsAdjustmentTransform( 846 const(D2D1_RECT_L)* outputRectangle, 847 ID2D1BoundsAdjustmentTransform *transform 848 ); 849 850 HRESULT LoadPixelShader( 851 REFGUID shaderId, 852 const(BYTE)* shaderBuffer, 853 UINT32 shaderBufferCount 854 ); 855 856 HRESULT LoadVertexShader( 857 REFGUID resourceId, 858 const(BYTE)* shaderBuffer, 859 UINT32 shaderBufferCount 860 ); 861 862 HRESULT LoadComputeShader( 863 REFGUID resourceId, 864 const(BYTE)* shaderBuffer, 865 UINT32 shaderBufferCount 866 ); 867 868 BOOL IsShaderLoaded(REFGUID shaderId); 869 870 HRESULT CreateResourceTexture( 871 const(GUID)* resourceId, 872 const(D2D1_RESOURCE_TEXTURE_PROPERTIES)* resourceTextureProperties, 873 const(BYTE)* data, 874 const(UINT32)* strides, 875 UINT32 dataSize, 876 ID2D1ResourceTexture *resourceTexture 877 ); 878 879 HRESULT FindResourceTexture( 880 const(GUID)* resourceId, 881 ID2D1ResourceTexture *resourceTexture 882 ); 883 884 HRESULT CreateVertexBuffer( 885 const(D2D1_VERTEX_BUFFER_PROPERTIES)* vertexBufferProperties, 886 const(GUID)* resourceId, 887 const(D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES)* customVertexBufferProperties, 888 ID2D1VertexBuffer *buffer 889 ); 890 891 HRESULT FindVertexBuffer( 892 const(GUID)* resourceId, 893 ID2D1VertexBuffer *buffer 894 ); 895 896 /// <summary> 897 /// Creates a color context from a color space. If the space is Custom, the context 898 /// is initialized from the profile/profileSize arguments. Otherwise the context is 899 /// initialized with the profile bytes associated with the space and 900 /// profile/profileSize are ignored. 901 /// </summary> 902 HRESULT CreateColorContext( 903 D2D1_COLOR_SPACE space, 904 const(BYTE)* profile, 905 UINT32 profileSize, 906 ID2D1ColorContext *colorContext 907 ); 908 909 HRESULT CreateColorContextFromFilename( 910 PCWSTR filename, 911 ID2D1ColorContext *colorContext 912 ); 913 914 HRESULT CreateColorContextFromWicColorContext( 915 IWICColorContext wicColorContext, 916 ID2D1ColorContext *colorContext 917 ); 918 919 HRESULT CheckFeatureSupport( 920 D2D1_FEATURE feature, 921 void* featureSupportData, 922 UINT32 featureSupportDataSize 923 ) const; 924 925 /// <summary> 926 /// Indicates whether the buffer precision is supported by D2D. 927 /// </summary> 928 BOOL IsBufferPrecisionSupported(D2D1_BUFFER_PRECISION bufferPrecision) const; 929 } // interface ID2D1EffectContext