From: Biswapriyo Nath nathbappai@gmail.com
--- .../windows.graphics.directx.direct3d11.idl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/include/windows.graphics.directx.direct3d11.idl b/include/windows.graphics.directx.direct3d11.idl index f53140545b0..cf58cee4256 100644 --- a/include/windows.graphics.directx.direct3d11.idl +++ b/include/windows.graphics.directx.direct3d11.idl @@ -32,6 +32,13 @@ namespace Windows.Graphics.DirectX.Direct3D11 { typedef struct Direct3DSurfaceDescription Direct3DSurfaceDescription;
interface IDirect3DDevice; + interface IDirect3DSurface; + + declare { + interface Windows.Foundation.Collections.IIterable<Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface *>; + interface Windows.Foundation.Collections.IIterator<Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface *>; + interface Windows.Foundation.Collections.IVectorView<Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface *>; + }
[ contract(Windows.Foundation.UniversalApiContract, 1.0) @@ -62,4 +69,15 @@ namespace Windows.Graphics.DirectX.Direct3D11 { { HRESULT Trim(); } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + uuid(0bf4a146-13c1-4694-bee3-7abf15eaf586) + ] + interface IDirect3DSurface : IInspectable + requires Windows.Foundation.IClosable + { + [propget] HRESULT Description( + [out, retval] Windows.Graphics.DirectX.Direct3D11.Direct3DSurfaceDescription *value); + } }
From: Biswapriyo Nath nathbappai@gmail.com
--- include/windows.graphics.imaging.idl | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 include/windows.graphics.imaging.idl
diff --git a/include/windows.graphics.imaging.idl b/include/windows.graphics.imaging.idl new file mode 100644 index 00000000000..5c6a6c2ea60 --- /dev/null +++ b/include/windows.graphics.imaging.idl @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Biswapriyo Nath + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; +import "windows.graphics.directx.direct3d11.idl"; +import "windows.storage.streams.idl"; + +namespace Windows.Graphics.Imaging { + typedef struct BitmapPlaneDescription BitmapPlaneDescription; + + interface IBitmapBuffer; + + runtimeclass BitmapBuffer; + + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + struct BitmapPlaneDescription + { + INT32 StartIndex; + INT32 Width; + INT32 Height; + INT32 Stride; + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Graphics.Imaging.BitmapBuffer), + uuid(a53e04c4-399c-438c-b28f-a63a6b83d1a1) + ] + interface IBitmapBuffer : IInspectable + requires Windows.Foundation.IMemoryBuffer, Windows.Foundation.IClosable + { + HRESULT GetPlaneCount([out, retval] INT32 *value); + HRESULT GetPlaneDescription([in] INT32 index, [out, retval] Windows.Graphics.Imaging.BitmapPlaneDescription *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass BitmapBuffer + { + [default] interface Windows.Graphics.Imaging.IBitmapBuffer; + interface Windows.Foundation.IMemoryBuffer; + interface Windows.Foundation.IClosable; + } +}
From: Biswapriyo Nath nathbappai@gmail.com
--- include/windows.graphics.imaging.idl | 157 +++++++++++++++++++++++++++ 1 file changed, 157 insertions(+)
diff --git a/include/windows.graphics.imaging.idl b/include/windows.graphics.imaging.idl index 5c6a6c2ea60..6c78663a473 100644 --- a/include/windows.graphics.imaging.idl +++ b/include/windows.graphics.imaging.idl @@ -29,11 +29,63 @@ import "windows.graphics.directx.direct3d11.idl"; import "windows.storage.streams.idl";
namespace Windows.Graphics.Imaging { + typedef enum BitmapAlphaMode BitmapAlphaMode; + typedef enum BitmapBufferAccessMode BitmapBufferAccessMode; + typedef enum BitmapPixelFormat BitmapPixelFormat; typedef struct BitmapPlaneDescription BitmapPlaneDescription;
interface IBitmapBuffer; + interface ISoftwareBitmap; + interface ISoftwareBitmapFactory; + interface ISoftwareBitmapStatics;
runtimeclass BitmapBuffer; + runtimeclass SoftwareBitmap; + + declare { + interface Windows.Foundation.Collections.IIterable<Windows.Graphics.Imaging.BitmapPixelFormat>; + interface Windows.Foundation.Collections.IIterable<Windows.Graphics.Imaging.SoftwareBitmap *>; + interface Windows.Foundation.Collections.IIterator<Windows.Graphics.Imaging.BitmapPixelFormat>; + interface Windows.Foundation.Collections.IIterator<Windows.Graphics.Imaging.SoftwareBitmap *>; + interface Windows.Foundation.Collections.IVectorView<Windows.Graphics.Imaging.BitmapPixelFormat>; + interface Windows.Foundation.IAsyncOperation<Windows.Graphics.Imaging.SoftwareBitmap *>; + interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Graphics.Imaging.SoftwareBitmap *>; + } + + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + enum BitmapAlphaMode + { + Premultiplied = 0, + Straight = 1, + Ignore = 2, + }; + + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + enum BitmapBufferAccessMode + { + Read = 0, + ReadWrite = 1, + Write = 2, + }; + + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + enum BitmapPixelFormat + { + Unknown = 0, + Rgba16 = 12, + Rgba8 = 30, + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + Gray16 = 57, + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + Gray8 = 62, + Bgra8 = 87, + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + Nv12 = 103, + [contract(Windows.Foundation.UniversalApiContract, 6.0)] + P010 = 104, + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + Yuy2 = 107, + };
[contract(Windows.Foundation.UniversalApiContract, 1.0)] struct BitmapPlaneDescription @@ -56,6 +108,98 @@ namespace Windows.Graphics.Imaging { HRESULT GetPlaneDescription([in] INT32 index, [out, retval] Windows.Graphics.Imaging.BitmapPlaneDescription *value); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Graphics.Imaging.SoftwareBitmap), + uuid(689e0708-7eef-483f-963f-da938818e073) + ] + interface ISoftwareBitmap : IInspectable + requires Windows.Foundation.IClosable + { + [propget] HRESULT BitmapPixelFormat([out, retval] Windows.Graphics.Imaging.BitmapPixelFormat *value); + [propget] HRESULT BitmapAlphaMode([out, retval] Windows.Graphics.Imaging.BitmapAlphaMode *value); + [propget] HRESULT PixelWidth([out, retval] INT32 *value); + [propget] HRESULT PixelHeight([out, retval] INT32 *value); + [propget] HRESULT IsReadOnly([out, retval] boolean *value); + [propput] HRESULT DpiX([in] DOUBLE value); + [propget] HRESULT DpiX([out, retval] DOUBLE *value); + [propput] HRESULT DpiY([in] DOUBLE value); + [propget] HRESULT DpiY([out, retval] DOUBLE *value); + HRESULT LockBuffer([in] Windows.Graphics.Imaging.BitmapBufferAccessMode mode, + [out, retval] Windows.Graphics.Imaging.BitmapBuffer **value); + HRESULT CopyTo([in] Windows.Graphics.Imaging.SoftwareBitmap *bitmap); + HRESULT CopyFromBuffer([in] Windows.Storage.Streams.IBuffer *buffer); + HRESULT CopyToBuffer([in] Windows.Storage.Streams.IBuffer *buffer); + HRESULT GetReadOnlyView([out, retval] Windows.Graphics.Imaging.SoftwareBitmap **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Graphics.Imaging.SoftwareBitmap), + uuid(c99feb69-2d62-4d47-a6b3-4fdb6a07fdf8) + ] + interface ISoftwareBitmapFactory : IInspectable + { + HRESULT Create( + [in] Windows.Graphics.Imaging.BitmapPixelFormat format, + [in] INT32 width, + [in] INT32 height, + [out, retval] Windows.Graphics.Imaging.SoftwareBitmap **value); + HRESULT CreateWithAlpha( + [in] Windows.Graphics.Imaging.BitmapPixelFormat format, + [in] INT32 width, + [in] INT32 height, + [in] Windows.Graphics.Imaging.BitmapAlphaMode alpha, + [out, retval] Windows.Graphics.Imaging.SoftwareBitmap **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Graphics.Imaging.SoftwareBitmap), + uuid(df0385db-672f-4a9d-806e-c2442f343e86) + ] + interface ISoftwareBitmapStatics : IInspectable + { + HRESULT Copy( + [in] Windows.Graphics.Imaging.SoftwareBitmap *source, + [out, retval] Windows.Graphics.Imaging.SoftwareBitmap **value); + [overload("Convert")] + HRESULT Convert( + [in] Windows.Graphics.Imaging.SoftwareBitmap *source, + [in] Windows.Graphics.Imaging.BitmapPixelFormat format, + [out, retval] Windows.Graphics.Imaging.SoftwareBitmap **value); + [overload("Convert")] + HRESULT ConvertWithAlpha( + [in] Windows.Graphics.Imaging.SoftwareBitmap *source, + [in] Windows.Graphics.Imaging.BitmapPixelFormat format, + [in] Windows.Graphics.Imaging.BitmapAlphaMode alpha, + [out, retval] Windows.Graphics.Imaging.SoftwareBitmap **value); + [overload("CreateCopyFromBuffer")] + HRESULT CreateCopyFromBuffer( + [in] Windows.Storage.Streams.IBuffer *source, + [in] Windows.Graphics.Imaging.BitmapPixelFormat format, + [in] INT32 width, + [in] INT32 height, + [out, retval] Windows.Graphics.Imaging.SoftwareBitmap **value); + [overload("CreateCopyFromBuffer")] + HRESULT CreateCopyWithAlphaFromBuffer( + [in] Windows.Storage.Streams.IBuffer *source, + [in] Windows.Graphics.Imaging.BitmapPixelFormat format, + [in] INT32 width, + [in] INT32 height, + [in] Windows.Graphics.Imaging.BitmapAlphaMode alpha, + [out, retval] Windows.Graphics.Imaging.SoftwareBitmap **value); + [overload("CreateCopyFromSurfaceAsync")] + HRESULT CreateCopyFromSurfaceAsync( + [in] Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface *surface, + [out, retval] Windows.Foundation.IAsyncOperation<Windows.Graphics.Imaging.SoftwareBitmap *> **value); + [overload("CreateCopyFromSurfaceAsync")] + HRESULT CreateCopyWithAlphaFromSurfaceAsync( + [in] Windows.Graphics.DirectX.Direct3D11.IDirect3DSurface *surface, + [in] Windows.Graphics.Imaging.BitmapAlphaMode alpha, + [out, retval] Windows.Foundation.IAsyncOperation<Windows.Graphics.Imaging.SoftwareBitmap *> **value); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), marshaling_behavior(agile), @@ -67,4 +211,17 @@ namespace Windows.Graphics.Imaging { interface Windows.Foundation.IMemoryBuffer; interface Windows.Foundation.IClosable; } + + [ + activatable(Windows.Graphics.Imaging.ISoftwareBitmapFactory, Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.Graphics.Imaging.ISoftwareBitmapStatics, Windows.Foundation.UniversalApiContract, 1.0), + threading(both) + ] + runtimeclass SoftwareBitmap + { + [default] interface Windows.Graphics.Imaging.ISoftwareBitmap; + interface Windows.Foundation.IClosable; + } }
From: Biswapriyo Nath nathbappai@gmail.com
--- include/windows.graphics.imaging.idl | 11 +++++ include/windows.media.faceanalysis.idl | 64 ++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 include/windows.media.faceanalysis.idl
diff --git a/include/windows.graphics.imaging.idl b/include/windows.graphics.imaging.idl index 6c78663a473..4ca51490dcd 100644 --- a/include/windows.graphics.imaging.idl +++ b/include/windows.graphics.imaging.idl @@ -32,6 +32,7 @@ namespace Windows.Graphics.Imaging { typedef enum BitmapAlphaMode BitmapAlphaMode; typedef enum BitmapBufferAccessMode BitmapBufferAccessMode; typedef enum BitmapPixelFormat BitmapPixelFormat; + typedef struct BitmapBounds BitmapBounds; typedef struct BitmapPlaneDescription BitmapPlaneDescription;
interface IBitmapBuffer; @@ -50,6 +51,7 @@ namespace Windows.Graphics.Imaging { interface Windows.Foundation.Collections.IVectorView<Windows.Graphics.Imaging.BitmapPixelFormat>; interface Windows.Foundation.IAsyncOperation<Windows.Graphics.Imaging.SoftwareBitmap *>; interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Graphics.Imaging.SoftwareBitmap *>; + interface Windows.Foundation.IReference<Windows.Graphics.Imaging.BitmapBounds>; }
[contract(Windows.Foundation.UniversalApiContract, 1.0)] @@ -87,6 +89,15 @@ namespace Windows.Graphics.Imaging { Yuy2 = 107, };
+ [contract(Windows.Foundation.UniversalApiContract, 1.0)] + struct BitmapBounds + { + UINT32 X; + UINT32 Y; + UINT32 Width; + UINT32 Height; + }; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] struct BitmapPlaneDescription { diff --git a/include/windows.media.faceanalysis.idl b/include/windows.media.faceanalysis.idl new file mode 100644 index 00000000000..de5cf136ab9 --- /dev/null +++ b/include/windows.media.faceanalysis.idl @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Biswapriyo Nath + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; +import "windows.graphics.imaging.idl"; +import "windows.media.idl"; + +namespace Windows.Media.FaceAnalysis { + interface IDetectedFace; + + runtimeclass DetectedFace; + + declare { + interface Windows.Foundation.Collections.IIterable<Windows.Media.FaceAnalysis.DetectedFace *>; + interface Windows.Foundation.Collections.IIterator<Windows.Media.FaceAnalysis.DetectedFace *>; + interface Windows.Foundation.Collections.IVectorView<Windows.Media.FaceAnalysis.DetectedFace *>; + interface Windows.Foundation.Collections.IVector<Windows.Media.FaceAnalysis.DetectedFace *>; + interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVector<Windows.Media.FaceAnalysis.DetectedFace *> *>; + interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Foundation.Collections.IVector<Windows.Media.FaceAnalysis.DetectedFace *> *>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.FaceAnalysis.DetectedFace), + uuid(8200d454-66bc-34df-9410-e89400195414) + ] + interface IDetectedFace : IInspectable + { + [propget] HRESULT FaceBox([out, retval] Windows.Graphics.Imaging.BitmapBounds *return_value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass DetectedFace + { + [default] interface Windows.Media.FaceAnalysis.IDetectedFace; + } +}
From: Biswapriyo Nath nathbappai@gmail.com
--- include/windows.graphics.imaging.idl | 8 ++++ include/windows.media.faceanalysis.idl | 51 ++++++++++++++++++++++++++ 2 files changed, 59 insertions(+)
diff --git a/include/windows.graphics.imaging.idl b/include/windows.graphics.imaging.idl index 4ca51490dcd..5409481f043 100644 --- a/include/windows.graphics.imaging.idl +++ b/include/windows.graphics.imaging.idl @@ -34,6 +34,7 @@ namespace Windows.Graphics.Imaging { typedef enum BitmapPixelFormat BitmapPixelFormat; typedef struct BitmapBounds BitmapBounds; typedef struct BitmapPlaneDescription BitmapPlaneDescription; + typedef struct BitmapSize BitmapSize;
interface IBitmapBuffer; interface ISoftwareBitmap; @@ -107,6 +108,13 @@ namespace Windows.Graphics.Imaging { INT32 Stride; };
+ [contract(Windows.Foundation.UniversalApiContract, 1.0)] + struct BitmapSize + { + UINT32 Width; + UINT32 Height; + }; + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.Graphics.Imaging.BitmapBuffer), diff --git a/include/windows.media.faceanalysis.idl b/include/windows.media.faceanalysis.idl index de5cf136ab9..595d36186b6 100644 --- a/include/windows.media.faceanalysis.idl +++ b/include/windows.media.faceanalysis.idl @@ -30,14 +30,19 @@ import "windows.media.idl";
namespace Windows.Media.FaceAnalysis { interface IDetectedFace; + interface IFaceDetector; + interface IFaceDetectorStatics;
runtimeclass DetectedFace; + runtimeclass FaceDetector;
declare { interface Windows.Foundation.Collections.IIterable<Windows.Media.FaceAnalysis.DetectedFace *>; interface Windows.Foundation.Collections.IIterator<Windows.Media.FaceAnalysis.DetectedFace *>; interface Windows.Foundation.Collections.IVectorView<Windows.Media.FaceAnalysis.DetectedFace *>; interface Windows.Foundation.Collections.IVector<Windows.Media.FaceAnalysis.DetectedFace *>; + interface Windows.Foundation.IAsyncOperation<Windows.Media.FaceAnalysis.FaceDetector *>; + interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Media.FaceAnalysis.FaceDetector *>; interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVector<Windows.Media.FaceAnalysis.DetectedFace *> *>; interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Foundation.Collections.IVector<Windows.Media.FaceAnalysis.DetectedFace *> *>; } @@ -52,6 +57,41 @@ namespace Windows.Media.FaceAnalysis { [propget] HRESULT FaceBox([out, retval] Windows.Graphics.Imaging.BitmapBounds *return_value); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.FaceAnalysis.FaceDetector), + uuid(16b672dc-fe6f-3117-8d95-c3f04d51630c) + ] + interface IFaceDetector : IInspectable + { + [overload("DetectFacesAsync")] + HRESULT DetectFacesAsync( + [in] Windows.Graphics.Imaging.SoftwareBitmap *image, + [out, retval] Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVector<Windows.Media.FaceAnalysis.DetectedFace *> *> **return_value); + [overload("DetectFacesAsync")] + HRESULT DetectFacesWithSearchAreaAsync( + [in] Windows.Graphics.Imaging.SoftwareBitmap *image, + [in] Windows.Graphics.Imaging.BitmapBounds search_area, + [out, retval] Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVector<Windows.Media.FaceAnalysis.DetectedFace *> *> **return_value); + [propget] HRESULT MinDetectableFaceSize([out, retval] Windows.Graphics.Imaging.BitmapSize *return_value); + [propput] HRESULT MinDetectableFaceSize([in] Windows.Graphics.Imaging.BitmapSize value); + [propget] HRESULT MaxDetectableFaceSize([out, retval] Windows.Graphics.Imaging.BitmapSize *return_value); + [propput] HRESULT MaxDetectableFaceSize([in] Windows.Graphics.Imaging.BitmapSize value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.FaceAnalysis.FaceDetector), + uuid(bc042d67-9047-33f6-881b-6746c1b218b8) + ] + interface IFaceDetectorStatics : IInspectable + { + HRESULT CreateAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Media.FaceAnalysis.FaceDetector *> **return_value); + HRESULT GetSupportedBitmapPixelFormats([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Graphics.Imaging.BitmapPixelFormat> **result); + HRESULT IsBitmapPixelFormatSupported([in] Windows.Graphics.Imaging.BitmapPixelFormat bitmap_pixel_format, [out, retval] boolean *result); + [propget] HRESULT IsSupported([out, retval] boolean *return_value); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), marshaling_behavior(agile), @@ -61,4 +101,15 @@ namespace Windows.Media.FaceAnalysis { { [default] interface Windows.Media.FaceAnalysis.IDetectedFace; } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.Media.FaceAnalysis.IFaceDetectorStatics, Windows.Foundation.UniversalApiContract, 1.0), + threading(both) + ] + runtimeclass FaceDetector + { + [default] interface Windows.Media.FaceAnalysis.IFaceDetector; + } }
What is this needed for?
This merge request was approved by Rémi Bernon.