objc2-vision 0.3.2

Bindings to the Vision framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// VNFaceLandmarkRegion is an immutable object acting as a collection of landmark points for defining a specific region of the face (including potentially all of the landmark points for a face). The VNFaceLandmarkRegion is an abstract base class.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarkregion?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct VNFaceLandmarkRegion;
);

extern_conformance!(
    unsafe impl NSCoding for VNFaceLandmarkRegion {}
);

extern_conformance!(
    unsafe impl NSCopying for VNFaceLandmarkRegion {}
);

unsafe impl CopyingHelper for VNFaceLandmarkRegion {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for VNFaceLandmarkRegion {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for VNFaceLandmarkRegion {}
);

#[cfg(feature = "VNRequestRevisionProviding")]
extern_conformance!(
    unsafe impl VNRequestRevisionProviding for VNFaceLandmarkRegion {}
);

impl VNFaceLandmarkRegion {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// pointCount returns the amount of points in a given region. This can be zero if no points for a region could be found.
        #[unsafe(method(pointCount))]
        #[unsafe(method_family = none)]
        pub unsafe fn pointCount(&self) -> NSUInteger;
    );
}

extern_class!(
    /// VNFaceLandmarkRegion2D gives access to the 2D landmark points for the region. The points are stored as vector_float2 and must not be modified.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarkregion2d?language=objc)
    #[unsafe(super(VNFaceLandmarkRegion, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct VNFaceLandmarkRegion2D;
);

extern_conformance!(
    unsafe impl NSCoding for VNFaceLandmarkRegion2D {}
);

extern_conformance!(
    unsafe impl NSCopying for VNFaceLandmarkRegion2D {}
);

unsafe impl CopyingHelper for VNFaceLandmarkRegion2D {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for VNFaceLandmarkRegion2D {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for VNFaceLandmarkRegion2D {}
);

#[cfg(feature = "VNRequestRevisionProviding")]
extern_conformance!(
    unsafe impl VNRequestRevisionProviding for VNFaceLandmarkRegion2D {}
);

impl VNFaceLandmarkRegion2D {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        /// Obtains the array of normalized landmark points.
        ///
        ///
        /// Provides the address of a buffer containing the array of CGPoints representing the landmark points.  This buffer is owned by the target object and is guaranteed to exist as long as the VNFaceLandmarkRegion2D does.
        ///
        ///
        /// Returns: the address of the array of pointCount points.
        ///
        /// # Safety
        ///
        /// You must ensure this is still alive.
        #[unsafe(method(normalizedPoints))]
        #[unsafe(method_family = none)]
        pub unsafe fn normalizedPoints(&self) -> *const CGPoint;

        #[cfg(feature = "objc2-core-foundation")]
        /// Provides the array of landmark points in the coordinate space of a specific image size.
        ///
        ///
        /// Provides the address of a buffer containing the array of CGPoints representing the landmark points in the coordinate space of a specific image size.  This buffer is owned by the target object and is guaranteed to exist as long as the VNFaceLandmarkRegion2D does.
        ///
        ///
        /// Parameter `imageSize`: The pixel dimensions of the image in which the landmark points are being presented.
        ///
        ///
        /// Returns: the address of the array of pointCount points, or NULL if the conversion could not take place.
        #[unsafe(method(pointsInImageOfSize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn pointsInImageOfSize(&self, image_size: CGSize) -> NonNull<CGPoint>;

        /// Obtains the array of accuracy placement estimates per landmark point.
        ///
        ///
        /// Provides the NSArray object containing landmarks accuracy placement estimates per landmark point. This property is only
        /// populated when VNDetectFaceLandmarksRequest object is configured with VNRequestFaceLandmarksConstellation76Points. It is
        /// set to nil for other constellations
        ///
        ///
        /// Returns: NSArray object of NSNumber(s) initialized to floating point values.
        #[unsafe(method(precisionEstimatesPerPoint))]
        #[unsafe(method_family = none)]
        pub unsafe fn precisionEstimatesPerPoint(&self) -> Option<Retained<NSArray<NSNumber>>>;

        #[cfg(feature = "VNTypes")]
        /// Describes how to interpret the points provided by the region.
        #[unsafe(method(pointsClassification))]
        #[unsafe(method_family = none)]
        pub unsafe fn pointsClassification(&self) -> VNPointsClassification;
    );
}

