using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using TerraFX.Interop.DirectX; using TerraFX.Interop.Windows; using TerraFX.Interop; #pragma warning disable CS0649, IDE1006 namespace ABI.Microsoft.Graphics.Canvas; /// /// An interop Win2D interface for all images and effects that can be drawn. /// [Guid("E042D1F7-F9AD-4479-A713-67627EA31863")] [NativeTypeName("class ICanvasImageInterop : IUnknown")] [NativeInheritance("IUnknown")] internal unsafe struct ICanvasImageInterop { public void** lpVtbl; /// /// Gets the device that the effect is currently realized on, if any. /// /// The resulting device, if available (as a marshalled ). /// The value describing the returned instance. /// The for the operation. [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(3)] public HRESULT GetDevice(ICanvasDevice** device, WIN2D_GET_DEVICE_ASSOCIATION_TYPE* type) { return ((delegate* unmanaged[Stdcall])this.lpVtbl[3])((ICanvasImageInterop*)Unsafe.AsPointer(ref this), device, type); } /// /// Gets an from an instance. /// /// The input canvas device (as a marshalled ). /// /// The device context in use. This value is is optional (but recommended), except when the /// flag is specified. This is because /// not all callers of have easy access to a context. It is always /// possible to get a resource creation context from the device, but the context is only /// actually necessary if a new effect realization needs to be created, so it is more efficient /// to have the implementation do this lookup only if/when it turns out to be needed. /// /// The flags to use to get the image. /// /// The DPI of the target device context. This is used to determine when a D2D1DpiCompensation /// effect needs to be inserted. Behavior of this parameter can be overridden by the flag values /// , /// /// or /// /// /// The DPI of a source bitmap, or zero if the image does not have a fixed DPI. A D2D1DpiCompensation effect /// will be inserted if and are different (flags permitting). /// /// The resulting for the effect. /// The for the operation. [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(4)] public HRESULT GetD2DImage( ICanvasDevice* device, ID2D1DeviceContext* deviceContext, WIN2D_GET_D2D_IMAGE_FLAGS flags, float targetDpi, float* realizeDpi, ID2D1Image** ppImage) { return ((delegate* unmanaged[Stdcall])this.lpVtbl[4])( (ICanvasImageInterop*)Unsafe.AsPointer(ref this), device, deviceContext, flags, targetDpi, realizeDpi, ppImage); } /// /// The implementation of . /// [ComImport] [Guid("E042D1F7-F9AD-4479-A713-67627EA31863")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface Interface { /// [PreserveSig] [return: NativeTypeName("HRESULT")] int GetDevice(ICanvasDevice** device, WIN2D_GET_DEVICE_ASSOCIATION_TYPE* type); /// [PreserveSig] [return: NativeTypeName("HRESULT")] int GetD2DImage( ICanvasDevice* device, ID2D1DeviceContext* deviceContext, WIN2D_GET_D2D_IMAGE_FLAGS flags, float targetDpi, float* realizeDpi, ID2D1Image** ppImage); } }