1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
#[cfg(feature = "objc2-core-video")]
use objc2_core_video::*;
#[cfg(feature = "objc2-foundation")]
use objc2_foundation::*;
#[cfg(feature = "objc2-image-io")]
use objc2_image_io::*;
use crate::*;
#[cfg(feature = "objc2")]
extern_class!(
/// A reference image to be detected in the scene.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arreferenceimage?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2")]
pub struct ARReferenceImage;
);
#[cfg(feature = "objc2")]
unsafe impl Send for ARReferenceImage {}
#[cfg(feature = "objc2")]
unsafe impl Sync for ARReferenceImage {}
#[cfg(feature = "objc2")]
extern_conformance!(
unsafe impl NSObjectProtocol for ARReferenceImage {}
);
#[cfg(feature = "objc2")]
impl ARReferenceImage {
extern_methods!(
#[cfg(feature = "objc2-foundation")]
/// An optional name used to identify the image.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "objc2-foundation")]
/// Setter for [`name`][Self::name].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: Option<&NSString>);
#[cfg(feature = "objc2-core-foundation")]
/// The physical size of the image in meters.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(physicalSize))]
#[unsafe(method_family = none)]
pub unsafe fn physicalSize(&self) -> CGSize;
#[cfg(feature = "objc2-foundation")]
/// The AR resource group name for this image.
///
/// 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,
/// else be set to nil.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(resourceGroupName))]
#[unsafe(method_family = none)]
pub unsafe fn resourceGroupName(&self) -> Option<Retained<NSString>>;
#[cfg(all(feature = "block2", feature = "objc2-foundation"))]
/// Validate if this image can be used for image detection or tracking.
///
/// When loading reference images from the asset catalog this verification is not needed as the same verification happens
/// at compile time.
///
/// Parameter `completionHandler`: Completion handler invoked when validation is done. The completion handler takes the following parameters:
/// error - An error that indicates why the image is not suitable for tracking, or nil if no error occurred.
#[unsafe(method(validateWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn validateWithCompletionHandler(
&self,
completion_handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
);
#[cfg(all(
feature = "objc2-core-foundation",
feature = "objc2-core-graphics",
feature = "objc2-image-io"
))]
/// Creates a new reference image.
///
///
/// Parameter `image`: The reference image as CGImage.
///
/// Parameter `orientation`: The image orientation.
///
/// Parameter `physicalWidth`: The width in meters of the physical object.
#[unsafe(method(initWithCGImage:orientation:physicalWidth:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCGImage_orientation_physicalWidth(
this: Allocated<Self>,
image: &CGImage,
orientation: CGImagePropertyOrientation,
physical_width: CGFloat,
) -> Retained<Self>;
#[cfg(all(
feature = "objc2-core-foundation",
feature = "objc2-core-video",
feature = "objc2-image-io"
))]
/// Creates a new reference image.
///
///
/// Parameter `pixelBuffer`: The reference image as CVPixelBuffer.
///
/// Parameter `physicalWidth`: The width in meters of the physical object.
///
/// Parameter `orientation`: The image orientation.
#[unsafe(method(initWithPixelBuffer:orientation:physicalWidth:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPixelBuffer_orientation_physicalWidth(
this: Allocated<Self>,
pixel_buffer: &CVPixelBuffer,
orientation: CGImagePropertyOrientation,
physical_width: CGFloat,
) -> Retained<Self>;
#[cfg(feature = "objc2-foundation")]
/// Returns the set of ARReferenceImages in the specified resource group and bundle.
///
///
/// Parameter `name`: The name of the resource group.
///
/// Parameter `bundle`: The bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle.
///
/// Returns: The set of reference images or nil on error.
#[unsafe(method(referenceImagesInGroupNamed:bundle:))]
#[unsafe(method_family = none)]
pub unsafe fn referenceImagesInGroupNamed_bundle(
name: &NSString,
bundle: Option<&NSBundle>,
) -> Option<Retained<NSSet<ARReferenceImage>>>;
/// Unavailable
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}