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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// VNDetectedPoint is a VNPoint with a confidence value.
    ///
    /// It should be noted that VNDetectedPoint is not intended as an overall replacement of CGPoint, NSPoint or vec2, but is used by observations that detect points of interest.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectedpoint?language=objc)
    #[unsafe(super(VNPoint, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "VNGeometry")]
    pub struct VNDetectedPoint;
);

#[cfg(feature = "VNGeometry")]
extern_conformance!(
    unsafe impl NSCoding for VNDetectedPoint {}
);

#[cfg(feature = "VNGeometry")]
extern_conformance!(
    unsafe impl NSCopying for VNDetectedPoint {}
);

#[cfg(feature = "VNGeometry")]
unsafe impl CopyingHelper for VNDetectedPoint {
    type Result = Self;
}

#[cfg(feature = "VNGeometry")]
extern_conformance!(
    unsafe impl NSObjectProtocol for VNDetectedPoint {}
);

#[cfg(feature = "VNGeometry")]
extern_conformance!(
    unsafe impl NSSecureCoding for VNDetectedPoint {}
);

#[cfg(feature = "VNGeometry")]
impl VNDetectedPoint {
    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>;

        #[unsafe(method(initWithX:y:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithX_y(
            this: Allocated<Self>,
            x: c_double,
            y: c_double,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(initWithLocation:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLocation(this: Allocated<Self>, location: CGPoint) -> Retained<Self>;

        #[cfg(feature = "VNTypes")]
        /// The confidence in the accuracy of the location, in the range of [0.0, 1.0].
        #[unsafe(method(confidence))]
        #[unsafe(method_family = none)]
        pub unsafe fn confidence(&self) -> VNConfidence;
    );
}

extern_class!(
    /// An extension of VNDetectedPoint that associates an identifier to the point.
    ///
    /// It should be noted that VNRecognizedPoint is not intended as an overall replacement of CGPoint, NSPoint or vec2, but is used by observations that recognize labeled points of interest.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedpoint?language=objc)
    #[unsafe(super(VNDetectedPoint, VNPoint, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "VNGeometry")]
    pub struct VNRecognizedPoint;
);

#[cfg(feature = "VNGeometry")]
extern_conformance!(
    unsafe impl NSCoding for VNRecognizedPoint {}
);

#[cfg(feature = "VNGeometry")]
extern_conformance!(
    unsafe impl NSCopying for VNRecognizedPoint {}
);

#[cfg(feature = "VNGeometry")]
unsafe impl CopyingHelper for VNRecognizedPoint {
    type Result = Self;
}

#[cfg(feature = "VNGeometry")]
extern_conformance!(
    unsafe impl NSObjectProtocol for VNRecognizedPoint {}
);

#[cfg(feature = "VNGeometry")]
extern_conformance!(
    unsafe impl NSSecureCoding for VNRecognizedPoint {}
);

#[cfg(feature = "VNGeometry")]
impl VNRecognizedPoint {
    extern_methods!(
        #[cfg(feature = "VNTypes")]
        /// The is the identifier that provides context as to the kind of point that was recognized.
        ///
        /// The string is defined by the model that recognized the point. Usually these are technical labels that are not localized and not meant to be used directly to be presented to an end user in the UI.
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Retained<VNRecognizedPointKey>;
    );
}

/// Methods declared on superclass `VNDetectedPoint`.
#[cfg(feature = "VNGeometry")]
impl VNRecognizedPoint {
    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>;

        #[unsafe(method(initWithX:y:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithX_y(
            this: Allocated<Self>,
            x: c_double,
            y: c_double,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(initWithLocation:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLocation(this: Allocated<Self>, location: CGPoint) -> Retained<Self>;
    );
}