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")]
33unsafe impl NSObjectProtocol for ARSkeleton {}
34
35#[cfg(feature = "objc2")]
36impl ARSkeleton {
37    extern_methods!(
38        #[cfg(feature = "ARSkeletonDefinition")]
39        /// Skeleton definition.
40        #[unsafe(method(definition))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn definition(&self) -> Retained<ARSkeletonDefinition>;
43
44        /// The number of joints.
45        #[unsafe(method(jointCount))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn jointCount(&self) -> NSUInteger;
48
49        /// Tracking state for a given joint.
50        ///
51        ///
52        /// Parameter `jointIndex`: The index of the joint.
53        ///
54        /// Returns: True if the joint is tracked. False otherwise.
55        #[unsafe(method(isJointTracked:))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn isJointTracked(&self, joint_index: NSInteger) -> bool;
58
59        /// Unavailable
60        #[unsafe(method(init))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
63
64        #[unsafe(method(new))]
65        #[unsafe(method_family = new)]
66        pub unsafe fn new() -> Retained<Self>;
67    );
68}
69
70#[cfg(feature = "objc2")]
71extern_class!(
72    /// An object representing a skeleton in 3D.
73    ///
74    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeleton3d?language=objc)
75    #[unsafe(super(ARSkeleton, NSObject))]
76    #[derive(Debug, PartialEq, Eq, Hash)]
77    #[cfg(feature = "objc2")]
78    pub struct ARSkeleton3D;
79);
80
81#[cfg(feature = "objc2")]
82unsafe impl Send for ARSkeleton3D {}
83
84#[cfg(feature = "objc2")]
85unsafe impl Sync for ARSkeleton3D {}
86
87#[cfg(feature = "objc2")]
88unsafe impl NSObjectProtocol for ARSkeleton3D {}
89
90#[cfg(feature = "objc2")]
91impl ARSkeleton3D {
92    extern_methods!(
93        /// Unavailable
94        #[unsafe(method(init))]
95        #[unsafe(method_family = init)]
96        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
97
98        #[unsafe(method(new))]
99        #[unsafe(method_family = new)]
100        pub unsafe fn new() -> Retained<Self>;
101    );
102}
103
104#[cfg(feature = "objc2")]
105extern_class!(
106    /// An object representing a skeleton in 2D.
107    ///
108    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arskeleton2d?language=objc)
109    #[unsafe(super(ARSkeleton, NSObject))]
110    #[derive(Debug, PartialEq, Eq, Hash)]
111    #[cfg(feature = "objc2")]
112    pub struct ARSkeleton2D;
113);
114
115#[cfg(feature = "objc2")]
116unsafe impl Send for ARSkeleton2D {}
117
118#[cfg(feature = "objc2")]
119unsafe impl Sync for ARSkeleton2D {}
120
121#[cfg(feature = "objc2")]
122unsafe impl NSObjectProtocol for ARSkeleton2D {}
123
124#[cfg(feature = "objc2")]
125impl ARSkeleton2D {
126    extern_methods!(
127        /// Unavailable
128        #[unsafe(method(init))]
129        #[unsafe(method_family = init)]
130        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
131
132        #[unsafe(method(new))]
133        #[unsafe(method_family = new)]
134        pub unsafe fn new() -> Retained<Self>;
135    );
136}
137
138/// Returns the landmark joint name that corresponds to a key point defined in Vision framework.
139///
140/// See: VNRecognizedPointKey, VNDetectHumanBodyPoseRequest
141///
142/// If an invalid key point is passed the returned point will be nil.
143///
144///
145/// Parameter `recognizedPointKey`: Recognized key point.
146///
147/// Returns: Joint name that could be mapped to a ARSkeleton2D. Nil if no mapping exists.
148#[cfg(all(
149    feature = "ARSkeletonDefinition",
150    feature = "objc2",
151    feature = "objc2-foundation",
152    feature = "objc2-vision"
153))]
154#[inline]
155pub unsafe extern "C-unwind" fn ARSkeletonJointNameForRecognizedPointKey(
156    recognized_point_key: &VNRecognizedPointKey,
157) -> Option<Retained<ARSkeletonJointName>> {
158    extern "C-unwind" {
159        fn ARSkeletonJointNameForRecognizedPointKey(
160            recognized_point_key: &VNRecognizedPointKey,
161        ) -> *mut ARSkeletonJointName;
162    }
163    let ret = unsafe { ARSkeletonJointNameForRecognizedPointKey(recognized_point_key) };
164    unsafe { Retained::retain_autoreleased(ret) }
165}