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