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")]
25extern_conformance!(
26    unsafe impl NSCoding for VNDetectedPoint {}
27);
28
29#[cfg(feature = "VNGeometry")]
30extern_conformance!(
31    unsafe impl NSCopying for VNDetectedPoint {}
32);
33
34#[cfg(feature = "VNGeometry")]
35unsafe impl CopyingHelper for VNDetectedPoint {
36    type Result = Self;
37}
38
39#[cfg(feature = "VNGeometry")]
40extern_conformance!(
41    unsafe impl NSObjectProtocol for VNDetectedPoint {}
42);
43
44#[cfg(feature = "VNGeometry")]
45extern_conformance!(
46    unsafe impl NSSecureCoding for VNDetectedPoint {}
47);
48
49#[cfg(feature = "VNGeometry")]
50impl VNDetectedPoint {
51    extern_methods!(
52        #[unsafe(method(new))]
53        #[unsafe(method_family = new)]
54        pub unsafe fn new() -> Retained<Self>;
55
56        #[unsafe(method(init))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
59
60        #[unsafe(method(initWithX:y:))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn initWithX_y(
63            this: Allocated<Self>,
64            x: c_double,
65            y: c_double,
66        ) -> Retained<Self>;
67
68        #[cfg(feature = "objc2-core-foundation")]
69        #[unsafe(method(initWithLocation:))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn initWithLocation(this: Allocated<Self>, location: CGPoint) -> Retained<Self>;
72
73        #[cfg(feature = "VNTypes")]
74        /// The confidence in the accuracy of the location, in the range of [0.0, 1.0].
75        #[unsafe(method(confidence))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn confidence(&self) -> VNConfidence;
78    );
79}
80
81extern_class!(
82    /// An extension of VNDetectedPoint that associates an identifier to the point.
83    ///
84    /// 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.
85    ///
86    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizedpoint?language=objc)
87    #[unsafe(super(VNDetectedPoint, VNPoint, NSObject))]
88    #[derive(Debug, PartialEq, Eq, Hash)]
89    #[cfg(feature = "VNGeometry")]
90    pub struct VNRecognizedPoint;
91);
92
93#[cfg(feature = "VNGeometry")]
94extern_conformance!(
95    unsafe impl NSCoding for VNRecognizedPoint {}
96);
97
98#[cfg(feature = "VNGeometry")]
99extern_conformance!(
100    unsafe impl NSCopying for VNRecognizedPoint {}
101);
102
103#[cfg(feature = "VNGeometry")]
104unsafe impl CopyingHelper for VNRecognizedPoint {
105    type Result = Self;
106}
107
108#[cfg(feature = "VNGeometry")]
109extern_conformance!(
110    unsafe impl NSObjectProtocol for VNRecognizedPoint {}
111);
112
113#[cfg(feature = "VNGeometry")]
114extern_conformance!(
115    unsafe impl NSSecureCoding for VNRecognizedPoint {}
116);
117
118#[cfg(feature = "VNGeometry")]
119impl VNRecognizedPoint {
120    extern_methods!(
121        #[cfg(feature = "VNTypes")]
122        /// The is the identifier that provides context as to the kind of point that was recognized.
123        ///
124        /// 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.
125        #[unsafe(method(identifier))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn identifier(&self) -> Retained<VNRecognizedPointKey>;
128    );
129}
130
131/// Methods declared on superclass `VNDetectedPoint`.
132#[cfg(feature = "VNGeometry")]
133impl VNRecognizedPoint {
134    extern_methods!(
135        #[unsafe(method(new))]
136        #[unsafe(method_family = new)]
137        pub unsafe fn new() -> Retained<Self>;
138
139        #[unsafe(method(init))]
140        #[unsafe(method_family = init)]
141        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
142
143        #[unsafe(method(initWithX:y:))]
144        #[unsafe(method_family = init)]
145        pub unsafe fn initWithX_y(
146            this: Allocated<Self>,
147            x: c_double,
148            y: c_double,
149        ) -> Retained<Self>;
150
151        #[cfg(feature = "objc2-core-foundation")]
152        #[unsafe(method(initWithLocation:))]
153        #[unsafe(method_family = init)]
154        pub unsafe fn initWithLocation(this: Allocated<Self>, location: CGPoint) -> Retained<Self>;
155    );
156}