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