/// Methods declared on superclass `VNFaceLandmarkRegion`.
impl VNFaceLandmarkRegion2D {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

extern_class!(
    /// VNFaceLandmarks2D is the result of a face landmarks request. It is an abstract base class.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarks?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct VNFaceLandmarks;
);

extern_conformance!(
    unsafe impl NSCoding for VNFaceLandmarks {}
);

extern_conformance!(
    unsafe impl NSCopying for VNFaceLandmarks {}
);

unsafe impl CopyingHelper for VNFaceLandmarks {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for VNFaceLandmarks {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for VNFaceLandmarks {}
);

#[cfg(feature = "VNRequestRevisionProviding")]
extern_conformance!(
    unsafe impl VNRequestRevisionProviding for VNFaceLandmarks {}
);

impl VNFaceLandmarks {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "VNTypes")]
        /// a confidence estimate for the returned landmarks.
        #[unsafe(method(confidence))]
        #[unsafe(method_family = none)]
        pub unsafe fn confidence(&self) -> VNConfidence;
    );
}

/// Methods declared on superclass `NSObject`.
impl VNFaceLandmarks {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// VNFaceLandmarks2D is the result of a face landmarks 2D request, containing detected facial landmark points organized into VNFaceLandmarkRegion2D regions. The points are accessible as a full list, or as sub-gruops representing pre-defined facial regions.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnfacelandmarks2d?language=objc)
    #[unsafe(super(VNFaceLandmarks, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct VNFaceLandmarks2D;
);

extern_conformance!(
    unsafe impl NSCoding for VNFaceLandmarks2D {}
);

extern_conformance!(
    unsafe impl NSCopying for VNFaceLandmarks2D {}
);

unsafe impl CopyingHelper for VNFaceLandmarks2D {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for VNFaceLandmarks2D {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for VNFaceLandmarks2D {}
);

#[cfg(feature = "VNRequestRevisionProviding")]
extern_conformance!(
    unsafe impl VNRequestRevisionProviding for VNFaceLandmarks2D {}
);

impl VNFaceLandmarks2D {
    extern_methods!(
        /// allPoints the region containing all face landmark points.
        #[unsafe(method(allPoints))]
        #[unsafe(method_family = none)]
        pub unsafe fn allPoints(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// faceContour the region containing the points that describe the face contour from cheek over chin to cheek.
        #[unsafe(method(faceContour))]
        #[unsafe(method_family = none)]
        pub unsafe fn faceContour(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// leftEye the region containing the points describing the outline of the left eye.
        #[unsafe(method(leftEye))]
        #[unsafe(method_family = none)]
        pub unsafe fn leftEye(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// rightEye the region containing the points describing the outline of the right eye.
        #[unsafe(method(rightEye))]
        #[unsafe(method_family = none)]
        pub unsafe fn rightEye(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// leftEyebrow the region containing the points describing the trace of the left eyebrow.
        #[unsafe(method(leftEyebrow))]
        #[unsafe(method_family = none)]
        pub unsafe fn leftEyebrow(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// rightEyebrow the region containing the points describing the trace of the right eyebrow.
        #[unsafe(method(rightEyebrow))]
        #[unsafe(method_family = none)]
        pub unsafe fn rightEyebrow(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// nose the region containing the points describing the outline of the nose.
        #[unsafe(method(nose))]
        #[unsafe(method_family = none)]
        pub unsafe fn nose(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// noseCrest the region containing the points describing the trace of the center crest of the nose.
        #[unsafe(method(noseCrest))]
        #[unsafe(method_family = none)]
        pub unsafe fn noseCrest(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// medianLine the region containing the points describing the trace of the center line of the face.
        #[unsafe(method(medianLine))]
        #[unsafe(method_family = none)]
        pub unsafe fn medianLine(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// outer lips the region containing the points describing the outline of the outside of the lips.
        #[unsafe(method(outerLips))]
        #[unsafe(method_family = none)]
        pub unsafe fn outerLips(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// innerLips the region containing the points describing the outline of the space between the of the lips.
        #[unsafe(method(innerLips))]
        #[unsafe(method_family = none)]
        pub unsafe fn innerLips(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// leftPupil the region containing the point where the left pupil is located.  This value may be inaccurate if
        /// the face isBlinking.
        #[unsafe(method(leftPupil))]
        #[unsafe(method_family = none)]
        pub unsafe fn leftPupil(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;

        /// rightPupil the region containing the point where the right pupil is located.  This value may be inaccurate if
        /// the face isBlinking.
        #[unsafe(method(rightPupil))]
        #[unsafe(method_family = none)]
        pub unsafe fn rightPupil(&self) -> Option<Retained<VNFaceLandmarkRegion2D>>;
    );
}

/// Methods declared on superclass `VNFaceLandmarks`.
impl VNFaceLandmarks2D {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl VNFaceLandmarks2D {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}