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")]
57unsafe impl NSObjectProtocol for ARDepthData {}
58
59#[cfg(feature = "objc2")]
60impl ARDepthData {
61    extern_methods!(
62        #[cfg(feature = "objc2-core-video")]
63        /// A pixel buffer that contains per-pixel depth data (in meters).
64        #[unsafe(method(depthMap))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn depthMap(&self) -> Retained<CVPixelBuffer>;
67
68        #[cfg(feature = "objc2-core-video")]
69        /// A pixel buffer containing the confidence level for each depth value in the `depthMap`.
70        ///
71        /// See: ARConfidenceLevel
72        #[unsafe(method(confidenceMap))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn confidenceMap(&self) -> Option<Retained<CVPixelBuffer>>;
75    );
76}
77
78/// Methods declared on superclass `NSObject`.
79#[cfg(feature = "objc2")]
80impl ARDepthData {
81    extern_methods!(
82        #[unsafe(method(init))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
85
86        #[unsafe(method(new))]
87        #[unsafe(method_family = new)]
88        pub unsafe fn new() -> Retained<Self>;
89    );
90}