objc2_vision/generated/
VNDetectHumanHandPoseRequest.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointname?language=objc)
11// NS_TYPED_ENUM
12#[cfg(feature = "VNTypes")]
13pub type VNHumanHandPoseObservationJointName = VNRecognizedPointKey;
14
15extern "C" {
16    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamewrist?language=objc)
17    #[cfg(feature = "VNTypes")]
18    pub static VNHumanHandPoseObservationJointNameWrist:
19        &'static VNHumanHandPoseObservationJointName;
20}
21
22extern "C" {
23    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamethumbcmc?language=objc)
24    #[cfg(feature = "VNTypes")]
25    pub static VNHumanHandPoseObservationJointNameThumbCMC:
26        &'static VNHumanHandPoseObservationJointName;
27}
28
29extern "C" {
30    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamethumbmp?language=objc)
31    #[cfg(feature = "VNTypes")]
32    pub static VNHumanHandPoseObservationJointNameThumbMP:
33        &'static VNHumanHandPoseObservationJointName;
34}
35
36extern "C" {
37    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamethumbip?language=objc)
38    #[cfg(feature = "VNTypes")]
39    pub static VNHumanHandPoseObservationJointNameThumbIP:
40        &'static VNHumanHandPoseObservationJointName;
41}
42
43extern "C" {
44    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamethumbtip?language=objc)
45    #[cfg(feature = "VNTypes")]
46    pub static VNHumanHandPoseObservationJointNameThumbTip:
47        &'static VNHumanHandPoseObservationJointName;
48}
49
50extern "C" {
51    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnameindexmcp?language=objc)
52    #[cfg(feature = "VNTypes")]
53    pub static VNHumanHandPoseObservationJointNameIndexMCP:
54        &'static VNHumanHandPoseObservationJointName;
55}
56
57extern "C" {
58    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnameindexpip?language=objc)
59    #[cfg(feature = "VNTypes")]
60    pub static VNHumanHandPoseObservationJointNameIndexPIP:
61        &'static VNHumanHandPoseObservationJointName;
62}
63
64extern "C" {
65    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnameindexdip?language=objc)
66    #[cfg(feature = "VNTypes")]
67    pub static VNHumanHandPoseObservationJointNameIndexDIP:
68        &'static VNHumanHandPoseObservationJointName;
69}
70
71extern "C" {
72    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnameindextip?language=objc)
73    #[cfg(feature = "VNTypes")]
74    pub static VNHumanHandPoseObservationJointNameIndexTip:
75        &'static VNHumanHandPoseObservationJointName;
76}
77
78extern "C" {
79    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamemiddlemcp?language=objc)
80    #[cfg(feature = "VNTypes")]
81    pub static VNHumanHandPoseObservationJointNameMiddleMCP:
82        &'static VNHumanHandPoseObservationJointName;
83}
84
85extern "C" {
86    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamemiddlepip?language=objc)
87    #[cfg(feature = "VNTypes")]
88    pub static VNHumanHandPoseObservationJointNameMiddlePIP:
89        &'static VNHumanHandPoseObservationJointName;
90}
91
92extern "C" {
93    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamemiddledip?language=objc)
94    #[cfg(feature = "VNTypes")]
95    pub static VNHumanHandPoseObservationJointNameMiddleDIP:
96        &'static VNHumanHandPoseObservationJointName;
97}
98
99extern "C" {
100    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamemiddletip?language=objc)
101    #[cfg(feature = "VNTypes")]
102    pub static VNHumanHandPoseObservationJointNameMiddleTip:
103        &'static VNHumanHandPoseObservationJointName;
104}
105
106extern "C" {
107    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnameringmcp?language=objc)
108    #[cfg(feature = "VNTypes")]
109    pub static VNHumanHandPoseObservationJointNameRingMCP:
110        &'static VNHumanHandPoseObservationJointName;
111}
112
113extern "C" {
114    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnameringpip?language=objc)
115    #[cfg(feature = "VNTypes")]
116    pub static VNHumanHandPoseObservationJointNameRingPIP:
117        &'static VNHumanHandPoseObservationJointName;
118}
119
120extern "C" {
121    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnameringdip?language=objc)
122    #[cfg(feature = "VNTypes")]
123    pub static VNHumanHandPoseObservationJointNameRingDIP:
124        &'static VNHumanHandPoseObservationJointName;
125}
126
127extern "C" {
128    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnameringtip?language=objc)
129    #[cfg(feature = "VNTypes")]
130    pub static VNHumanHandPoseObservationJointNameRingTip:
131        &'static VNHumanHandPoseObservationJointName;
132}
133
134extern "C" {
135    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamelittlemcp?language=objc)
136    #[cfg(feature = "VNTypes")]
137    pub static VNHumanHandPoseObservationJointNameLittleMCP:
138        &'static VNHumanHandPoseObservationJointName;
139}
140
141extern "C" {
142    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamelittlepip?language=objc)
143    #[cfg(feature = "VNTypes")]
144    pub static VNHumanHandPoseObservationJointNameLittlePIP:
145        &'static VNHumanHandPoseObservationJointName;
146}
147
148extern "C" {
149    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamelittledip?language=objc)
150    #[cfg(feature = "VNTypes")]
151    pub static VNHumanHandPoseObservationJointNameLittleDIP:
152        &'static VNHumanHandPoseObservationJointName;
153}
154
155extern "C" {
156    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointnamelittletip?language=objc)
157    #[cfg(feature = "VNTypes")]
158    pub static VNHumanHandPoseObservationJointNameLittleTip:
159        &'static VNHumanHandPoseObservationJointName;
160}
161
162/// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointsgroupname?language=objc)
163// NS_TYPED_ENUM
164#[cfg(feature = "VNTypes")]
165pub type VNHumanHandPoseObservationJointsGroupName = VNRecognizedPointGroupKey;
166
167extern "C" {
168    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointsgroupnamethumb?language=objc)
169    #[cfg(feature = "VNTypes")]
170    pub static VNHumanHandPoseObservationJointsGroupNameThumb:
171        &'static VNHumanHandPoseObservationJointsGroupName;
172}
173
174extern "C" {
175    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointsgroupnameindexfinger?language=objc)
176    #[cfg(feature = "VNTypes")]
177    pub static VNHumanHandPoseObservationJointsGroupNameIndexFinger:
178        &'static VNHumanHandPoseObservationJointsGroupName;
179}
180
181extern "C" {
182    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointsgroupnamemiddlefinger?language=objc)
183    #[cfg(feature = "VNTypes")]
184    pub static VNHumanHandPoseObservationJointsGroupNameMiddleFinger:
185        &'static VNHumanHandPoseObservationJointsGroupName;
186}
187
188extern "C" {
189    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointsgroupnameringfinger?language=objc)
190    #[cfg(feature = "VNTypes")]
191    pub static VNHumanHandPoseObservationJointsGroupNameRingFinger:
192        &'static VNHumanHandPoseObservationJointsGroupName;
193}
194
195extern "C" {
196    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointsgroupnamelittlefinger?language=objc)
197    #[cfg(feature = "VNTypes")]
198    pub static VNHumanHandPoseObservationJointsGroupNameLittleFinger:
199        &'static VNHumanHandPoseObservationJointsGroupName;
200}
201
202extern "C" {
203    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservationjointsgroupnameall?language=objc)
204    #[cfg(feature = "VNTypes")]
205    pub static VNHumanHandPoseObservationJointsGroupNameAll:
206        &'static VNHumanHandPoseObservationJointsGroupName;
207}
208
209extern_class!(
210    /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnhumanhandposeobservation?language=objc)
211    #[unsafe(super(VNRecognizedPointsObservation, VNObservation, NSObject))]
212    #[derive(Debug, PartialEq, Eq, Hash)]
213    #[cfg(feature = "VNObservation")]
214    pub struct VNHumanHandPoseObservation;
215);
216
217#[cfg(feature = "VNObservation")]
218unsafe impl NSCoding for VNHumanHandPoseObservation {}
219
220#[cfg(feature = "VNObservation")]
221unsafe impl NSCopying for VNHumanHandPoseObservation {}
222
223#[cfg(feature = "VNObservation")]
224unsafe impl CopyingHelper for VNHumanHandPoseObservation {
225    type Result = Self;
226}
227
228#[cfg(feature = "VNObservation")]
229unsafe impl NSObjectProtocol for VNHumanHandPoseObservation {}
230
231#[cfg(feature = "VNObservation")]
232unsafe impl NSSecureCoding for VNHumanHandPoseObservation {}
233
234#[cfg(all(feature = "VNObservation", feature = "VNRequestRevisionProviding"))]
235unsafe impl VNRequestRevisionProviding for VNHumanHandPoseObservation {}
236
237#[cfg(feature = "VNObservation")]
238impl VNHumanHandPoseObservation {
239    extern_methods!(
240        #[cfg(feature = "VNTypes")]
241        /// All of the joint names available in the observation.
242        #[unsafe(method(availableJointNames))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn availableJointNames(
245            &self,
246        ) -> Retained<NSArray<VNHumanHandPoseObservationJointName>>;
247
248        #[cfg(feature = "VNTypes")]
249        /// All of the joints group names available in the observation.
250        #[unsafe(method(availableJointsGroupNames))]
251        #[unsafe(method_family = none)]
252        pub unsafe fn availableJointsGroupNames(
253            &self,
254        ) -> Retained<NSArray<VNHumanHandPoseObservationJointsGroupName>>;
255
256        #[cfg(all(
257            feature = "VNDetectedPoint",
258            feature = "VNGeometry",
259            feature = "VNTypes"
260        ))]
261        /// Obtain a specific normalized point for a named human hand joint.
262        ///
263        ///
264        /// Parameter `jointName`: The name of the human hand joint.
265        ///
266        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
267        ///
268        /// Returns: the recognized point, or nil if the point could not be obtained.
269        #[unsafe(method(recognizedPointForJointName:error:_))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn recognizedPointForJointName_error(
272            &self,
273            joint_name: &VNHumanHandPoseObservationJointName,
274        ) -> Result<Retained<VNRecognizedPoint>, Retained<NSError>>;
275
276        #[cfg(all(
277            feature = "VNDetectedPoint",
278            feature = "VNGeometry",
279            feature = "VNTypes"
280        ))]
281        /// Obtains the collection of points associated with a named human hand joints group.
282        ///
283        ///
284        /// The obtained collection is a dictionary that provides the mapping of human hand join names to the recognized point.
285        ///
286        ///
287        /// Parameter `jointsGroupName`: The name of the human hand joints group.
288        ///
289        /// Parameter `error`: The address of a variable that will be populated with the error that describes the failure.  If the caller does not require this information, NULL can be passed.
290        ///
291        /// Returns: a dictionary of recognized points in the group, or nil if an error was encountered.
292        #[unsafe(method(recognizedPointsForJointsGroupName:error:_))]
293        #[unsafe(method_family = none)]
294        pub unsafe fn recognizedPointsForJointsGroupName_error(
295            &self,
296            joints_group_name: &VNHumanHandPoseObservationJointsGroupName,
297        ) -> Result<
298            Retained<NSDictionary<VNHumanHandPoseObservationJointName, VNRecognizedPoint>>,
299            Retained<NSError>,
300        >;
301
302        #[cfg(feature = "VNTypes")]
303        /// The chirality of the hand.
304        #[unsafe(method(chirality))]
305        #[unsafe(method_family = none)]
306        pub unsafe fn chirality(&self) -> VNChirality;
307    );
308}
309
310/// Methods declared on superclass `VNRecognizedPointsObservation`.
311#[cfg(feature = "VNObservation")]
312impl VNHumanHandPoseObservation {
313    extern_methods!(
314        #[unsafe(method(new))]
315        #[unsafe(method_family = new)]
316        pub unsafe fn new() -> Retained<Self>;
317
318        #[unsafe(method(init))]
319        #[unsafe(method_family = init)]
320        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
321    );
322}
323
324extern_class!(
325    /// Detects specific landmark points on human hands.
326    ///
327    /// This request will produce a collection of VNRecognizedPointsObservation objects which describe the pose of each detected human hand.
328    ///
329    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthumanhandposerequest?language=objc)
330    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
331    #[derive(Debug, PartialEq, Eq, Hash)]
332    #[cfg(feature = "VNRequest")]
333    pub struct VNDetectHumanHandPoseRequest;
334);
335
336#[cfg(feature = "VNRequest")]
337unsafe impl NSCopying for VNDetectHumanHandPoseRequest {}
338
339#[cfg(feature = "VNRequest")]
340unsafe impl CopyingHelper for VNDetectHumanHandPoseRequest {
341    type Result = Self;
342}
343
344#[cfg(feature = "VNRequest")]
345unsafe impl NSObjectProtocol for VNDetectHumanHandPoseRequest {}
346
347#[cfg(feature = "VNRequest")]
348impl VNDetectHumanHandPoseRequest {
349    extern_methods!(
350        #[cfg(feature = "VNTypes")]
351        /// Obtain the collection of human hand joint names that are supported by a given request revision.
352        ///
353        /// Parameter `revision`: The revision of VNDetectHumanHandPoseRequest being queried.
354        ///
355        /// Parameter `error`: The address of a variable that will be populated with an error upon failure.  If the caller does not need this information, NULL can be passed.
356        ///
357        /// Returns: An array of VNHumanHandPoseObservationJointName symbols that are supported by the request revision, or nil if a failure occurs.
358        #[deprecated]
359        #[unsafe(method(supportedJointNamesForRevision:error:_))]
360        #[unsafe(method_family = none)]
361        pub unsafe fn supportedJointNamesForRevision_error(
362            revision: NSUInteger,
363        ) -> Result<Retained<NSArray<VNHumanHandPoseObservationJointName>>, Retained<NSError>>;
364
365        #[cfg(feature = "VNTypes")]
366        /// Obtain the collection of human hand joint names that are supported by a given request object configured with a specific revision.
367        ///
368        /// Parameter `error`: The address of a variable that will be populated with an error upon failure.  If the caller does not need this information, NULL can be passed.
369        ///
370        /// Returns: An array of VNHumanHandPoseObservationJointName symbols that are supported by the request revision, or nil if a failure occurs.
371        #[unsafe(method(supportedJointNamesAndReturnError:_))]
372        #[unsafe(method_family = none)]
373        pub unsafe fn supportedJointNamesAndReturnError(
374            &self,
375        ) -> Result<Retained<NSArray<VNHumanHandPoseObservationJointName>>, Retained<NSError>>;
376
377        #[cfg(feature = "VNTypes")]
378        /// Obtain the collection of human hand joints group names that are supported by a given request revision.
379        ///
380        /// Parameter `revision`: The revision of VNDetectHumanHandPoseRequest being queried.
381        ///
382        /// Parameter `error`: The address of a variable that will be populated with an error upon failure.  If the caller does not need this information, NULL can be passed.
383        ///
384        /// Returns: An array of VNHumanHandPoseObservationJointsGroupName symbols that are supported by the request revision, or nil if a failure occurs.
385        #[deprecated]
386        #[unsafe(method(supportedJointsGroupNamesForRevision:error:_))]
387        #[unsafe(method_family = none)]
388        pub unsafe fn supportedJointsGroupNamesForRevision_error(
389            revision: NSUInteger,
390        ) -> Result<Retained<NSArray<VNHumanHandPoseObservationJointsGroupName>>, Retained<NSError>>;
391
392        #[cfg(feature = "VNTypes")]
393        /// Obtain the collection of human hand joints group names that are supported by a given request object configured with a specific revision.
394        ///
395        /// Parameter `error`: The address of a variable that will be populated with an error upon failure.  If the caller does not need this information, NULL can be passed.
396        ///
397        /// Returns: An array of VNHumanHandPoseObservationJointsGroupName symbols that are supported by the request revision, or nil if a failure occurs.
398        #[unsafe(method(supportedJointsGroupNamesAndReturnError:_))]
399        #[unsafe(method_family = none)]
400        pub unsafe fn supportedJointsGroupNamesAndReturnError(
401            &self,
402        ) -> Result<Retained<NSArray<VNHumanHandPoseObservationJointsGroupName>>, Retained<NSError>>;
403
404        /// Defines an upper bounds to the maximum number of hands that will be processed for key points in an image.
405        ///
406        /// The complexity in key points determination is scalable by the number of hands to be processed.  All hands detected in an image will be ordered by relative size, with only the N largest ones having key points determined.  The default value for this property is 2. The maximum value for VNDetectHumanHandPoseRequestRevision1 is 6.
407        #[unsafe(method(maximumHandCount))]
408        #[unsafe(method_family = none)]
409        pub unsafe fn maximumHandCount(&self) -> NSUInteger;
410
411        /// Setter for [`maximumHandCount`][Self::maximumHandCount].
412        #[unsafe(method(setMaximumHandCount:))]
413        #[unsafe(method_family = none)]
414        pub unsafe fn setMaximumHandCount(&self, maximum_hand_count: NSUInteger);
415
416        #[cfg(feature = "VNObservation")]
417        /// VNHumanHandPoseObservation results.
418        #[unsafe(method(results))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNHumanHandPoseObservation>>>;
421    );
422}
423
424/// Methods declared on superclass `VNRequest`.
425#[cfg(feature = "VNRequest")]
426impl VNDetectHumanHandPoseRequest {
427    extern_methods!(
428        /// Creates a new VNRequest with no completion handler.
429        #[unsafe(method(init))]
430        #[unsafe(method_family = init)]
431        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
432
433        #[cfg(feature = "block2")]
434        /// Creates a new VNRequest with an optional completion handler.
435        ///
436        ///
437        /// Parameter `completionHandler`: The block to be invoked after the request has completed its processing. The completion handler gets executed on the same dispatch queue as the request being executed.
438        #[unsafe(method(initWithCompletionHandler:))]
439        #[unsafe(method_family = init)]
440        pub unsafe fn initWithCompletionHandler(
441            this: Allocated<Self>,
442            completion_handler: VNRequestCompletionHandler,
443        ) -> Retained<Self>;
444    );
445}
446
447/// Methods declared on superclass `NSObject`.
448#[cfg(feature = "VNRequest")]
449impl VNDetectHumanHandPoseRequest {
450    extern_methods!(
451        #[unsafe(method(new))]
452        #[unsafe(method_family = new)]
453        pub unsafe fn new() -> Retained<Self>;
454    );
455}
456
457/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetecthumanhandposerequestrevision1?language=objc)
458pub static VNDetectHumanHandPoseRequestRevision1: NSUInteger = 1;