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")]
32unsafe impl NSObjectProtocol for ARReferenceImage {}
33
34#[cfg(feature = "objc2")]
35impl ARReferenceImage {
36    extern_methods!(
37        #[cfg(feature = "objc2-foundation")]
38        /// An optional name used to identify the image.
39        #[unsafe(method(name))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
42
43        #[cfg(feature = "objc2-foundation")]
44        /// Setter for [`name`][Self::name].
45        #[unsafe(method(setName:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn setName(&self, name: Option<&NSString>);
48
49        #[cfg(feature = "objc2-core-foundation")]
50        /// The physical size of the image in meters.
51        #[unsafe(method(physicalSize))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn physicalSize(&self) -> CGSize;
54
55        #[cfg(feature = "objc2-foundation")]
56        /// The AR resource group name for this image.
57        ///
58        /// 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,
59        /// else be set to nil.
60        #[unsafe(method(resourceGroupName))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn resourceGroupName(&self) -> Option<Retained<NSString>>;
63
64        #[cfg(all(feature = "block2", feature = "objc2-foundation"))]
65        /// Validate if this image can be used for image detection or tracking.
66        ///
67        /// When loading reference images from the asset catalog this verification is not needed as the same verification happens
68        /// at compile time.
69        ///
70        /// Parameter `completionHandler`: Completion handler invoked when validation is done. The completion handler takes the following parameters:
71        /// error - An error that indicates why the image is not suitable for tracking, or nil if no error occurred.
72        #[unsafe(method(validateWithCompletionHandler:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn validateWithCompletionHandler(
75            &self,
76            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
77        );
78
79        #[cfg(feature = "objc2-foundation")]
80        /// Returns the set of ARReferenceImages in the specified resource group and bundle.
81        ///
82        ///
83        /// Parameter `name`: The name of the resource group.
84        ///
85        /// Parameter `bundle`: The bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle.
86        ///
87        /// Returns: The set of reference images or nil on error.
88        #[unsafe(method(referenceImagesInGroupNamed:bundle:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn referenceImagesInGroupNamed_bundle(
91            name: &NSString,
92            bundle: Option<&NSBundle>,
93        ) -> Option<Retained<NSSet<ARReferenceImage>>>;
94
95        /// Unavailable
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99
100        #[unsafe(method(new))]
101        #[unsafe(method_family = new)]
102        pub unsafe fn new() -> Retained<Self>;
103    );
104}