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
181
182
183
184
//! 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-foundation")]
use objc2_foundation::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;
use crate::*;
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/arkit/arreferenceobjectarchiveextension?language=objc)
#[cfg(feature = "objc2-foundation")]
pub static ARReferenceObjectArchiveExtension: &'static NSString;
}
#[cfg(feature = "objc2")]
extern_class!(
/// A reference object to track in the scene.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arreferenceobject?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2")]
pub struct ARReferenceObject;
);
#[cfg(feature = "objc2")]
unsafe impl Send for ARReferenceObject {}
#[cfg(feature = "objc2")]
unsafe impl Sync for ARReferenceObject {}
#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
extern_conformance!(
unsafe impl NSCoding for ARReferenceObject {}
);
#[cfg(feature = "objc2")]
extern_conformance!(
unsafe impl NSObjectProtocol for ARReferenceObject {}
);
#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
extern_conformance!(
unsafe impl NSSecureCoding for ARReferenceObject {}
);
#[cfg(feature = "objc2")]
impl ARReferenceObject {
extern_methods!(
#[cfg(feature = "objc2-foundation")]
/// An optional name used to identify the object.
///
/// 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-foundation")]
/// The AR resource group name for this object.
///
/// If this object 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(feature = "ARPointCloud")]
/// The feature points of the object.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(rawFeaturePoints))]
#[unsafe(method_family = none)]
pub unsafe fn rawFeaturePoints(&self) -> Retained<ARPointCloud>;
#[cfg(feature = "objc2-foundation")]
/// Returns the set of ARReferenceObjects 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 objects or nil on error.
#[unsafe(method(referenceObjectsInGroupNamed:bundle:))]
#[unsafe(method_family = none)]
pub unsafe fn referenceObjectsInGroupNamed_bundle(
name: &NSString,
bundle: Option<&NSBundle>,
) -> Option<Retained<NSSet<ARReferenceObject>>>;
#[cfg(feature = "objc2-foundation")]
/// Initializes a new reference object with the contents of an archive at the specified URL.
///
/// Parameter `url`: The URL from which to read data (.arobject archive).
///
/// Parameter `error`: The error to populate if the object could not be initialized.
#[unsafe(method(initWithArchiveURL:error:_))]
#[unsafe(method_family = init)]
pub unsafe fn initWithArchiveURL_error(
this: Allocated<Self>,
url: &NSURL,
) -> Result<Retained<Self>, Retained<NSError>>;
#[cfg(all(feature = "objc2-foundation", feature = "objc2-ui-kit"))]
/// Exports the object as an archive at the given URL.
///
///
/// The URL path should use ARReferenceObjectArchiveExtension (.arobject) for the file extension.
/// If serialization across devices is desired, NSKeyedArchiver should be used instead.
///
/// Parameter `url`: The URL at which to write the exported object.
///
/// Parameter `previewImage`: An optional preview image to include in the archive.
///
/// Parameter `error`: The error to populate if the write is not successful.
///
/// Returns: YES if the location is written successfully, otherwise NO.
#[unsafe(method(exportObjectToURL:previewImage:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn exportObjectToURL_previewImage_error(
&self,
url: &NSURL,
preview_image: Option<&UIImage>,
) -> Result<(), Retained<NSError>>;
#[cfg(feature = "objc2-foundation")]
/// Returns a new reference object by aligning and merging the provided object with this reference.
///
/// This can be used to combine multiple scans of the same object for detection in different conditions. The object being merged
/// must share similar feature points for the merge to succeed.
///
/// Parameter `object`: The reference object to align and merge.
///
/// Parameter `error`: The error to populate if the merge is not successful.
///
/// Returns: A new reference object combining features of both scans or nil if the merge was not successful.
#[unsafe(method(referenceObjectByMergingObject:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn referenceObjectByMergingObject_error(
&self,
object: &ARReferenceObject,
) -> Result<Retained<ARReferenceObject>, Retained<NSError>>;
/// 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>;
);
}