objc2_vision/generated/
VNDetectedPoint.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// VNDetectedPoint is a VNPoint with a confidence value.
14    ///
15    /// 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.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectedpoint?language=objc)
18    #[unsafe(super(VNPoint, NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(feature = "VNGeometry")]
21    pub struct VNDetectedPoint;
22);
23
24#[cfg(feature = "VNGeometry")]
25unsafe impl NSCoding for VNDetectedPoint {}
26
27#[cfg(feature = "VNGeometry")]
28unsafe impl NSCopying for VNDetectedPoint {}
29
30#[cfg(feature = "VNGeometry")]
31unsafe impl CopyingHelper for VNDetectedPoint {
32    type Result = Self;
33}
34
35#[cfg(feature = "VNGeometry")]
36unsafe impl NSObjectProtocol for VNDetectedPoint {}
37
38#[cfg(feature = "VNGeometry")]
39unsafe impl NSSecureCoding for VNDetectedPoint {}
40
41#[cfg(feature = "VNGeometry")]
42impl VNDetectedPoint {
43    extern_methods!(
44        #[unsafe(method(new))]
45        #[unsafe(method_family = new)]
46        pub unsafe fn new() -> Retained<Self>;
47
48        #[unsafe(method(init))]
49        #[unsafe(method_family = init)]
50        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
51
52        #[unsafe(method(initWithX:y:))]
53        #[unsafe(method_family = init)]
54        pub unsafe fn initWithX_y(
55            this: Allocated<Self>,
56            x: c_double,
57            y: c_double,
58        ) -> Retained<Self>;
59
60        #[cfg(feature = "objc2-core-foundation")]
61        #[unsafe(method(initWithLocation:))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn initWithLocation(this: Allocated<Self>, location: CGPoint) -> Retained<Self>;
64
65        #[cfg(feature = "VNTypes")]
66        /// The confidence in the accuracy of the location, in the range of [0.0, 1.0].
67        #[unsafe(method(confidence))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn confidence(&self) -> VNConfidence;
70    );
71}
72
73extern_class!(
74    /// An extension of VNDetectedPoint that associates an identifier to the point.
75    ///
76    /// 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.
77    ///
78    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedpoint?language=objc)
79    #[unsafe(super(VNDetectedPoint, VNPoint, NSObject))]
80    #[derive(Debug, PartialEq, Eq, Hash)]
81    #[cfg(feature = "VNGeometry")]
82    pub struct VNRecognizedPoint;
83);
84
85#[cfg(feature = "VNGeometry")]
86unsafe impl NSCoding for VNRecognizedPoint {}
87
88#[cfg(feature = "VNGeometry")]
89unsafe impl NSCopying for VNRecognizedPoint {}
90
91#[cfg(feature = "VNGeometry")]
92unsafe impl CopyingHelper for VNRecognizedPoint {
93    type Result = Self;
94}
95
96#[cfg(feature = "VNGeometry")]
97unsafe impl NSObjectProtocol for VNRecognizedPoint {}
98
99#[cfg(feature = "VNGeometry")]
100unsafe impl NSSecureCoding for VNRecognizedPoint {}
101
102#[cfg(feature = "VNGeometry")]
103impl VNRecognizedPoint {
104    extern_methods!(
105        #[cfg(feature = "VNTypes")]
106        /// The is the identifier that provides context as to the kind of point that was recognized.
107        ///
108        /// 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.
109        #[unsafe(method(identifier))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn identifier(&self) -> Retained<VNRecognizedPointKey>;
112    );
113}
114
115/// Methods declared on superclass `VNDetectedPoint`.
116#[cfg(feature = "VNGeometry")]
117impl VNRecognizedPoint {
118    extern_methods!(
119        #[unsafe(method(new))]
120        #[unsafe(method_family = new)]
121        pub unsafe fn new() -> Retained<Self>;
122
123        #[unsafe(method(init))]
124        #[unsafe(method_family = init)]
125        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
126
127        #[unsafe(method(initWithX:y:))]
128        #[unsafe(method_family = init)]
129        pub unsafe fn initWithX_y(
130            this: Allocated<Self>,
131            x: c_double,
132            y: c_double,
133        ) -> Retained<Self>;
134
135        #[cfg(feature = "objc2-core-foundation")]
136        #[unsafe(method(initWithLocation:))]
137        #[unsafe(method_family = init)]
138        pub unsafe fn initWithLocation(this: Allocated<Self>, location: CGPoint) -> Retained<Self>;
139    );
140}