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