objc2_ar_kit/generated/
ARSkeleton.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-vision")]
7use objc2_vision::*;
8
9use crate::*;
10
11#[cfg(feature = "objc2")]
12extern_class!(
13    /// An object representing a skeleton.
14    ///
15    /// A skeleton's structure is defined by a skeleton definition.
16    ///
17    /// See: ARSkeletonDefinition
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeleton?language=objc)
20    #[unsafe(super(NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    #[cfg(feature = "objc2")]
23    pub struct ARSkeleton;
24);
25
26#[cfg(feature = "objc2")]
27unsafe impl Send for ARSkeleton {}
28
29#[cfg(feature = "objc2")]
30unsafe impl Sync for ARSkeleton {}
31
32#[cfg(feature = "objc2")]
33extern_conformance!(
34    unsafe impl NSObjectProtocol for ARSkeleton {}
35);
36
37#[cfg(feature = "objc2")]
38impl ARSkeleton {
39    extern_methods!(
40        #[cfg(feature = "ARSkeletonDefinition")]
41        /// Skeleton definition.
42        #[unsafe(method(definition))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn definition(&self) -> Retained<ARSkeletonDefinition>;
45
46        /// The number of joints.
47        #[unsafe(method(jointCount))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn jointCount(&self) -> NSUInteger;
50
51        /// Tracking state for a given joint.
52        ///
53        ///
54        /// Parameter `jointIndex`: The index of the joint.
55        ///
56        /// Returns: True if the joint is tracked. False otherwise.
57        #[unsafe(method(isJointTracked:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn isJointTracked(&self, joint_index: NSInteger) -> bool;
60
61        /// Unavailable
62        #[unsafe(method(init))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
65
66        #[unsafe(method(new))]
67        #[unsafe(method_family = new)]
68        pub unsafe fn new() -> Retained<Self>;
69    );
70}
71
72#[cfg(feature = "objc2")]
73extern_class!(
74    /// An object representing a skeleton in 3D.
75    ///
76    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeleton3d?language=objc)
77    #[unsafe(super(ARSkeleton, NSObject))]
78    #[derive(Debug, PartialEq, Eq, Hash)]
79    #[cfg(feature = "objc2")]
80    pub struct ARSkeleton3D;
81);
82
83#[cfg(feature = "objc2")]
84unsafe impl Send for ARSkeleton3D {}
85
86#[cfg(feature = "objc2")]
87unsafe impl Sync for ARSkeleton3D {}
88
89#[cfg(feature = "objc2")]
90extern_conformance!(
91    unsafe impl NSObjectProtocol for ARSkeleton3D {}
92);
93
94#[cfg(feature = "objc2")]
95impl ARSkeleton3D {
96    extern_methods!(
97        /// Unavailable
98        #[unsafe(method(init))]
99        #[unsafe(method_family = init)]
100        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
101
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub unsafe fn new() -> Retained<Self>;
105    );
106}
107
108#[cfg(feature = "objc2")]
109extern_class!(
110    /// An object representing a skeleton in 2D.
111    ///
112    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeleton2d?language=objc)
113    #[unsafe(super(ARSkeleton, NSObject))]
114    #[derive(Debug, PartialEq, Eq, Hash)]
115    #[cfg(feature = "objc2")]
116    pub struct ARSkeleton2D;
117);
118
119#[cfg(feature = "objc2")]
120unsafe impl Send for ARSkeleton2D {}
121
122#[cfg(feature = "objc2")]
123unsafe impl Sync for ARSkeleton2D {}
124
125#[cfg(feature = "objc2")]
126extern_conformance!(
127    unsafe impl NSObjectProtocol for ARSkeleton2D {}
128);
129
130#[cfg(feature = "objc2")]
131impl ARSkeleton2D {
132    extern_methods!(
133        /// Unavailable
134        #[unsafe(method(init))]
135        #[unsafe(method_family = init)]
136        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
137
138        #[unsafe(method(new))]
139        #[unsafe(method_family = new)]
140        pub unsafe fn new() -> Retained<Self>;
141    );
142}
143
144#[cfg(feature = "objc2")]
145impl ARSkeleton {
146    /// Returns the landmark joint name that corresponds to a key point defined in Vision framework.
147    ///
148    /// See: VNRecognizedPointKey, VNDetectHumanBodyPoseRequest
149    ///
150    /// If an invalid key point is passed the returned point will be nil.
151    ///
152    ///
153    /// Parameter `recognizedPointKey`: Recognized key point.
154    ///
155    /// Returns: Joint name that could be mapped to a ARSkeleton2D. Nil if no mapping exists.
156    #[doc(alias = "ARSkeletonJointNameForRecognizedPointKey")]
157    #[cfg(all(
158        feature = "ARSkeletonDefinition",
159        feature = "objc2",
160        feature = "objc2-foundation",
161        feature = "objc2-vision"
162    ))]
163    #[inline]
164    pub unsafe fn joint_name_for_recognized_point_key(
165        recognized_point_key: &VNRecognizedPointKey,
166    ) -> Option<Retained<ARSkeletonJointName>> {
167        extern "C-unwind" {
168            fn ARSkeletonJointNameForRecognizedPointKey(
169                recognized_point_key: &VNRecognizedPointKey,
170            ) -> *mut ARSkeletonJointName;
171        }
172        let ret = unsafe { ARSkeletonJointNameForRecognizedPointKey(recognized_point_key) };
173        unsafe { Retained::retain_autoreleased(ret) }
174    }
175}
176
177#[cfg(all(
178    feature = "ARSkeletonDefinition",
179    feature = "objc2",
180    feature = "objc2-foundation",
181    feature = "objc2-vision"
182))]
183#[deprecated = "renamed to `ARSkeleton::joint_name_for_recognized_point_key`"]
184#[inline]
185pub unsafe extern "C-unwind" fn ARSkeletonJointNameForRecognizedPointKey(
186    recognized_point_key: &VNRecognizedPointKey,
187) -> Option<Retained<ARSkeletonJointName>> {
188    extern "C-unwind" {
189        fn ARSkeletonJointNameForRecognizedPointKey(
190            recognized_point_key: &VNRecognizedPointKey,
191        ) -> *mut ARSkeletonJointName;
192    }
193    let ret = unsafe { ARSkeletonJointNameForRecognizedPointKey(recognized_point_key) };
194    unsafe { Retained::retain_autoreleased(ret) }
195}