#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct DetectedFace(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(DetectedFace, windows_core::IUnknown, windows_core::IInspectable);
impl DetectedFace {
#[cfg(feature = "Graphics_Imaging")]
pub fn FaceBox(&self) -> windows_core::Result<super::super::Graphics::Imaging::BitmapBounds> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).FaceBox)(windows_core::Interface::as_raw(this), &mut result__).map(|| result__)
}
}
}
impl windows_core::RuntimeType for DetectedFace {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::for_class::<Self, IDetectedFace>();
}
unsafe impl windows_core::Interface for DetectedFace {
type Vtable = <IDetectedFace as windows_core::Interface>::Vtable;
const IID: windows_core::GUID = <IDetectedFace as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for DetectedFace {
const NAME: &'static str = "Windows.Media.FaceAnalysis.DetectedFace";
}
unsafe impl Send for DetectedFace {}
unsafe impl Sync for DetectedFace {}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FaceDetector(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(FaceDetector, windows_core::IUnknown, windows_core::IInspectable);
impl FaceDetector {
#[cfg(feature = "Graphics_Imaging")]
pub fn DetectFacesAsync<P0>(&self, image: P0) -> windows_core::Result<windows_future::IAsyncOperation<windows_collections::IVector<DetectedFace>>>
where
P0: windows_core::Param<super::super::Graphics::Imaging::SoftwareBitmap>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).DetectFacesAsync)(windows_core::Interface::as_raw(this), image.param().abi(), &mut result__).and_then(|| windows_core::Type::from_abi(result__))
}
}
#[cfg(feature = "Graphics_Imaging")]
pub fn DetectFacesWithSearchAreaAsync<P0>(&self, image: P0, searcharea: super::super::Graphics::Imaging::BitmapBounds) -> windows_core::Result<windows_future::IAsyncOperation<windows_collections::IVector<DetectedFace>>>
where
P0: windows_core::Param<super::super::Graphics::Imaging::SoftwareBitmap>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).DetectFacesWithSearchAreaAsync)(windows_core::Interface::as_raw(this), image.param().abi(), searcharea, &mut result__).and_then(|| windows_core::Type::from_abi(result__))
}
}
#[cfg(feature = "Graphics_Imaging")]
pub fn MinDetectableFaceSize(&self) -> windows_core::Result<super::super::Graphics::Imaging::BitmapSize> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).MinDetectableFaceSize)(windows_core::Interface::as_raw(this), &mut result__).map(|| result__)
}
}
#[cfg(feature = "Graphics_Imaging")]
pub fn SetMinDetectableFaceSize(&self, value: super::super::Graphics::Imaging::BitmapSize) -> windows_core::Result<()> {
let this = self;
unsafe { (windows_core::Interface::vtable(this).SetMinDetectableFaceSize)(windows_core::Interface::as_raw(this), value).ok() }
}
#[cfg(feature = "Graphics_Imaging")]
pub fn MaxDetectableFaceSize(&self) -> windows_core::Result<super::super::Graphics::Imaging::BitmapSize> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).MaxDetectableFaceSize)(windows_core::Interface::as_raw(this), &mut result__).map(|| result__)
}
}
#[cfg(feature = "Graphics_Imaging")]
pub fn SetMaxDetectableFaceSize(&self, value: super::super::Graphics::Imaging::BitmapSize) -> windows_core::Result<()> {
let this = self;
unsafe { (windows_core::Interface::vtable(this).SetMaxDetectableFaceSize)(windows_core::Interface::as_raw(this), value).ok() }
}
pub fn CreateAsync() -> windows_core::Result<windows_future::IAsyncOperation<FaceDetector>> {
Self::IFaceDetectorStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateAsync)(windows_core::Interface::as_raw(this), &mut result__).and_then(|| windows_core::Type::from_abi(result__))
})
}
#[cfg(feature = "Graphics_Imaging")]
pub fn GetSupportedBitmapPixelFormats() -> windows_core::Result<windows_collections::IVectorView<super::super::Graphics::Imaging::BitmapPixelFormat>> {
Self::IFaceDetectorStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetSupportedBitmapPixelFormats)(windows_core::Interface::as_raw(this), &mut result__).and_then(|| windows_core::Type::from_abi(result__))
})
}
#[cfg(feature = "Graphics_Imaging")]
pub fn IsBitmapPixelFormatSupported(bitmappixelformat: super::super::Graphics::Imaging::BitmapPixelFormat) -> windows_core::Result<bool> {
Self::IFaceDetectorStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsBitmapPixelFormatSupported)(windows_core::Interface::as_raw(this), bitmappixelformat, &mut result__).map(|| result__)
})
}
pub fn IsSupported() -> windows_core::Result<bool> {
Self::IFaceDetectorStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsSupported)(windows_core::Interface::as_raw(this), &mut result__).map(|| result__)
})
}
fn IFaceDetectorStatics<R, F: FnOnce(&IFaceDetectorStatics) -> windows_core::Result<R>>(callback: F) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<FaceDetector, IFaceDetectorStatics> = windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl windows_core::RuntimeType for FaceDetector {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::for_class::<Self, IFaceDetector>();
}
unsafe impl windows_core::Interface for FaceDetector {
type Vtable = <IFaceDetector as windows_core::Interface>::Vtable;
const IID: windows_core::GUID = <IFaceDetector as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for FaceDetector {
const NAME: &'static str = "Windows.Media.FaceAnalysis.FaceDetector";
}
unsafe impl Send for FaceDetector {}
unsafe impl Sync for FaceDetector {}
#[repr(transparent)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FaceTracker(windows_core::IUnknown);
windows_core::imp::interface_hierarchy!(FaceTracker, windows_core::IUnknown, windows_core::IInspectable);
impl FaceTracker {
pub fn ProcessNextFrameAsync<P0>(&self, videoframe: P0) -> windows_core::Result<windows_future::IAsyncOperation<windows_collections::IVector<DetectedFace>>>
where
P0: windows_core::Param<super::VideoFrame>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ProcessNextFrameAsync)(windows_core::Interface::as_raw(this), videoframe.param().abi(), &mut result__).and_then(|| windows_core::Type::from_abi(result__))
}
}
#[cfg(feature = "Graphics_Imaging")]
pub fn MinDetectableFaceSize(&self) -> windows_core::Result<super::super::Graphics::Imaging::BitmapSize> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).MinDetectableFaceSize)(windows_core::Interface::as_raw(this), &mut result__).map(|| result__)
}
}
#[cfg(feature = "Graphics_Imaging")]
pub fn SetMinDetectableFaceSize(&self, value: super::super::Graphics::Imaging::BitmapSize) -> windows_core::Result<()> {
let this = self;
unsafe { (windows_core::Interface::vtable(this).SetMinDetectableFaceSize)(windows_core::Interface::as_raw(this), value).ok() }
}
#[cfg(feature = "Graphics_Imaging")]
pub fn MaxDetectableFaceSize(&self) -> windows_core::Result<super::super::Graphics::Imaging::BitmapSize> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).MaxDetectableFaceSize)(windows_core::Interface::as_raw(this), &mut result__).map(|| result__)
}
}
#[cfg(feature = "Graphics_Imaging")]
pub fn SetMaxDetectableFaceSize(&self, value: super::super::Graphics::Imaging::BitmapSize) -> windows_core::Result<()> {
let this = self;
unsafe { (windows_core::Interface::vtable(this).SetMaxDetectableFaceSize)(windows_core::Interface::as_raw(this), value).ok() }
}
pub fn CreateAsync() -> windows_core::Result<windows_future::IAsyncOperation<FaceTracker>> {
Self::IFaceTrackerStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateAsync)(windows_core::Interface::as_raw(this), &mut result__).and_then(|| windows_core::Type::from_abi(result__))
})
}
#[cfg(feature = "Graphics_Imaging")]
pub fn GetSupportedBitmapPixelFormats() -> windows_core::Result<windows_collections::IVectorView<super::super::Graphics::Imaging::BitmapPixelFormat>> {
Self::IFaceTrackerStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetSupportedBitmapPixelFormats)(windows_core::Interface::as_raw(this), &mut result__).and_then(|| windows_core::Type::from_abi(result__))
})
}
#[cfg(feature = "Graphics_Imaging")]
pub fn IsBitmapPixelFormatSupported(bitmappixelformat: super::super::Graphics::Imaging::BitmapPixelFormat) -> windows_core::Result<bool> {
Self::IFaceTrackerStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsBitmapPixelFormatSupported)(windows_core::Interface::as_raw(this), bitmappixelformat, &mut result__).map(|| result__)
})
}
pub fn IsSupported() -> windows_core::Result<bool> {
Self::IFaceTrackerStatics(|this| unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsSupported)(windows_core::Interface::as_raw(this), &mut result__).map(|| result__)
})
}
fn IFaceTrackerStatics<R, F: FnOnce(&IFaceTrackerStatics) -> windows_core::Result<R>>(callback: F) -> windows_core::Result<R> {
static SHARED: windows_core::imp::FactoryCache<FaceTracker, IFaceTrackerStatics> = windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl windows_core::RuntimeType for FaceTracker {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::for_class::<Self, IFaceTracker>();
}
unsafe impl windows_core::Interface for FaceTracker {
type Vtable = <IFaceTracker as windows_core::Interface>::Vtable;
const IID: windows_core::GUID = <IFaceTracker as windows_core::Interface>::IID;
}
impl windows_core::RuntimeName for FaceTracker {
const NAME: &'static str = "Windows.Media.FaceAnalysis.FaceTracker";
}
unsafe impl Send for FaceTracker {}
unsafe impl Sync for FaceTracker {}
windows_core::imp::define_interface!(IDetectedFace, IDetectedFace_Vtbl, 0x8200d454_66bc_34df_9410_e89400195414);
impl windows_core::RuntimeType for IDetectedFace {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IDetectedFace_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
#[cfg(feature = "Graphics_Imaging")]
pub FaceBox: unsafe extern "system" fn(*mut core::ffi::c_void, *mut super::super::Graphics::Imaging::BitmapBounds) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
FaceBox: usize,
}
windows_core::imp::define_interface!(IFaceDetector, IFaceDetector_Vtbl, 0x16b672dc_fe6f_3117_8d95_c3f04d51630c);
impl windows_core::RuntimeType for IFaceDetector {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IFaceDetector_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
#[cfg(feature = "Graphics_Imaging")]
pub DetectFacesAsync: unsafe extern "system" fn(*mut core::ffi::c_void, *mut core::ffi::c_void, *mut *mut core::ffi::c_void) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
DetectFacesAsync: usize,
#[cfg(feature = "Graphics_Imaging")]
pub DetectFacesWithSearchAreaAsync: unsafe extern "system" fn(*mut core::ffi::c_void, *mut core::ffi::c_void, super::super::Graphics::Imaging::BitmapBounds, *mut *mut core::ffi::c_void) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
DetectFacesWithSearchAreaAsync: usize,
#[cfg(feature = "Graphics_Imaging")]
pub MinDetectableFaceSize: unsafe extern "system" fn(*mut core::ffi::c_void, *mut super::super::Graphics::Imaging::BitmapSize) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
MinDetectableFaceSize: usize,
#[cfg(feature = "Graphics_Imaging")]
pub SetMinDetectableFaceSize: unsafe extern "system" fn(*mut core::ffi::c_void, super::super::Graphics::Imaging::BitmapSize) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
SetMinDetectableFaceSize: usize,
#[cfg(feature = "Graphics_Imaging")]
pub MaxDetectableFaceSize: unsafe extern "system" fn(*mut core::ffi::c_void, *mut super::super::Graphics::Imaging::BitmapSize) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
MaxDetectableFaceSize: usize,
#[cfg(feature = "Graphics_Imaging")]
pub SetMaxDetectableFaceSize: unsafe extern "system" fn(*mut core::ffi::c_void, super::super::Graphics::Imaging::BitmapSize) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
SetMaxDetectableFaceSize: usize,
}
windows_core::imp::define_interface!(IFaceDetectorStatics, IFaceDetectorStatics_Vtbl, 0xbc042d67_9047_33f6_881b_6746c1b218b8);
impl windows_core::RuntimeType for IFaceDetectorStatics {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IFaceDetectorStatics_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub CreateAsync: unsafe extern "system" fn(*mut core::ffi::c_void, *mut *mut core::ffi::c_void) -> windows_core::HRESULT,
#[cfg(feature = "Graphics_Imaging")]
pub GetSupportedBitmapPixelFormats: unsafe extern "system" fn(*mut core::ffi::c_void, *mut *mut core::ffi::c_void) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
GetSupportedBitmapPixelFormats: usize,
#[cfg(feature = "Graphics_Imaging")]
pub IsBitmapPixelFormatSupported: unsafe extern "system" fn(*mut core::ffi::c_void, super::super::Graphics::Imaging::BitmapPixelFormat, *mut bool) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
IsBitmapPixelFormatSupported: usize,
pub IsSupported: unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(IFaceTracker, IFaceTracker_Vtbl, 0x6ba67d8c_a841_4420_93e6_2420a1884fcf);
impl windows_core::RuntimeType for IFaceTracker {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IFaceTracker_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub ProcessNextFrameAsync: unsafe extern "system" fn(*mut core::ffi::c_void, *mut core::ffi::c_void, *mut *mut core::ffi::c_void) -> windows_core::HRESULT,
#[cfg(feature = "Graphics_Imaging")]
pub MinDetectableFaceSize: unsafe extern "system" fn(*mut core::ffi::c_void, *mut super::super::Graphics::Imaging::BitmapSize) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
MinDetectableFaceSize: usize,
#[cfg(feature = "Graphics_Imaging")]
pub SetMinDetectableFaceSize: unsafe extern "system" fn(*mut core::ffi::c_void, super::super::Graphics::Imaging::BitmapSize) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
SetMinDetectableFaceSize: usize,
#[cfg(feature = "Graphics_Imaging")]
pub MaxDetectableFaceSize: unsafe extern "system" fn(*mut core::ffi::c_void, *mut super::super::Graphics::Imaging::BitmapSize) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
MaxDetectableFaceSize: usize,
#[cfg(feature = "Graphics_Imaging")]
pub SetMaxDetectableFaceSize: unsafe extern "system" fn(*mut core::ffi::c_void, super::super::Graphics::Imaging::BitmapSize) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
SetMaxDetectableFaceSize: usize,
}
windows_core::imp::define_interface!(IFaceTrackerStatics, IFaceTrackerStatics_Vtbl, 0xe9629198_1801_3fa5_932e_31d767af6c4d);
impl windows_core::RuntimeType for IFaceTrackerStatics {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::for_interface::<Self>();
}
#[repr(C)]
#[doc(hidden)]
pub struct IFaceTrackerStatics_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub CreateAsync: unsafe extern "system" fn(*mut core::ffi::c_void, *mut *mut core::ffi::c_void) -> windows_core::HRESULT,
#[cfg(feature = "Graphics_Imaging")]
pub GetSupportedBitmapPixelFormats: unsafe extern "system" fn(*mut core::ffi::c_void, *mut *mut core::ffi::c_void) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
GetSupportedBitmapPixelFormats: usize,
#[cfg(feature = "Graphics_Imaging")]
pub IsBitmapPixelFormatSupported: unsafe extern "system" fn(*mut core::ffi::c_void, super::super::Graphics::Imaging::BitmapPixelFormat, *mut bool) -> windows_core::HRESULT,
#[cfg(not(feature = "Graphics_Imaging"))]
IsBitmapPixelFormatSupported: usize,
pub IsSupported: unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
}