objc2_ar_kit/generated/
ARReferenceImage.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7#[cfg(feature = "objc2-core-foundation")]
8use objc2_core_foundation::*;
9#[cfg(feature = "objc2-foundation")]
10use objc2_foundation::*;
11
12use crate::*;
13
14#[cfg(feature = "objc2")]
15extern_class!(
16    /// A reference image to be detected in the scene.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arreferenceimage?language=objc)
19    #[unsafe(super(NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[cfg(feature = "objc2")]
22    pub struct ARReferenceImage;
23);
24
25#[cfg(feature = "objc2")]
26unsafe impl Send for ARReferenceImage {}
27
28#[cfg(feature = "objc2")]
29unsafe impl Sync for ARReferenceImage {}
30
31#[cfg(feature = "objc2")]
32extern_conformance!(
33    unsafe impl NSObjectProtocol for ARReferenceImage {}
34);
35
36#[cfg(feature = "objc2")]
37impl ARReferenceImage {
38    extern_methods!(
39        #[cfg(feature = "objc2-foundation")]
40        /// An optional name used to identify the image.
41        #[unsafe(method(name))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
44
45        #[cfg(feature = "objc2-foundation")]
46        /// Setter for [`name`][Self::name].
47        #[unsafe(method(setName:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn setName(&self, name: Option<&NSString>);
50
51        #[cfg(feature = "objc2-core-foundation")]
52        /// The physical size of the image in meters.
53        #[unsafe(method(physicalSize))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn physicalSize(&self) -> CGSize;
56
57        #[cfg(feature = "objc2-foundation")]
58        /// The AR resource group name for this image.
59        ///
60        /// If this image was loaded via an AR resource group in the Xcode asset catalogue this property will have the name of the resource group,
61        /// else be set to nil.
62        #[unsafe(method(resourceGroupName))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn resourceGroupName(&self) -> Option<Retained<NSString>>;
65
66        #[cfg(all(feature = "block2", feature = "objc2-foundation"))]
67        /// Validate if this image can be used for image detection or tracking.
68        ///
69        /// When loading reference images from the asset catalog this verification is not needed as the same verification happens
70        /// at compile time.
71        ///
72        /// Parameter `completionHandler`: Completion handler invoked when validation is done. The completion handler takes the following parameters:
73        /// error - An error that indicates why the image is not suitable for tracking, or nil if no error occurred.
74        #[unsafe(method(validateWithCompletionHandler:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn validateWithCompletionHandler(
77            &self,
78            completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
79        );
80
81        #[cfg(feature = "objc2-foundation")]
82        /// Returns the set of ARReferenceImages in the specified resource group and bundle.
83        ///
84        ///
85        /// Parameter `name`: The name of the resource group.
86        ///
87        /// Parameter `bundle`: The bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle.
88        ///
89        /// Returns: The set of reference images or nil on error.
90        #[unsafe(method(referenceImagesInGroupNamed:bundle:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn referenceImagesInGroupNamed_bundle(
93            name: &NSString,
94            bundle: Option<&NSBundle>,
95        ) -> Option<Retained<NSSet<ARReferenceImage>>>;
96
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}