objc2_ar_kit/generated/
ARDepthData.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-core-video")]
7use objc2_core_video::*;
8
9use crate::*;
10
11/// Constants indicating the confidence level of per-pixel depth data.
12///
13/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arconfidencelevel?language=objc)
14// NS_ENUM
15#[cfg(feature = "objc2")]
16#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct ARConfidenceLevel(pub NSInteger);
19#[cfg(feature = "objc2")]
20impl ARConfidenceLevel {
21    #[doc(alias = "ARConfidenceLevelLow")]
22    pub const Low: Self = Self(0);
23    #[doc(alias = "ARConfidenceLevelMedium")]
24    pub const Medium: Self = Self(1);
25    #[doc(alias = "ARConfidenceLevelHigh")]
26    pub const High: Self = Self(2);
27}
28
29#[cfg(feature = "objc2")]
30unsafe impl Encode for ARConfidenceLevel {
31    const ENCODING: Encoding = NSInteger::ENCODING;
32}
33
34#[cfg(feature = "objc2")]
35unsafe impl RefEncode for ARConfidenceLevel {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39#[cfg(feature = "objc2")]
40extern_class!(
41    /// A container for depth data and its associated confidence.
42    ///
43    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/ardepthdata?language=objc)
44    #[unsafe(super(NSObject))]
45    #[derive(Debug, PartialEq, Eq, Hash)]
46    #[cfg(feature = "objc2")]
47    pub struct ARDepthData;
48);
49
50#[cfg(feature = "objc2")]
51unsafe impl Send for ARDepthData {}
52
53#[cfg(feature = "objc2")]
54unsafe impl Sync for ARDepthData {}
55
56#[cfg(feature = "objc2")]
57extern_conformance!(
58    unsafe impl NSObjectProtocol for ARDepthData {}
59);
60
61#[cfg(feature = "objc2")]
62impl ARDepthData {
63    extern_methods!(
64        #[cfg(feature = "objc2-core-video")]
65        /// A pixel buffer that contains per-pixel depth data (in meters).
66        ///
67        /// This property is not atomic.
68        ///
69        /// # Safety
70        ///
71        /// - This is not retained internally, you must ensure the object is still alive.
72        /// - This might not be thread-safe.
73        #[unsafe(method(depthMap))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn depthMap(&self) -> Retained<CVPixelBuffer>;
76
77        #[cfg(feature = "objc2-core-video")]
78        /// A pixel buffer containing the confidence level for each depth value in the `depthMap`.
79        ///
80        /// See: ARConfidenceLevel
81        ///
82        /// This property is not atomic.
83        ///
84        /// # Safety
85        ///
86        /// - This is not retained internally, you must ensure the object is still alive.
87        /// - This might not be thread-safe.
88        #[unsafe(method(confidenceMap))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn confidenceMap(&self) -> Option<Retained<CVPixelBuffer>>;
91    );
92}
93
94/// Methods declared on superclass `NSObject`.
95#[cfg(feature = "objc2")]
96impl ARDepthData {
97    extern_methods!(
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}