using System.Numerics; using System.Runtime.InteropServices; using ABI.Microsoft.Graphics.Canvas.Effects; using TerraFX.Interop; using Windows.Foundation; namespace ABI.Microsoft.Graphics.Canvas; /// /// Native APIs from Microsoft.Graphics.Canvas (ie. Win2D). /// internal static unsafe class Win2D { /// /// Calculates the bounds for a given instance. /// /// The object in use. /// The input instance to compute the bounds for. /// The transform to use (optional). /// The resulting bounds. /// The for the operation. [DllImport("Microsoft.Graphics.Canvas.dll", PreserveSig = true, ExactSpelling = true)] [return: NativeTypeName("HRESULT")] public static extern int GetBoundsForICanvasImageInterop( ICanvasResourceCreator* resourceCreator, ICanvasImageInterop* image, [NativeTypeName("Windows::Foundation::Numerics::Matrix3x2 const*")] Matrix3x2* transform, Rect* rect); /// /// Implements support for for an external instance. /// /// The input instance to use to perform the operation. /// The target instance to execute the operation upon. /// The input index to invalidate. /// The rectangle to invalidate. /// The for the operation. [DllImport("Microsoft.Graphics.Canvas.dll", PreserveSig = true, ExactSpelling = true)] [return: NativeTypeName("HRESULT")] public static extern int InvalidateSourceRectangleForICanvasImageInterop( ICanvasResourceCreatorWithDpi* resourceCreator, ICanvasImageInterop* image, uint sourceIndex, [NativeTypeName("Windows::Foundation::Rect const*")] Rect* invalidRectangle); /// /// Implements support for for an external instance. /// /// The input instance to use to perform the operation. /// The target instance to execute the operation upon. /// The resulting length of the COM array returned via . /// The COM array with the sequence of invalid rectangles for the effect. /// The for the operation. [DllImport("Microsoft.Graphics.Canvas.dll", PreserveSig = true, ExactSpelling = true)] [return: NativeTypeName("HRESULT")] public static extern int GetInvalidRectanglesForICanvasImageInterop( ICanvasResourceCreatorWithDpi* resourceCreator, ICanvasImageInterop* image, uint* valueCount, Rect** valueElements); /// /// Implements support for and /// for an external instance. /// /// The input instance to use to perform the operation. /// The target instance to execute the operation upon. /// The portion of the output image whose inputs are being inspected. /// The length of the sequence of input effects. /// The sequence of input effects whose rectangles are being queries. /// The length of the sequence of indices for the input effects. /// The sequence of indices for the input effects. /// The length of the sequence of bounds to consider. /// The sequence of bounds to consider in the resulting output. /// The number of elements provided in . /// The sequence of resulting required rectangles to compute. /// The for the operation. [DllImport("Microsoft.Graphics.Canvas.dll", PreserveSig = true, ExactSpelling = true)] [return: NativeTypeName("HRESULT")] public static extern int GetRequiredSourceRectanglesForICanvasImageInterop( ICanvasResourceCreatorWithDpi* resourceCreator, ICanvasImageInterop* image, [NativeTypeName("Windows::Foundation::Rect const*")] Rect* outputRectangle, uint sourceEffectCount, [NativeTypeName("ABI::Microsoft::Graphics::Canvas::Effects::ICanvasEffect* const*")] ICanvasEffect** sourceEffects, uint sourceIndexCount, [NativeTypeName("uint32_t const*")] uint* sourceIndices, uint sourceBoundsCount, [NativeTypeName("Windows::Foundation::Rect const*")] Rect* sourceBounds, uint valueCount, Rect* valueElements); }