1 module aurora.directx.d2d1.d2d1_1; 2 3 version(Windows): 4 5 public import aurora.directx.d3d.d3dcommon; 6 public import aurora.directx.d2d1.d2d1_0; 7 8 // 9 // Enumerations 10 // 11 12 public enum D2D1_BITMAP_OPTIONS : int { 13 NONE = 0, 14 TARGET = 1, 15 CANNOT_DRAW = 2, 16 CPU_READ = 4, 17 GDI_COMPATIBLE = 8 18 } 19 20 public enum D2D1_BLEND : int { 21 ZERO = 1, 22 ONE = 2, 23 SRC_COLOR = 3, 24 INV_SRC_COLOR = 4, 25 SRC_ALPHA = 5, 26 INV_SRC_ALPHA = 6, 27 DEST_ALPHA = 7, 28 INV_DEST_ALPHA = 8, 29 DEST_COLOR = 9, 30 INV_DEST_COLOR = 10, 31 SRC_ALPHA_SAT = 11, 32 BLEND_FACTOR = 14, 33 INV_BLEND_FACTOR = 15 34 } 35 36 public enum D2D1_BLEND_OPERATION : int { 37 ADD = 1, 38 SUBTRACT = 2, 39 REV_SUBSTRACT = 3, 40 MIN = 4, 41 MAX = 5 42 } 43 44 public enum D2D1_BUFFER_PRECISION : int { 45 PRECISION_UNKNOWN = 0, 46 PRECISION_8BPC_UNORM = 1, 47 PRECISION_8BPC_UNORM_SRGB = 2, 48 PRECISION_16BPC_UNORM = 3, 49 PRECISION_16BPC_FLOAT = 4, 50 PRECISION_32BPC_FLOAT = 5, 51 PRECISION_FORCE_DWORD = 0xffffffff 52 } 53 54 public enum D2D1_CHANGE_TYPE : int { 55 NONE = 0, 56 PROPERTIES = 1, 57 CONTEXT = 2, 58 GRAPH = 3 59 } 60 61 public enum D2D1_CHANNEL_DEPTH : int { 62 DEPTH_DEFAULT = 0, 63 DEPTH_1 = 1, 64 DEPTH_4 = 4 65 } 66 67 public enum D2D1_COLOR_SPACE : int { 68 CUSTOM = 0, 69 SRGB = 1, 70 SCRGB = 2, 71 FORCE_DWORD = 0xffffffff 72 } 73 74 public enum D2D1_COLOR_INTERPOLATION_MODE : int { 75 STRAIGHT = 0, 76 PREMULTIPLIED = 1 77 } 78 79 public enum D2D1_COMPOSITE_MODE : int { 80 SOURCE_OVER = 0, 81 DESTINATION_OVER = 1, 82 SOURCE_IN = 2, 83 DESTINATION_IN = 3, 84 SOURCE_OUT = 4, 85 DESTINATION_OUT = 5, 86 SOURCE_ATOP = 6, 87 DESTINATION_ATOP = 7, 88 XOR = 8, 89 PLUS = 9, 90 SOURCE_COPY = 10, 91 BOUNDED_SOURCE_COPY = 11, 92 MASK_INVERT = 12 93 } 94 95 public enum D2D1_DEVICE_CONTEXT_OPTIONS : int { 96 NONE = 0, 97 ENABLE_MULTITHREADED_OPTIMIZATIONS = 1 98 } 99 100 public enum D2D1_FEATURE : int { 101 DOUBLES = 0, 102 D3D10_X_HARDWARE_OPTIONS = 1 103 } 104 105 public enum D2D1_FILTER : int { 106 MIN_MAG_MIP_POINT = 0x00, 107 MIN_MAG_POINT_MIP_LINEAR = 0x01, 108 MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04, 109 MIN_POINT_MAG_MIP_LINEAR = 0x05, 110 MIN_LINEAR_MAG_MIP_POINT = 0x10, 111 MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, 112 MIN_MAG_LINEAR_MIP_POINT = 0x14, 113 MIN_MAG_MIP_LINEAR = 0x15, 114 ANISOTROPIC = 0x55 115 } 116 117 public enum D2D1_GAMMA_CONVERSION : int { 118 CONVERSION_NONE = 0, 119 CONVERSION_2_2_TO_1_0 = 1, 120 CONVERSION_1_0_TO_2_2 = 2 121 } 122 123 public enum D2D1_INTERPOLATION_MODE : int { 124 NEAREST_NEIGHBOR, 125 LINEAR, 126 CUBIC, 127 MULTI_SAMPLE_LINEAR, 128 ANISOTROPIC, 129 HIGH_QUALITY_CUBIC 130 } 131 132 public enum D2D1_LAYER_OPTIONS1 : int { 133 NONE = 0, 134 INITIALIZE_FROM_BACKGROUND = 1, 135 IGNORE_ALPHA = 2 136 } 137 138 public enum D2D1_MAP_OPTIONS : int { 139 READ = 1, 140 WRITE = 2, 141 DISCARD = 4 142 } 143 144 public enum D2D1_PIXEL_OPTIONS { 145 NONE = 0, 146 TRIVIAL_SAMPLING = 1 147 } 148 149 public enum D2D1_PRIMITIVE_BLEND : int { 150 SOURCE_OVER = 0, 151 COPY = 1, 152 MIN = 2, 153 ADD = 3 154 } 155 156 public enum D2D1_PRINT_FONT_SUBSET_MODE { 157 DEFAULT = 0, 158 EACHPAGE = 1, 159 NONE = 2 160 } 161 162 public enum D2D1_PROPERTY_TYPE : int { 163 UNKNOWN = 0, 164 STRING = 1, 165 BOOL = 2, 166 UINT32 = 3, 167 INT32 = 4, 168 FLOAT = 5, 169 VECTOR2 = 6, 170 VECTOR3 = 7, 171 VECTOR4 = 8, 172 BLOB = 9, 173 IUNKNOWN = 10, 174 ENUM = 11, 175 ARRAY = 12, 176 CLSID = 13, 177 MATRIX_3X2 = 14, 178 MATRIX_4X3 = 15, 179 MATRIX_4X4 = 16, 180 MATRIX_5X4 = 17, 181 COLOR_CONTEXT = 17 182 } 183 184 public enum D2D1_PROPERTY : int { 185 CLSID = 0x80000000, 186 DISPLAYNAME = 0x80000001, 187 AUTHOR = 0x80000002, 188 CATEGORY = 0x80000003, 189 DESCRIPTION = 0x80000004, 190 INPUTS = 0x80000005, 191 CACHED = 0x80000006, 192 PRECISION = 0x80000007, 193 MIN_INPUTS = 0x80000008, 194 MAX_INPUTS = 0x80000009 195 } 196 197 public enum D2D1_RESOURCE_TYPE : int { 198 NONE = 0, 199 SHADER = 1, 200 BUFFER = 2 201 } 202 203 public enum D2D1_STROKE_TRANSFORM_TYPE : int { 204 NORMAL = 0, 205 FIXED = 1, 206 HAIRLINE = 2 207 } 208 209 public enum D2D1_SUBPROPERTY : int { 210 DISPLAYNAME = 0x80000000, 211 ISREADONLY = 0x80000001, 212 MIN = 0x80000002, 213 MAX = 0x80000003, 214 DEFAULT = 0x80000004, 215 FIELDS = 0x80000005, 216 INDEX = 0x80000006 217 } 218 219 public enum D2D1_THREADING_MODE { 220 SINGLE_THREADED = 0, 221 MULTI_THREADED = 1 222 } 223 224 public enum D2D1_UNIT_MODE : int { 225 DIPS = 0, 226 PIXELS = 1 227 } 228 229 public enum D2D1_VERTEX_OPTIONS : int { 230 NONE = 0, 231 DO_NOT_CLEAR = 1, 232 USE_DEPTH_BUFFER = 2, 233 ASSUME_NO_OVERLAP = 4 234 } 235 236 public enum D2D1_VERTEX_USAGE : int { 237 STATIC = 0, 238 DYNAMIC = 1 239 } 240 241 // 242 // Structures 243 // 244 245 public struct D2D1_BITMAP_BRUSH_PROPERTIES1 { 246 D2D1_EXTEND_MODE extendModeX; 247 D2D1_EXTEND_MODE extendModeY; 248 D2D1_INTERPOLATION_MODE interpolationMode; 249 } 250 251 public struct D2D1_BITMAP_PROPERTIES1 { 252 D2D1_PIXEL_FORMAT pixelFormat; 253 float dpiX; 254 float dpiY; 255 D2D1_BITMAP_OPTIONS bitmapOptions; 256 ID2D1ColorContext colorContext; 257 } 258 259 public struct D2D1_BLEND_DESCRIPTION { 260 D2D1_BLEND sourceBlend; 261 D2D1_BLEND destinationBlend; 262 D2D1_BLEND_OPERATION blendOperation; 263 D2D1_BLEND sourceBlendAlpha; 264 D2D1_BLEND destinationBlendAlpha; 265 D2D1_BLEND_OPERATION blendOperationAlpha; 266 float[4] blendFactor; 267 } 268 269 public struct D2D1_CREATION_PROPERTIES { 270 D2D1_THREADING_MODE threadingMode; 271 D2D1_DEBUG_LEVEL debugLevel; 272 D2D1_DEVICE_CONTEXT_OPTIONS options; 273 } 274 275 public struct D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES { 276 GUID vertexShader; 277 const D2D1_INPUT_ELEMENT_DESC *inputElements; 278 uint elementCount; 279 uint stride; 280 } 281 282 public struct D2D1_DRAWING_STATE_DESCRIPTION1 { 283 D2D1_ANTIALIAS_MODE antialiasMode; 284 D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode; 285 D2D1_TAG tag1; 286 D2D1_TAG tag2; 287 D2D1_MATRIX_3X2_F transform; 288 D2D1_PRIMITIVE_BLEND primitiveBlend; 289 D2D1_UNIT_MODE unitMode; 290 } 291 292 public struct D2D1_EFFECT_INPUT_DESCRIPTION { 293 ID2D1Effect Effect; 294 uint inputIndex; 295 D2D1_RECT_F inputRectangle; 296 } 297 298 public struct D2D1_FEATURE_DATA_DOUBLES { 299 BOOL doublePrecisionFloatShaderOps; 300 } 301 302 public struct D2D1_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS { 303 BOOL computeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x; 304 } 305 306 public struct D2D1_IMAGE_BRUSH_PROPERTIES { 307 D2D1_RECT_F sourceRectangle; 308 D2D1_EXTEND_MODE extendModeX; 309 D2D1_EXTEND_MODE extendModeY; 310 D2D1_INTERPOLATION_MODE interpolationMode; 311 } 312 313 public struct D2D1_INPUT_DESCRIPTION { 314 D2D1_FILTER filter; 315 uint levelOfDetailCount; 316 } 317 318 public struct D2D1_INPUT_ELEMENT_DESC { 319 PCSTR semanticName; 320 uint semanticIndex; 321 DXGI_FORMAT format; 322 uint inputSlot; 323 uint alignedByteOffset; 324 } 325 326 public struct D2D1_LAYER_PARAMETERS1 { 327 D2D1_RECT_F contentBounds; 328 ID2D1Geometry geometricMask; 329 D2D1_ANTIALIAS_MODE maskAntialiasMode; 330 D2D1_MATRIX_3X2_F maskTransform; 331 FLOAT opacity; 332 ID2D1Brush opacityBrush; 333 D2D1_LAYER_OPTIONS1 layerOptions; 334 } 335 336 public struct D2D1_MAPPED_RECT { 337 uint pitch; 338 ubyte *bits; 339 } 340 341 public struct D2D1_POINT2L { 342 long x; 343 long y; 344 } 345 alias D2D1_POINT2L D2D1_POINT_2L; 346 347 public struct D2D1_POINT_DESCRIPTION { 348 D2D1_POINT_2F point; 349 D2D1_POINT_2F unitTangentVector; 350 uint endSegment; 351 uint endFigure; 352 float lengthToEndSegment; 353 } 354 355 public struct D2D1_PRINT_CONTROL_PROPERTIES { 356 D2D1_PRINT_FONT_SUBSET_MODE fontSubset; 357 float rasterDPI; 358 D2D1_COLOR_SPACE colorSpace; 359 } 360 361 public struct D2D1_PROPERTY_BINDING { 362 PCWSTR propertyName; 363 PD2D1_PROPERTY_SET_FUNCTION setFunction; 364 PD2D1_PROPERTY_GET_FUNCTION getFunction; 365 } 366 367 public struct D2D1_RECTL { 368 long left; 369 long top; 370 long right; 371 long bottom; 372 } 373 alias D2D1_RECTL D2D1_RECT_L; 374 375 public struct D2D1_RESOURCE_TEXTURE_PROPERTIES { 376 const uint *extents; 377 uint dimensions; 378 D2D1_BUFFER_PRECISION bufferPrecision; 379 D2D1_CHANNEL_DEPTH channelDepth; 380 D2D1_FILTER filter; 381 const D2D1_EXTEND_MODE *extendModes; 382 } 383 384 public struct D2D1_RESOURCE_USAGE { 385 size_t workingTextureAreaMemory; 386 size_t cachingTextureAreaMemory; 387 size_t shaderCacheMemory; 388 } 389 390 public struct D2D1_RENDERING_CONTROLS { 391 D2D1_BUFFER_PRECISION bufferPrecision; 392 uint tileSize; 393 } 394 395 public struct D2D1_STROKE_STYLE_PROPERTIES1 { 396 D2D1_CAP_STYLE startCap; 397 D2D1_CAP_STYLE endCap; 398 D2D1_CAP_STYLE dashCap; 399 D2D1_LINE_JOIN lineJoin; 400 float miterLimit; 401 D2D1_DASH_STYLE dashStyle; 402 float dashOffset; 403 D2D1_STROKE_TRANSFORM_TYPE transformType; 404 } 405 406 public struct D2D1_VECTOR_2F { 407 float x; 408 float y; 409 } 410 411 public struct D2D1_VECTOR_3F { 412 float x; 413 float y; 414 float z; 415 } 416 417 public struct D2D1_VECTOR_4F { 418 float x; 419 float y; 420 float z; 421 float w; 422 } 423 424 public struct D2D1_VERTEX_BUFFER_PROPERTIES { 425 uint inputCount; 426 D2D1_VERTEX_USAGE usage; 427 const ubyte *data; 428 uint byteWidth; 429 } 430 431 public struct D2D1_VERTEX_RANGE { 432 uint startVertex; 433 uint vertexCount; 434 } 435 436 public struct PD2D1_EFFECT_FACTORY { 437 IUnknown *effectImplementation; 438 } 439 440 // 441 // Interfaces 442 // 443 444 mixin(uuid!(ID2D1AnalysisTransform, "0359dc30-95e6-4568-9055-27720d130e93")); 445 public interface ID2D1AnalysisTransform : IUnknown 446 { 447 extern(Windows): 448 HRESULT ProcessAnalysisResults(const(ubyte) *analysisData, uint analysisDataCount); 449 } 450 451 mixin(uuid!(ID2D1Bitmap1, "a898a84c-3873-4588-b08b-ebbf978df041")); 452 public interface ID2D1Bitmap1 : ID2D1Bitmap 453 { 454 extern(Windows): 455 void GetColorContext(ID2D1ColorContext *colorContext); 456 D2D1_BITMAP_OPTIONS GetOptions(); 457 void GetSourceStream(IStream *Stream); 458 HRESULT GetSurface(IDXGISurface *dxgiSurface); 459 HRESULT Map(D2D1_MAP_OPTIONS Options, D2D1_MAPPED_RECT *mappedRect); 460 HRESULT Unmap(); 461 } 462 463 mixin(uuid!(ID2D1BitmapBrush1, "41343a53-e41a-49a2-91cd-21793bbb62e5")); 464 public interface ID2D1BitmapBrush1 : ID2D1BitmapBrush 465 { 466 extern(Windows): 467 D2D1_INTERPOLATION_MODE GetInterpolationMode1(); 468 void SetInterpolationMode1(D2D1_INTERPOLATION_MODE interpolationMode); 469 } 470 471 mixin(uuid!(ID2D1BlendTransform, "63ac0b32-ba44-450f-8806-7f4ca1ff2f1b")); 472 public interface ID2D1BlendTransform : ID2D1ConcreteTransform 473 { 474 extern(Windows): 475 void GetDescription(D2D1_BLEND_DESCRIPTION *description); 476 void SetDescription(const D2D1_BLEND_DESCRIPTION *description); 477 } 478 479 mixin(uuid!(ID2D1BorderTransform, "63ac0b32-ba44-450f-8806-7f4ca1ff2f1b")); 480 public interface ID2D1BorderTransform : ID2D1ConcreteTransform 481 { 482 extern(Windows): 483 D2D1_EXTEND_MODE GetExtendModeX(); 484 D2D1_EXTEND_MODE GetExtendModeY(); 485 void SetExtendModeX(D2D1_EXTEND_MODE extendMode); 486 void SetExtendModeY(D2D1_EXTEND_MODE extendMode); 487 } 488 489 mixin(uuid!(ID2D1BoundsAdjustmentTransform, "90f732e2-5092-4606-a819-8651970baccd")); 490 public interface ID2D1BoundsAdjustmentTransform : ID2D1TransformNode 491 { 492 extern(Windows): 493 void GetOutputBounds(D2D1_RECT_L *outputBounds); 494 void SetOutputBounds(const D2D1_RECT_L *outputBounds); 495 } 496 497 mixin(uuid!(ID2D1ColorContext, "1c4820bb-5771-4518-a581-2fe4dd0ec657")); 498 public interface ID2D1ColorContext : ID2D1Resource 499 { 500 extern(Windows): 501 D2D1_COLOR_SPACE GetSpace(); 502 uint GetProfileSize(); 503 HRESULT GetProfile(ubyte *profile, uint profileSize); 504 } 505 506 mixin(uuid!(ID2D1CommandList, "b4f34a19-2383-4d76-94f6-ec343657c3dc")); 507 public interface ID2D1CommandList : ID2D1Image 508 { 509 extern(Windows): 510 HRESULT Close(); 511 HRESULT Stream(ID2D1CommandSink Sink); 512 } 513 514 mixin(uuid!(ID2D1CommandSink, "54d7898a-a061-40a7-bec7-e465bcba2c4f")); 515 public interface ID2D1CommandSink : IUnknown 516 { 517 extern(Windows): 518 HRESULT BeginDraw(); 519 HRESULT Clear(const D2D1_COLOR_F *clearColor); 520 void DrawBitmap(ID2D1Bitmap bitmap, D2D1_RECT_F destinationRectangle, float opacity, D2D1_INTERPOLATION_MODE interpolationMode, const D2D1_RECT_F sourceRectangle, const D2D1_MATRIX_4X4_F perspectiveTransform); 521 void DrawGdiMetafile(ID2D1GdiMetafile gdiMetafile, const D2D1_POINT_2F *targetOffset); 522 HRESULT DrawGeometry(ID2D1Geometry geometry, ID2D1Brush brush, float strokeWidth, ID2D1StrokeStyle strokeStyle); 523 HRESULT DrawGlyphRun(D2D1_POINT_2F baselineOrigin, const DWRITE_GLYPH_RUN *glyphRun, const DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription, ID2D1Brush *foregroundBrush, DWRITE_MEASURING_MODE measuringMode); 524 HRESULT DrawImage(ID2D1Image image, const D2D1_POINT_2F *targetOffset, const D2D1_RECT_F *imageRectangle, D2D1_INTERPOLATION_MODE interpolationMode, D2D1_COMPOSITE_MODE compositeMode); 525 HRESULT DrawLine(D2D1_POINT_2F Point0, D2D1_POINT_2F Point1, ID2D1Brush Brush, float strokeWidth, ID2D1StrokeStyle strokeStyle); 526 HRESULT DrawRectangle(const D2D1_RECT_F *Rect, ID2D1Brush Brush, float strokeWidth, ID2D1StrokeStyle strokeStyle); 527 HRESULT EndDraw(); 528 HRESULT FillGeometry(ID2D1Geometry geometry, ID2D1Brush brush, ID2D1Brush opacityBrush); 529 HRESULT FillMesh(ID2D1Mesh mesh, ID2D1Brush brush); 530 HRESULT FillOpacityMask(ID2D1Bitmap opacityMask, ID2D1Brush brush, const D2D1_RECT_F *destinationRectangle, const D2D1_RECT_F *sourceRectangle); 531 HRESULT FillRectangle(const D2D1_RECT_F *rect, ID2D1Brush brush); 532 HRESULT PopAxisAlignedClip(); 533 HRESULT PopLayer(); 534 HRESULT PushAxisAlignedClip(const D2D1_RECT_F *clipRect, D2D1_ANTIALIAS_MODE antialiasMode); 535 HRESULT PushLayer(const D2D1_LAYER_PARAMETERS1 *layerParameters, ID2D1Layer layer); 536 HRESULT SetAntialiasMode(D2D1_ANTIALIAS_MODE antialiasMode); 537 HRESULT SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND primitiveBlend); 538 HRESULT SetTags(D2D1_TAG tag1, D2D1_TAG tag2); 539 HRESULT SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode); 540 HRESULT SetTextRenderingParams(IDWriteRenderingParams textRenderingParams); 541 HRESULT SetTransform(const D2D1_MATRIX_3X2_F *transform); 542 HRESULT SetUnitMode(D2D1_UNIT_MODE unitMode); 543 } 544 545 mixin(uuid!(ID2D1ComputeInfo, "5598b14b-9fd7-48b7-9bdb-8f0964eb38bc")); 546 public interface ID2D1ComputeInfo : ID2D1RenderInfo 547 { 548 extern(Windows): 549 HRESULT SetComputeShader(GUID* shaderId); 550 HRESULT SetComputeShaderConstantBuffer(const ubyte *buffer, uint bufferCount); 551 HRESULT SetResourceTexture(uint textureIndex, ID2D1ResourceTexture resourceTexture); 552 } 553 554 mixin(uuid!(ID2D1ComputeTransform, "0d85573c-01e3-4f7d-bfd9-0d60608bf3c3")); 555 public interface ID2D1ComputeTransform : ID2D1Transform 556 { 557 extern(Windows): 558 HRESULT CalculateThreadgroups(const D2D1_RECT_L *outputRect, uint *dimensionX, uint *dimensionY, uint *dimensionZ); 559 HRESULT SetComputeInfo(ID2D1ComputeInfo computeInfo); 560 } 561 562 mixin(uuid!(ID2D1ConcreteTransform, "1a799d8a-69f7-4e4c-9fed-437ccc6684cc")); 563 public interface ID2D1ConcreteTransform : ID2D1TransformNode 564 { 565 extern(Windows): 566 void SetCached(BOOL isCached); 567 HRESULT SetOutputBuffer(D2D1_BUFFER_PRECISION bufferPrecision, D2D1_CHANNEL_DEPTH channelDepth); 568 } 569 570 mixin(uuid!(ID2D1Device, "47dd575d-ac05-4cdd-8049-9b02cd16f44c")); 571 public interface ID2D1Device : ID2D1Resource 572 { 573 extern(Windows): 574 HRESULT ClearResources(uint millisecondsSinceUse = 0); 575 HRESULT CreateDeviceContext(D2D1_DEVICE_CONTEXT_OPTIONS options, const ID2D1DeviceContext *deviceContext); 576 HRESULT CreatePrintControl(IWICImagingFactory wicFactory, IPrintDocumentPackageTarget documentTarget, const D2D1_PRINT_CONTROL_PROPERTIES *printControlProperties, ID2D1PrintControl *printControl); 577 ulong GetMaximumTextureMemory(); 578 void SetMaximumTextureMemory(ulong maximumInBytes); 579 } 580 581 mixin(uuid!(ID2D1DeviceContext, "e8f7fe7a-191c-466d-ad95-975678bda998")); 582 public interface ID2D1DeviceContext : ID2D1RenderTarget 583 { 584 extern(Windows): 585 HRESULT CreateBitmap(D2D1_SIZE_U size, const void *srcData, uint pitch, const D2D1_BITMAP_PROPERTIES1 *bitmapProperties, ID2D1Bitmap1 *bitmap); 586 HRESULT CreateBitmap(D2D1_SIZE_U size, const void *srcData, uint pitch, const D2D1_BITMAP_PROPERTIES1 *bitmapProperties, ID2D1Bitmap1 *bitmap); 587 HRESULT CreateBitmapBrush(ID2D1Bitmap bitmap, D2D1_BITMAP_BRUSH_PROPERTIES1 bitmapBrushProperties, D2D1_BRUSH_PROPERTIES brushProperties, ID2D1BitmapBrush1 *bitmapBrush); 588 HRESULT CreateBitmapBrush(ID2D1Bitmap bitmap, D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties, D2D1_BRUSH_PROPERTIES *brushProperties, ID2D1BitmapBrush1 *bitmapBrush); 589 HRESULT CreateBitmapBrush(ID2D1Bitmap bitmap, ID2D1BitmapBrush1 *bitmapBrush); 590 HRESULT CreateBitmapBrush(ID2D1Bitmap bitmap, D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties, ID2D1BitmapBrush1 *bitmapBrush); 591 HRESULT CreateBitmapFromDxgiSurface(IDXGISurface surface, const D2D1_BITMAP_PROPERTIES1 bitmapProperties, ID2D1Bitmap1 *bitmap); 592 HRESULT CreateBitmapFromDxgiSurface(IDXGISurface surface, const D2D1_BITMAP_PROPERTIES1 *bitmapProperties, ID2D1Bitmap1 *bitmap); 593 HRESULT CreateBitmapFromWicBitmap(IWICBitmapSource wicBitmapSource, const D2D1_BITMAP_PROPERTIES1 *bitmapProperties, ID2D1Bitmap1 *bitmap); 594 HRESULT CreateColorContext(D2D1_COLOR_SPACE space, const BYTE *Profile, uint profileSize, ID2D1ColorContext *colorContext); 595 HRESULT CreateColorContextFromFilename(PCWSTR Filename, ID2D1ColorContext *colorContext); 596 HRESULT CreateColorContextFromWicColorContext(IWICColorContext wicColorContext, ID2D1ColorContext *colorContext); 597 HRESULT CreateCommandList(ID2D1CommandList *commandList); 598 HRESULT CreateEffect(CLSID* effectId, ID2D1Effect *effect); 599 HRESULT CreateGradientStopCollection(const D2D1_GRADIENT_STOP *gradientStops, uint gradientStopsCount, D2D1_COLOR_SPACE preInterpolationSpace, D2D1_COLOR_SPACE postInterpolationSpace, D2D1_BUFFER_PRECISION bufferPrecision, D2D1_EXTEND_MODE extendMode, D2D1_COLOR_INTERPOLATION_MODE colorInterpolationMode, ID2D1GradientStopCollection1 *gradientStopCollection); 600 HRESULT CreateImageBrush(ID2D1Image image, const D2D1_IMAGE_BRUSH_PROPERTIES *imageBrushProperties, const D2D1_BRUSH_PROPERTIES *brushProperties, ID2D1ImageBrush *imageBrush); 601 HRESULT CreateImageBrush(ID2D1Image image, const D2D1_IMAGE_BRUSH_PROPERTIES *imageBrushProperties, ID2D1ImageBrush *imageBrush); 602 void DrawGdiMetafile(ID2D1GdiMetafile gdiMetafile, const D2D1_POINT_2F targetOffset); 603 void DrawGdiMetafile(ID2D1GdiMetafile gdiMetafile, const D2D1_POINT_2F *targetOffset); 604 void DrawGlyphRun(D2D1_POINT_2F baselineOrigin, const DWRITE_GLYPH_RUN *glyphRun, const DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription, ID2D1Brush *foregroundBrush, DWRITE_MEASURING_MODE measuringMode); 605 void DrawImage(ID2D1Image image, const D2D1_POINT_2F *targetOffset, const D2D1_RECT_F *imageRectangle, D2D1_INTERPOLATION_MODE interpolationMode, D2D1_COMPOSITE_MODE compositeMode); 606 void DrawImage(ID2D1Effect effect, const D2D1_POINT_2F *targetOffset, const D2D1_RECT_F *imageRectangle, D2D1_INTERPOLATION_MODE interpolationMode, D2D1_COMPOSITE_MODE compositeMode); 607 void DrawImage(ID2D1Image image, D2D1_INTERPOLATION_MODE interpolationMode, D2D1_COMPOSITE_MODE compositeMode); 608 void DrawImage(ID2D1Effect effect, D2D1_INTERPOLATION_MODE interpolationMode, D2D1_COMPOSITE_MODE compositeMode); 609 void DrawImage(ID2D1Image image, const D2D1_POINT_2F *targetOffset, D2D1_INTERPOLATION_MODE interpolationMode, D2D1_COMPOSITE_MODE compositeMode); 610 void DrawImage(ID2D1Effect effect, const D2D1_POINT_2F *targetOffset, D2D1_INTERPOLATION_MODE interpolationMode, D2D1_COMPOSITE_MODE compositeMode); 611 void FillOpacityMask(ID2D1Bitmap opacityMask, ID2D1Brush brush, const D2D1_RECT_F *destinationRectangle, const D2D1_RECT_F *sourceRectangle); 612 void GetDevice(ID2D1Device *device); 613 HRESULT GetEffectInvalidRectangleCount(ID2D1Effect effect, uint *rectangleCount); 614 HRESULT GetEffectInvalidRectangles(ID2D1Effect effect, D2D1_RECT_F *, uint rectanglesCount); 615 HRESULT GetEffectRequiredInputRectangles(ID2D1Effect renderEffect, const D2D1_RECT_F *renderImageRectangle, const D2D1_EFFECT_INPUT_DESCRIPTION *inputDescriptions, D2D1_RECT_F *requiredInputRects, uint inputCount); 616 HRESULT GetGlyphRunWorldBounds(D2D1_POINT_2F baselineOrigin, const DWRITE_GLYPH_RUN *glyphRun, DWRITE_MEASURING_MODE measuringMode, D2D1_RECT_F **bounds); 617 void GetImageLocalBounds(ID2D1Image image, D2D1_RECT_F[1] localBounds); 618 HRESULT GetImageWorldBounds(ID2D1Image image, D2D1_RECT_F[1] worldBounds); 619 D2D1_PRIMITIVE_BLEND GetPrimitiveBlend(); 620 void GetRenderingControls(D2D1_RENDERING_CONTROLS *renderingControls); 621 void GetTarget(ID2D1Image *target); 622 D2D1_UNIT_MODE GetUnitMode(); 623 HRESULT InvalidateEffectInputRectangle(ID2D1Effect effect, uint input, const D2D1_RECT_F *inputRectangle); 624 BOOL IsBufferPrecisionSupported(D2D1_BUFFER_PRECISION bufferPrecision); 625 BOOL IsDxgiFormatSupported(DXGI_FORMAT format); 626 void PushLayer(const D2D1_LAYER_PARAMETERS1 *layerParameters, ID2D1Layer layer); 627 void SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND primitiveBlend); 628 void SetRenderingControls(const D2D1_RENDERING_CONTROLS *renderingControls); 629 void SetTarget(ID2D1Image target); 630 void SetUnitMode(D2D1_UNIT_MODE unitMode); 631 } 632 633 mixin(uuid!(ID2D1DrawInfo, "693ce632-7f2f-45de-93fe-18d88b37aa21")); 634 public interface ID2D1DrawInfo : ID2D1RenderInfo 635 { 636 extern(Windows): 637 HRESULT SetPixelShader(GUID* shaderId, D2D1_PIXEL_OPTIONS pixelOptions = D2D1_PIXEL_OPTIONS.NONE); 638 HRESULT SetPixelShaderConstantBuffer(const(ubyte) *buffer, uint bufferCount); 639 HRESULT SetResourceTexture(uint textureIndex, ID2D1ResourceTexture resourceTexture); 640 HRESULT SetVertexProcessing(ID2D1VertexBuffer vertexBuffer, D2D1_VERTEX_OPTIONS vertexOptions, const D2D1_BLEND_DESCRIPTION *blendDescription = null, const D2D1_VERTEX_RANGE *vertexRange = null, GUID *vertexShader = null); 641 HRESULT SetVertexShaderConstantBuffer(const(BYTE) *buffer, uint bufferCount); 642 } 643 644 mixin(uuid!(ID2D1DrawingStateBlock1, "689f1f85-c72e-4e33-8f19-85754efd5ace")); 645 public interface ID2D1DrawingStateBlock1 : ID2D1DrawingStateBlock 646 { 647 extern(Windows): 648 void GetDescription1(D2D1_DRAWING_STATE_DESCRIPTION1 *stateDescription); 649 void SetDescription1(const D2D1_DRAWING_STATE_DESCRIPTION1 stateDescription1); 650 } 651 652 mixin(uuid!(ID2D1DrawTransform, "36bfdcb6-9739-435d-a30d-a653beff6a6f")); 653 public interface ID2D1DrawTransform : ID2D1Transform 654 { 655 extern(Windows): 656 HRESULT SetDrawInfo(ID2D1DrawInfo drawInfo); 657 } 658 659 mixin(uuid!(ID2D1Effect, "28211a43-7d89-476f-8181-2d6159b220ad")); 660 public interface ID2D1Effect : ID2D1Properties 661 { 662 extern(Windows): 663 void GetInput(uint Index, ID2D1Image *Input); 664 uint GetInputCount(); 665 void GetOutput(ID2D1Image *outputImage); 666 void SetInput(uint index, ID2D1Image input, BOOL invalidate = TRUE); 667 HRESULT SetInputCount(uint inputCount); 668 void SetInputEffect(uint index, ID2D1Effect input, BOOL invalidate = TRUE); 669 } 670 671 mixin(uuid!(ID2D1Factory1, "bb12d362-daee-4b9a-aa1d-14ba401cfa1f")); 672 public interface ID2D1Factory1 : ID2D1Factory 673 { 674 extern(Windows): 675 HRESULT CreateDevice(IDXGIDevice dxgiDevice, ID2D1Device *d2dDevice); 676 HRESULT CreateDrawingStateBlock(const D2D1_DRAWING_STATE_DESCRIPTION1 *drawingStateDescription, IDWriteRenderingParams textRenderingParams, ID2D1DrawingStateBlock1 *drawingStateBlock); 677 HRESULT CreateDrawingStateBlock(ID2D1DrawingStateBlock1 *drawingStateBlock); 678 HRESULT CreateDrawingStateBlock(const D2D1_DRAWING_STATE_DESCRIPTION1 *drawingStateDescription, ID2D1DrawingStateBlock1 *drawingStateBlock); 679 HRESULT CreateGdiMetafile(IStream *metafileStream, ID2D1GdiMetafile **metafile); 680 HRESULT CreatePathGeometry(const ID2D1PathGeometry1 **pathGeometry); 681 HRESULT CreateStrokeStyle(const D2D1_STROKE_STYLE_PROPERTIES1 *strokeStyleProperties, const float *dashes, uint dashesCount, const ID2D1StrokeStyle1 *strokeStyle); 682 HRESULT GetEffectProperties(CLSID* effectId, ID2D1Properties **properties); 683 HRESULT GetRegisteredEffects(CLSID *effects, uint effectCount, uint *effectsReturned, uint *effectsRegistered); 684 HRESULT RegisterEffectFromStream(CLSID* classId, IStream propertyXml, const D2D1_PROPERTY_BINDING *Bindings, uint bindingsCount, PD2D1_EFFECT_FACTORY effectFactory); 685 HRESULT RegisterEffectFromString(CLSID* classId, PCWSTR propertyXml, const D2D1_PROPERTY_BINDING *Bindings, uint bindingsCount, PD2D1_EFFECT_FACTORY effectFactory); 686 HRESULT UnregisterEffect(CLSID* classId); 687 } 688 689 mixin(uuid!(ID2D1GdiMetafile, "2f543dc3-cfc1-4211-864f-cfd91c6f3395")); 690 public interface ID2D1GdiMetafile : ID2D1Resource 691 { 692 extern(Windows): 693 HRESULT GetBounds(D2D1_RECT_F *bounds); 694 HRESULT Stream(ID2D1GdiMetafileSink metafileSink); 695 } 696 697 mixin(uuid!(ID2D1GdiMetafileSink, "82237326-8111-4f7c-bcf4-b5c1175564fe")); 698 public interface ID2D1GdiMetafileSink : IUnknown 699 { 700 extern(Windows): 701 BOOL ProcessRecord(DWORD recordType, void *recordData, uint recordDataSize); 702 } 703 704 mixin(uuid!(ID2D1GradientStopCollection1, "ae1572f4-5dd0-4777-998b-9279472ae63b")); 705 public interface ID2D1GradientStopCollection1 : ID2D1GradientStopCollection 706 { 707 extern(Windows): 708 D2D1_BUFFER_PRECISION GetBufferPrecision(); 709 D2D1_COLOR_INTERPOLATION_MODE GetColorInterpolationMode(); 710 void GetGradientStops1(D2D1_GRADIENT_STOP *gradientStops, uint gradientStopsCount); 711 D2D1_COLOR_SPACE GetPostInterpolationSpace(); 712 D2D1_COLOR_SPACE GetPreInterpolationSpace(); 713 } 714 715 mixin(uuid!(ID2D1ImageBrush, "fe9e984d-3f95-407c-b5db-cb94d4e8f87c")); 716 public interface ID2D1ImageBrush : ID2D1Brush 717 { 718 extern(Windows): 719 D2D1_EXTEND_MODE GetExtendModeX(); 720 D2D1_EXTEND_MODE GetExtendModeY(); 721 void GetImage(ID2D1Image *Image); 722 D2D1_INTERPOLATION_MODE GetInterpolationMode(); 723 void GetSourceRectangle(D2D1_RECT_F *sourceRectangle); 724 void SetExtendModeX(D2D1_EXTEND_MODE extendModeX); 725 void SetExtendModeY(D2D1_EXTEND_MODE extendModeY); 726 void SetImage(ID2D1Image Image); 727 void SetInterpolationMode(D2D1_INTERPOLATION_MODE interpolationMode); 728 void SetSourceRectangle(const(D2D1_RECT_F*) sourceRectangle); 729 } 730 731 mixin(uuid!(ID2D1Multithread, "31e6e7bc-e0ff-4d46-8c64-a0a8c41c15d3")); 732 public interface ID2D1Multithread : IUnknown 733 { 734 extern(Windows): 735 void Enter(); 736 BOOL GetMultithreadProtected(); 737 void Leave(); 738 } 739 740 mixin(uuid!(ID2D1OffsetTransform, "3fe6adea-7643-4f53-bd14-a0ce63f24042")); 741 public interface ID2D1OffsetTransform : ID2D1TransformNode 742 { 743 extern(Windows): 744 D2D1_POINT_2L GetOffset(); 745 void SetOffset(D2D1_POINT_2L offset); 746 } 747 748 mixin(uuid!(ID2D1PathGeometry1, "62baa2d2-ab54-41b7-b872-787e0106a421")); 749 public interface ID2D1PathGeometry1 : ID2D1PathGeometry 750 { 751 extern(Windows): 752 HRESULT ComputePointAndSegmentAtLength(float length, uint startSegment, const D2D1_MATRIX_3X2_F *worldTransform, float flatteningTolerance, D2D1_POINT_DESCRIPTION *pointDescription); 753 } 754 755 mixin(uuid!(ID2D1PrintControl, "2c1d867d-c290-41c8-ae7e-34a98702e9a5")); 756 public interface ID2D1PrintControl : IUnknown 757 { 758 extern(Windows): 759 HRESULT AddPage(ID2D1CommandList commandList, D2D_SIZE_F pageSize, IStream *pagePrintTicketStream, D2D1_TAG *tag1 = null, D2D1_TAG *tag2 = null); 760 HRESULT Close(); 761 } 762 763 mixin(uuid!(ID2D1Properties, "483473d7-cd46-4f9d-9d3a-3112aa80159d")); 764 public interface ID2D1Properties : IUnknown 765 { 766 extern(Windows): 767 uint GetPropertyCount(); 768 uint GetPropertyIndex(PCWSTR name); 769 HRESULT GetPropertyName(uint index, PWSTR name, uint nameCount); 770 uint GetPropertyNameLength(uint index); 771 HRESULT GetSubProperties(uint index, ID2D1Properties *subProperties); 772 D2D1_PROPERTY_TYPE GetType(uint index); 773 HRESULT GetValue(uint index, ubyte *data, uint dataSize); 774 HRESULT GetValue(uint index, D2D1_PROPERTY_TYPE type, ubyte *data, uint dataSize); 775 HRESULT GetValueByName(PCWSTR name, ubyte *data, uint dataSize); 776 HRESULT GetValueByName(PCWSTR name, D2D1_PROPERTY_TYPE type, ubyte *data, uint dataSize); 777 uint GetValueSize(uint index); 778 HRESULT SetValue(uint index, const(ubyte) *data, uint dataSize); 779 HRESULT SetValue(uint index, D2D1_PROPERTY_TYPE type, const(ubyte) *data, uint dataSize); 780 HRESULT SetValueByName(PCWSTR name, const(ubyte) *data, uint dataSize); 781 HRESULT SetValueByName(PCWSTR name, D2D1_PROPERTY_TYPE type, const(ubyte) *data, uint dataSize); 782 } 783 784 mixin(uuid!(ID2D1RenderInfo, "519ae1bd-d19a-420d-b849-364f594776b7")); 785 public interface ID2D1RenderInfo : IUnknown 786 { 787 extern(Windows): 788 void SetCached(BOOL isCached); 789 HRESULT SetInputDescription(uint index, D2D1_INPUT_DESCRIPTION inputDescription); 790 void SetInstructionCountHint(uint instructionCount); 791 HRESULT SetOutputBuffer(D2D1_BUFFER_PRECISION bufferPrecision, D2D1_CHANNEL_DEPTH channelDepth); 792 } 793 794 mixin(uuid!(ID2D1ResourceTexture, "688d15c3-02b0-438d-b13a-d1b44c32c39a")); 795 public interface ID2D1ResourceTexture : IUnknown 796 { 797 extern(Windows): 798 HRESULT Update(const(uint) *minimumExtents, const(uint) *maximumExtents, const(uint) *strides, uint dimensions, const(ubyte) *data, uint dataCount); 799 } 800 801 mixin(uuid!(ID2D1SourceTransform, "db1800dd-0c34-4cf9-be90-31cc0a5653e1")); 802 public interface ID2D1SourceTransform : ID2D1Transform 803 { 804 extern(Windows): 805 HRESULT Draw(ID2D1Bitmap1 target, const D2D1_RECT_L *drawRect, D2D1_POINT_2U targetOrigin); 806 HRESULT SetRenderInfo(ID2D1RenderInfo renderInfo); 807 } 808 809 mixin(uuid!(ID2D1StrokeStyle1, "10a72a66-e91c-43f4-993f-ddf4b82b0b4a")); 810 public interface ID2D1StrokeStyle1 : ID2D1StrokeStyle 811 { 812 extern(Windows): 813 D2D1_STROKE_TRANSFORM_TYPE GetStrokeTransformType(); 814 } 815 816 mixin(uuid!(ID2D1Transform, "ef1a287d-342a-4f76-8fdb-da0d6ea9f92b")); 817 public interface ID2D1Transform : ID2D1TransformNode 818 { 819 extern(Windows): 820 HRESULT MapInputRectsToOutputRect(const D2D1_RECT_L *inputRects, const D2D1_RECT_L *inputOpaqueRects, uint inputRectCount, D2D1_RECT_L *outputRect, D2D1_RECT_L *outputOpaqueRect); 821 HRESULT MapInvalidRect(uint inputIndex, D2D1_RECT_L invalidInputRect, D2D1_RECT_L *invalidOutputRect); 822 HRESULT MapOutputRectToInputRects(const D2D1_RECT_L *outputRect, D2D1_RECT_L *inputRects, uint inputRectsCount); 823 } 824 825 mixin(uuid!(ID2D1TransformGraph, "13d29038-c3e6-4034-9081-13b53a417992")); 826 public interface ID2D1TransformGraph : IUnknown 827 { 828 extern(Windows): 829 HRESULT AddNode(ID2D1TransformNode node); 830 void Clear(); 831 HRESULT ConnectNode(ID2D1TransformNode fromNode, ID2D1TransformNode toNode, uint toNodeInputIndex); 832 HRESULT ConnectToEffectInput(uint toEffectInputIndex, ID2D1TransformNode node, uint toNodeInputIndex); 833 uint GetInputCount(); 834 HRESULT RemoveNode(ID2D1TransformNode node); 835 HRESULT SetOutputNode(ID2D1TransformNode node); 836 HRESULT SetPassthroughGraph(uint effectInputIndex); 837 HRESULT SetSingleTransformNode(ID2D1TransformNode node); 838 } 839 840 mixin(uuid!(ID2D1TransformNode, "b2efe1e7-729f-4102-949f-505fa21bf666")); 841 public interface ID2D1TransformNode : IUnknown 842 { 843 extern(Windows): 844 uint GetInputCount(); 845 } 846 847 mixin(uuid!(ID2D1VertexBuffer, "9b8b1336-00a5-4668-92b7-ced5d8bf9b7b")); 848 public interface ID2D1VertexBuffer : IUnknown 849 { 850 extern(Windows): 851 HRESULT Map(const(ubyte) **data, uint bufferSize); 852 HRESULT Unmap(); 853 } 854 855 // 856 // Functions 857 // 858 859 extern(Windows) 860 { 861 float D2D1ComputeMaximumScaleFactor(const D2D1_MATRIX_3X2_F *matrix); 862 HRESULT D2D1CreateDevice(IDXGIDevice dxgiDevice, const D2D1_CREATION_PROPERTIES *creationProperties, ID2D1Device *d2dDevice); 863 HRESULT D2D1CreateDeviceContext(IDXGISurface dxgiSurface, const D2D1_CREATION_PROPERTIES *creationProperties, ID2D1DeviceContext *d2dDeviceContext); 864 D2D1_PROPERTY_TYPE GetType(uint index); 865 HRESULT StringGetter(const IUnknown effect, ubyte *data, uint dataSize, uint *actualSize); 866 HRESULT StringSetter(IUnknown effect, ubyte *data, uint dataSize); 867 HRESULT ValueGetter(const IUnknown *effect, ubyte *data, uint dataSize, uint *actualSize); 868 HRESULT ValueSetter(IUnknown effect, const ubyte *data, uint dataSize); 869 D2D1_COLOR_F D2D1ConvertColorSpace(D2D1_COLOR_SPACE sourceColorSpace, D2D1_COLOR_SPACE destinationColorSpace, const D2D1_COLOR_F *color); 870 void D2D1SinCos(float angle, float *s, float *c); 871 float D2D1Tan(float angle); 872 float D2D1Vec3Length(float x, float y, float z); 873 874 alias long function (IUnknown effect, const (ubyte) *data, uint dataSize) PD2D1_PROPERTY_SET_FUNCTION; 875 alias long function (IUnknown effect, ubyte *data, uint dataSize, uint *actualSize) PD2D1_PROPERTY_GET_FUNCTION; 876 }