1 module aurora.directx.d2d1.d2d1effectauthor_0;
2 
3 public import aurora.directx.com;
4 public import aurora.directx.d2d1.d2d1_1;
5 
6 //Callabcks
7 alias PD2D1_PROPERTY_SET_FUNCTION = extern(Windows) HRESULT delegate(IUnknown effect, const ubyte *data, uint dataSize);
8 alias PD2D1_PROPERTY_GET_FUNCTION = extern(Windows) HRESULT delegate(const IUnknown effect, ubyte *data, uint dataSize, uint *actualSize);
9 
10 enum D2D1_CHANGE_TYPE
11 {
12     D2D1_CHANGE_TYPE_NONE = 0,
13     D2D1_CHANGE_TYPE_PROPERTIES = 1,
14     D2D1_CHANGE_TYPE_CONTEXT = 2,
15     D2D1_CHANGE_TYPE_GRAPH = 3,
16     D2D1_CHANGE_TYPE_FORCE_DWORD = 0xffffffff
17 }
18 
19 enum D2D1_PIXEL_OPTIONS
20 {
21     D2D1_PIXEL_OPTIONS_NONE = 0,
22     D2D1_PIXEL_OPTIONS_TRIVIAL_SAMPLING = 1,
23     D2D1_PIXEL_OPTIONS_FORCE_DWORD = 0xffffffff
24 }
25 
26 enum D2D1_VERTEX_OPTIONS
27 {
28     D2D1_VERTEX_OPTIONS_NONE = 0,
29     D2D1_VERTEX_OPTIONS_DO_NOT_CLEAR = 1,
30     D2D1_VERTEX_OPTIONS_USE_DEPTH_BUFFER = 2,
31     D2D1_VERTEX_OPTIONS_ASSUME_NO_OVERLAP = 4,
32     D2D1_VERTEX_OPTIONS_FORCE_DWORD = 0xffffffff
33 }
34 
35 enum D2D1_VERTEX_USAGE
36 {
37     D2D1_VERTEX_USAGE_STATIC = 0,
38     D2D1_VERTEX_USAGE_DYNAMIC = 1,
39     D2D1_VERTEX_USAGE_FORCE_DWORD = 0xffffffff
40 }
41 
42 enum D2D1_BLEND_OPERATION
43 {
44     D2D1_BLEND_OPERATION_ADD = 1,
45     D2D1_BLEND_OPERATION_SUBTRACT = 2,
46     D2D1_BLEND_OPERATION_REV_SUBTRACT = 3,
47     D2D1_BLEND_OPERATION_MIN = 4,
48     D2D1_BLEND_OPERATION_MAX = 5,
49     D2D1_BLEND_OPERATION_FORCE_DWORD = 0xffffffff
50 }
51 
52 enum D2D1_BLEND
53 {
54     D2D1_BLEND_ZERO = 1,
55     D2D1_BLEND_ONE = 2,
56     D2D1_BLEND_SRC_COLOR = 3,
57     D2D1_BLEND_INV_SRC_COLOR = 4,
58     D2D1_BLEND_SRC_ALPHA = 5,
59     D2D1_BLEND_INV_SRC_ALPHA = 6,
60     D2D1_BLEND_DEST_ALPHA = 7,
61     D2D1_BLEND_INV_DEST_ALPHA = 8,
62     D2D1_BLEND_DEST_COLOR = 9,
63     D2D1_BLEND_INV_DEST_COLOR = 10,
64     D2D1_BLEND_SRC_ALPHA_SAT = 11,
65     D2D1_BLEND_BLEND_FACTOR = 14,
66     D2D1_BLEND_INV_BLEND_FACTOR = 15,
67     D2D1_BLEND_FORCE_DWORD = 0xffffffff
68 }
69 
70 enum D2D1_CHANNEL_DEPTH
71 {
72     D2D1_CHANNEL_DEPTH_DEFAULT = 0,
73     D2D1_CHANNEL_DEPTH_1 = 1,
74     D2D1_CHANNEL_DEPTH_4 = 4,
75     D2D1_CHANNEL_DEPTH_FORCE_DWORD = 0xffffffff
76 }
77 
78 enum D2D1_FILTER
79 {
80     D2D1_FILTER_MIN_MAG_MIP_POINT = 0x00,
81     D2D1_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x01,
82     D2D1_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04,
83     D2D1_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x05,
84     D2D1_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
85     D2D1_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
86     D2D1_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
87     D2D1_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
88     D2D1_FILTER_ANISOTROPIC = 0x55,
89     D2D1_FILTER_FORCE_DWORD = 0xffffffff
90 }
91 
92 enum D2D1_FEATURE
93 {
94     D2D1_FEATURE_DOUBLES = 0,
95     D2D1_FEATURE_D3D10_X_HARDWARE_OPTIONS = 1,
96     D2D1_FEATURE_FORCE_DWORD = 0xffffffff
97 }
98 
99 struct D2D1_PROPERTY_BINDING
100 {
101     const wchar *propertyName;
102     PD2D1_PROPERTY_SET_FUNCTION setFunction;
103     PD2D1_PROPERTY_GET_FUNCTION getFunction;
104 }
105 
106 struct D2D1_RESOURCE_TEXTURE_PROPERTIES
107 {
108     const uint *extents;
109     uint dimensions;
110     D2D1_BUFFER_PRECISION bufferPrecision;
111     D2D1_CHANNEL_DEPTH channelDepth;
112     D2D1_FILTER filter;
113     const D2D1_EXTEND_MODE *extendModes;
114 }
115 
116 struct D2D1_INPUT_ELEMENT_DESC
117 {
118     const char *semanticName;
119     uint semanticIndex;
120     DXGI_FORMAT format;
121     uint inputSlot;
122     uint alignedByteOffset;
123 }
124 
125 enum D2D1_APPEND_ALIGNED_ELEMENT = 0xffffffff;
126 
127 struct D2D1_VERTEX_BUFFER_PROPERTIES
128 {
129     uint inputCount;
130     D2D1_VERTEX_USAGE usage;
131     const ubyte *data;
132     uint byteWidth;
133 }
134 
135 struct D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES
136 {
137     const byte *shaderBufferWithInputSignature;
138     uint shaderBufferSize;
139     const D2D1_INPUT_ELEMENT_DESC *inputElements;
140     uint elementCount;
141     uint stride;
142 }
143 
144 struct D2D1_VERTEX_RANGE
145 {
146     uint startVertex;
147     uint vertexCount;
148 }
149 
150 struct D2D1_BLEND_DESCRIPTION
151 {
152     D2D1_BLEND sourceBlend;
153     D2D1_BLEND destinationBlend;
154     D2D1_BLEND_OPERATION blendOperation;
155     D2D1_BLEND sourceBlendAlpha;
156     D2D1_BLEND destinationBlendAlpha;
157     D2D1_BLEND_OPERATION blendOperationAlpha;
158     float[4] blendFactor;
159 }
160 
161 struct D2D1_INPUT_DESCRIPTION
162 {
163     D2D1_FILTER filter;
164     uint levelOfDetailCount;
165 }
166 
167 struct D2D1_FEATURE_DATA_DOUBLES
168 {
169     bool doublePrecisionFloatShaderOps;
170 }
171 
172 struct D2D1_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS
173 {
174     bool computeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x;
175 }
176 
177 mixin(uuid!(ID2D1VertexBuffer, "9b8b1336-00a5-4668-92b7-ced5d8bf9b7b"));
178 public interface ID2D1VertexBuffer : IUnknown
179 {
180 extern(Windows):
181     HRESULT Map(ubyte **data, uint bufferSize);    
182     HRESULT Unmap();
183 }
184 
185 mixin(uuid!(ID2D1ResourceTexture, "688d15c3-02b0-438d-b13a-d1b44c32c39a"));
186 public interface ID2D1ResourceTexture : IUnknown
187 {
188 extern(Windows):
189     HRESULT Update(const uint *minimumExtents, const uint *maximimumExtents, const uint *strides, uint dimensions, const ubyte *data, uint dataCount);
190 }
191 
192 mixin(uuid!(ID2D1RenderInfo, "519ae1bd-d19a-420d-b849-364f594776b7"));
193 public interface ID2D1RenderInfo : IUnknown
194 {
195 extern(Windows):
196     HRESULT SetInputDescription(uint inputIndex, D2D1_INPUT_DESCRIPTION inputDescription);
197     HRESULT SetOutputBuffer(D2D1_BUFFER_PRECISION bufferPrecision, D2D1_CHANNEL_DEPTH channelDepth);
198     void SetCached(bool isCached);
199     void SetInstructionCountHint(uint instructionCount);
200 }
201 
202 mixin(uuid!(ID2D1DrawInfo, "693ce632-7f2f-45de-93fe-18d88b37aa21"));
203 public interface ID2D1DrawInfo : IUnknown
204 {
205 extern(Windows):
206     HRESULT SetPixelShaderConstantBuffer(const ubyte *buffer, uint bufferCount);
207     HRESULT SetResourceTexture(uint textureIndex, ID2D1ResourceTexture resourceTexture);
208     HRESULT SetVertexShaderConstantBuffer(const ubyte *buffer, uint bufferCount);
209     HRESULT SetPixelShader(REFGUID shaderId, D2D1_PIXEL_OPTIONS pixelOptions = D2D1_PIXEL_OPTIONS.D2D1_PIXEL_OPTIONS_NONE);
210     HRESULT SetVertexProcessing(ID2D1VertexBuffer vertexBuffer, D2D1_VERTEX_OPTIONS vertexOptions, const D2D1_BLEND_DESCRIPTION *blendDescription = NULL, const D2D1_VERTEX_RANGE *vertexRange = NULL, const GUID *vertexShader = null);
211 }
212 
213 mixin(uuid!(ID2D1ComputeInfo, "5598b14b-9fd7-48b7-9bdb-8f0964eb38bc"));
214 public interface ID2D1ComputeInfo : ID2D1RenderInfo
215 {
216 extern(Windows):
217     HRESULT SetComputeShaderConstantBuffer(const ubyte *buffer, uint bufferCount);
218     HRESULT SetComputeShader(REFGUID shaderId);
219     HRESULT SetResourceTexture(uint textureIndex, ID2D1ResourceTexture resourceTexture);
220 }
221 
222 mixin(uuid!(ID2D1TransformNode, "b2efe1e7-729f-4102-949f-505fa21bf666"));
223 public interface ID2D1TransformNode : IUnknown
224 {
225 extern(Windows):
226     uint GetInputCount();
227 }
228 
229 mixin(uuid!(ID2D1TransformGraph, "13d29038-c3e6-4034-9081-13b53a417992"));
230 public interface ID2D1TransformGraph : IUnknown
231 {
232 extern(Windows):
233     uint GetInputCount();
234     HRESULT SetSingleTransformNode(ID2D1TransformNode node);
235     HRESULT AddNode(ID2D1TransformNode node);
236     HRESULT RemoveNode(ID2D1TransformNode node);
237     HRESULT SetOutputNode(ID2D1TransformNode node);
238     HRESULT ConnectNode(ID2D1TransformNode fromNode, ID2D1TransformNode toNode, uint toNodeInputIndex);
239     HRESULT ConnectToEffectInput(uint toEffectInputIndex, ID2D1TransformNode node, uint toNodeInputIndex);
240     void Clear();
241     HRESULT SetPassthroughGraph(uint effectInputIndex);
242 }
243 
244 mixin(uuid!(ID2D1Transform, "ef1a287d-342a-4f76-8fdb-da0d6ea9f92b"));
245 public interface ID2D1Transform : ID2D1TransformNode
246 {
247 extern(Windows):
248     const HRESULT MapOutputRectToInputRects(const D2D1_RECT_L *outputRect, D2D1_RECT_L *inputRects, uint inputRectsCount);
249     HRESULT MapInputRectsToOutputRect(const D2D1_RECT_L *inputRects, const D2D1_RECT_L *inputOpaqueSubRects, uint inputRectCount, D2D1_RECT_L *outputRect, D2D1_RECT_L *outputOpaqueSubRect);
250     const HRESULT MapInvalidRect(uint inputIndex, D2D1_RECT_L invalidInputRect, D2D1_RECT_L *invalidOutputRect);
251 }
252 
253 mixin(uuid!(ID2D1DrawTransform, "36bfdcb6-9739-435d-a30d-a653beff6a6f"));
254 public interface ID2D1DrawTransform : ID2D1Transform
255 {
256 extern(Windows):
257     HRESULT SetDrawInfo(ID2D1DrawInfo drawInfo);
258 }
259 
260 mixin(uuid!(ID2D1ComputeTransform, "0d85573c-01e3-4f7d-bfd9-0d60608bf3c3"));
261 public interface ID2D1ComputeTransform : ID2D1Transform
262 {
263 extern(Windows):
264     HRESULT SetComputeInfo(ID2D1ComputeInfo computeInfo);
265     HRESULT CalculateThreadgroups(const D2D1_RECT_L *outputRect, uint *dimensionX, uint *dimensionY, uint *dimensionZ);
266 }
267 
268 mixin(uuid!(ID2D1AnalysisTransform, "0359dc30-95e6-4568-9055-27720d130e93"));
269 public interface ID2D1AnalysisTransform : IUnknown
270 {
271 extern(Windows):
272     HRESULT ProcessAnalysisResults(const ubyte *analysisData, uint analysisDataCount);
273 }
274 
275 mixin(uuid!(ID2D1SourceTransform, "db1800dd-0c34-4cf9-be90-31cc0a5653e1"));
276 public interface ID2D1SourceTransform : ID2D1Transform
277 {
278 extern(Windows):
279     HRESULT SetRenderInfo(ID2D1RenderInfo renderInfo);
280     HRESULT Draw(ID2D1Bitmap1 target, const D2D1_RECT_L *drawRect, D2D1_POINT_2U targetOrigin);
281 }
282 
283 mixin(uuid!(ID2D1ConcreteTransform, "1a799d8a-69f7-4e4c-9fed-437ccc6684cc"));
284 public interface ID2D1ConcreteTransform : ID2D1TransformNode
285 {
286 extern(Windows):
287     HRESULT SetOutputBuffer(D2D1_BUFFER_PRECISION bufferPrecision, D2D1_CHANNEL_DEPTH channelDepth);
288     void SetCached(bool isCached);
289 }
290 
291 mixin(uuid!(ID2D1BlendTransform, "63ac0b32-ba44-450f-8806-7f4ca1ff2f1b"));
292 public interface ID2D1BlendTransform : ID2D1ConcreteTransform
293 {
294 extern(Windows):
295     void SetDescription(const D2D1_BLEND_DESCRIPTION *description);
296     const void GetDescription(D2D1_BLEND_DESCRIPTION *description);
297 }
298 
299 mixin(uuid!(ID2D1BorderTransform, "4998735c-3a19-473c-9781-656847e3a347"));
300 public interface ID2D1BorderTransform : ID2D1ConcreteTransform
301 {
302 extern(Windows):
303     void SetExtendModeX(D2D1_EXTEND_MODE extendMode);
304     void SetExtendModeY(D2D1_EXTEND_MODE extendMode);
305     const D2D1_EXTEND_MODE GetExtendModeX();
306     const D2D1_EXTEND_MODE GetExtendModeY();
307 }
308 
309 mixin(uuid!(ID2D1OffsetTransform, "3fe6adea-7643-4f53-bd14-a0ce63f24042"));
310 public interface ID2D1OffsetTransform : ID2D1TransformNode
311 {
312 extern(Windows):
313     void SetOffset(D2D1_POINT_2L offset);
314     const D2D1_POINT_2L GetOffset();
315 }
316 
317 mixin(uuid!(ID2D1BoundsAdjustmentTransform, "90f732e2-5092-4606-a819-8651970baccd"));
318 public interface ID2D1BoundsAdjustmentTransform : ID2D1TransformNode
319 {
320 extern(Windows):
321     void SetOutputBounds(const D2D1_RECT_L *outputBounds);
322     const void GetOutputBounds(D2D1_RECT_L *outputBounds);
323 }
324 
325 mixin(uuid!(ID2D1EffectImpl, "a248fd3f-3e6c-4e63-9f03-7f68ecc91db9"));
326 public interface ID2D1EffectImpl : IUnknown
327 {
328 extern(Windows):
329     HRESULT Initialize(ID2D1EffectContext effectContext, ID2D1TransformGraph transformGraph);
330     HRESULT PrepareForRender(D2D1_CHANGE_TYPE changeType);
331     HRESULT SetGraph(ID2D1TransformGraph transformGraph);
332 }
333 
334 mixin(uuid!(ID2D1EffectContext, "3d9f916b-27dc-4ad7-b4f1-64945340f563"));
335 public interface ID2D1EffectContext : IUnknown
336 {
337 extern(Windows):
338     const void GetDpi(float *dpiX, float *dpiY);
339     HRESULT CreateEffect(REFCLSID effectId, ID2D1Effect *effect);
340     const HRESULT GetMaximumSupportedFeatureLevel(const  D3D_FEATURE_LEVEL *featureLevels, uint featureLevelsCount, D3D_FEATURE_LEVEL *maximumSupportedFeatureLevel);
341     HRESULT CreateTransformNodeFromEffect(ID2D1Effect effect, ID2D1TransformNode *transformNode);
342     HRESULT CreateBlendTransform(uint numInputs, const D2D1_BLEND_DESCRIPTION *blendDescription, ID2D1BlendTransform *transform);
343     HRESULT CreateBorderTransform(D2D1_EXTEND_MODE extendModeX, D2D1_EXTEND_MODE extendModeY, ID2D1BorderTransform *transform);
344     HRESULT CreateOffsetTransform(D2D1_POINT_2L offset, ID2D1OffsetTransform *transform);
345     HRESULT CreateBoundsAdjustmentTransform(const D2D1_RECT_L *outputRectangle, ID2D1BoundsAdjustmentTransform *transform);
346     HRESULT LoadPixelShader(REFGUID shaderId, const ubyte *shaderBuffer, uint shaderBufferCount);
347     HRESULT LoadVertexShader(REFGUID resourceId, const ubyte *shaderBuffer, uint shaderBufferCount);
348     HRESULT LoadComputeShader(REFGUID resourceId, const byte *shaderBuffer, uint shaderBufferCount);
349     bool IsShaderLoaded(REFGUID shaderId);
350     HRESULT CreateResourceTexture(const GUID *resourceId, const D2D1_RESOURCE_TEXTURE_PROPERTIES *resourceTextureProperties, const ubyte *data, const uint *strides, uint dataSize, ID2D1ResourceTexture *resourceTexture);
351     HRESULT FindResourceTexture(const GUID *resourceId, ID2D1ResourceTexture *resourceTexture);
352     HRESULT CreateVertexBuffer(const D2D1_VERTEX_BUFFER_PROPERTIES *vertexBufferProperties, const GUID *resourceId, const D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES *customVertexBufferProperties, ID2D1VertexBuffer *buffer);
353     HRESULT FindVertexBuffer(const GUID *resourceId, ID2D1VertexBuffer *buffer);
354     HRESULT CreateColorContext(D2D1_COLOR_SPACE space, const ubyte *profile, uint profileSize, ID2D1ColorContext *colorContext);
355     HRESULT CreateColorContextFromFilename(const wchar *filename, ID2D1ColorContext *colorContext);
356     HRESULT CreateColorContextFromWicColorContext(IWICColorContext wicColorContext, ID2D1ColorContext *colorContext);
357     const HRESULT CheckFeatureSupport(D2D1_FEATURE feature, void *featureSupportData, uint featureSupportDataSize);
358     const bool IsBufferPrecisionSupported(D2D1_BUFFER_PRECISION bufferPrecision);
359 }