react-native-nitro-ar 2026.2.1 → 2026.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/HybridARMeshAnchor.swift +48 -20
- package/ios/HybridARSegmentationResult.swift +344 -0
- package/ios/HybridARView.swift +113 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/ARObjectMeasurement.nitro.js +6 -0
- package/lib/commonjs/specs/ARObjectMeasurement.nitro.js.map +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/ARObjectMeasurement.nitro.js +4 -0
- package/lib/module/specs/ARObjectMeasurement.nitro.js.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ARObjectMeasurement.nitro.d.ts +34 -0
- package/lib/typescript/src/specs/ARObjectMeasurement.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARView.nitro.d.ts +5 -0
- package/lib/typescript/src/specs/ARView.nitro.d.ts.map +1 -1
- package/nitrogen/generated/ios/NitroAR-Swift-Cxx-Bridge.cpp +33 -0
- package/nitrogen/generated/ios/NitroAR-Swift-Cxx-Bridge.hpp +154 -0
- package/nitrogen/generated/ios/NitroAR-Swift-Cxx-Umbrella.hpp +8 -0
- package/nitrogen/generated/ios/c++/HybridARSegmentationResultSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARSegmentationResultSpecSwift.hpp +102 -0
- package/nitrogen/generated/ios/c++/HybridARViewSpecSwift.hpp +25 -0
- package/nitrogen/generated/ios/swift/ARObjectMeasurement.swift +71 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_ARObjectMeasurement_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridARSegmentationResultSpec.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridARSegmentationResultSpec_cxx.swift +187 -0
- package/nitrogen/generated/ios/swift/HybridARViewSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridARViewSpec_cxx.swift +53 -0
- package/nitrogen/generated/shared/c++/ARObjectMeasurement.hpp +107 -0
- package/nitrogen/generated/shared/c++/HybridARSegmentationResultSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridARSegmentationResultSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/HybridARViewSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridARViewSpec.hpp +10 -0
- package/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/specs/ARObjectMeasurement.nitro.ts +33 -0
- package/src/specs/ARView.nitro.ts +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ARObjectMeasurement.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/ARObjectMeasurement.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,gDAAgD;AAChD,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gDAAgD;IAChD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oCAAoC;AACpC,MAAM,WAAW,oBAAqB,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,CAAC;IAC1E,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAC/B,mCAAmC;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,iEAAiE;IACjE,cAAc,IAAI,MAAM,EAAE,CAAC;IAC3B,mCAAmC;IACnC,OAAO,IAAI,mBAAmB,GAAG,SAAS,CAAC;CAC5C"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HybridView, HybridViewMethods, HybridViewProps } from "react-native-nitro-modules";
|
|
2
|
+
import type { ARObjectMeasurement, ARSegmentationResult } from "./ARObjectMeasurement.nitro";
|
|
2
3
|
import type { SceneReconstructionMode } from "./ARSceneMesh.nitro";
|
|
3
4
|
export interface ARViewHitResult {
|
|
4
5
|
x: number;
|
|
@@ -44,6 +45,10 @@ export interface ARViewMethods extends HybridViewMethods {
|
|
|
44
45
|
resetSession(): void;
|
|
45
46
|
/** Check if LiDAR is available on this device */
|
|
46
47
|
isLiDARAvailable(): boolean;
|
|
48
|
+
/** Segment an object at the given screen point (normalized 0-1) */
|
|
49
|
+
segmentObject(x: number, y: number): Promise<ARSegmentationResult | undefined>;
|
|
50
|
+
/** Measure an object at the given screen point - combines segmentation + depth + bounding box */
|
|
51
|
+
measureObject(x: number, y: number): Promise<ARObjectMeasurement | undefined>;
|
|
47
52
|
}
|
|
48
53
|
export type ARView = HybridView<ARViewProps, ARViewMethods, {
|
|
49
54
|
ios: "swift";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ARView.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/ARView.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MA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"HybridARPlaneAnchorSpecSwift.hpp"
|
|
20
20
|
#include "HybridARPlaneGeometrySpecSwift.hpp"
|
|
21
21
|
#include "HybridARRaycastResultSpecSwift.hpp"
|
|
22
|
+
#include "HybridARSegmentationResultSpecSwift.hpp"
|
|
22
23
|
#include "HybridARSessionSpecSwift.hpp"
|
|
23
24
|
#include "HybridARViewSpecSwift.hpp"
|
|
24
25
|
#include "HybridARVolumeSpecSwift.hpp"
|
|
@@ -156,6 +157,22 @@ namespace margelo::nitro::ar::bridge::swift {
|
|
|
156
157
|
return swiftPart.toUnsafe();
|
|
157
158
|
}
|
|
158
159
|
|
|
160
|
+
// pragma MARK: std::shared_ptr<HybridARSegmentationResultSpec>
|
|
161
|
+
std::shared_ptr<HybridARSegmentationResultSpec> create_std__shared_ptr_HybridARSegmentationResultSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
162
|
+
NitroAR::HybridARSegmentationResultSpec_cxx swiftPart = NitroAR::HybridARSegmentationResultSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
163
|
+
return std::make_shared<margelo::nitro::ar::HybridARSegmentationResultSpecSwift>(swiftPart);
|
|
164
|
+
}
|
|
165
|
+
void* NON_NULL get_std__shared_ptr_HybridARSegmentationResultSpec_(std__shared_ptr_HybridARSegmentationResultSpec_ cppType) {
|
|
166
|
+
std::shared_ptr<margelo::nitro::ar::HybridARSegmentationResultSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::ar::HybridARSegmentationResultSpecSwift>(cppType);
|
|
167
|
+
#ifdef NITRO_DEBUG
|
|
168
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
169
|
+
throw std::runtime_error("Class \"HybridARSegmentationResultSpec\" is not implemented in Swift!");
|
|
170
|
+
}
|
|
171
|
+
#endif
|
|
172
|
+
NitroAR::HybridARSegmentationResultSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
173
|
+
return swiftPart.toUnsafe();
|
|
174
|
+
}
|
|
175
|
+
|
|
159
176
|
// pragma MARK: std::shared_ptr<HybridARPlaneGeometrySpec>
|
|
160
177
|
std::shared_ptr<HybridARPlaneGeometrySpec> create_std__shared_ptr_HybridARPlaneGeometrySpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
161
178
|
NitroAR::HybridARPlaneGeometrySpec_cxx swiftPart = NitroAR::HybridARPlaneGeometrySpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
@@ -316,6 +333,22 @@ namespace margelo::nitro::ar::bridge::swift {
|
|
|
316
333
|
return swiftPart.toUnsafe();
|
|
317
334
|
}
|
|
318
335
|
|
|
336
|
+
// pragma MARK: std::function<void(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& /* result */)>
|
|
337
|
+
Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__ create_Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
338
|
+
auto swiftClosure = NitroAR::Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__::fromUnsafe(swiftClosureWrapper);
|
|
339
|
+
return [swiftClosure = std::move(swiftClosure)](const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& result) mutable -> void {
|
|
340
|
+
swiftClosure.call(result);
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// pragma MARK: std::function<void(const std::optional<ARObjectMeasurement>& /* result */)>
|
|
345
|
+
Func_void_std__optional_ARObjectMeasurement_ create_Func_void_std__optional_ARObjectMeasurement_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
346
|
+
auto swiftClosure = NitroAR::Func_void_std__optional_ARObjectMeasurement_::fromUnsafe(swiftClosureWrapper);
|
|
347
|
+
return [swiftClosure = std::move(swiftClosure)](const std::optional<ARObjectMeasurement>& result) mutable -> void {
|
|
348
|
+
swiftClosure.call(result);
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
|
|
319
352
|
// pragma MARK: std::shared_ptr<HybridARViewSpec>
|
|
320
353
|
std::shared_ptr<HybridARViewSpec> create_std__shared_ptr_HybridARViewSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
321
354
|
NitroAR::HybridARViewSpec_cxx swiftPart = NitroAR::HybridARViewSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `ARObjectMeasurement` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::ar { struct ARObjectMeasurement; }
|
|
11
13
|
// Forward declaration of `ARSessionConfiguration` to properly resolve imports.
|
|
12
14
|
namespace margelo::nitro::ar { struct ARSessionConfiguration; }
|
|
13
15
|
// Forward declaration of `ARViewHitResult` to properly resolve imports.
|
|
@@ -38,6 +40,8 @@ namespace margelo::nitro::ar { class HybridARPlaneAnchorSpec; }
|
|
|
38
40
|
namespace margelo::nitro::ar { class HybridARPlaneGeometrySpec; }
|
|
39
41
|
// Forward declaration of `HybridARRaycastResultSpec` to properly resolve imports.
|
|
40
42
|
namespace margelo::nitro::ar { class HybridARRaycastResultSpec; }
|
|
43
|
+
// Forward declaration of `HybridARSegmentationResultSpec` to properly resolve imports.
|
|
44
|
+
namespace margelo::nitro::ar { class HybridARSegmentationResultSpec; }
|
|
41
45
|
// Forward declaration of `HybridARSessionSpec` to properly resolve imports.
|
|
42
46
|
namespace margelo::nitro::ar { class HybridARSessionSpec; }
|
|
43
47
|
// Forward declaration of `HybridARViewSpec` to properly resolve imports.
|
|
@@ -84,6 +88,8 @@ namespace NitroAR { class HybridARPlaneAnchorSpec_cxx; }
|
|
|
84
88
|
namespace NitroAR { class HybridARPlaneGeometrySpec_cxx; }
|
|
85
89
|
// Forward declaration of `HybridARRaycastResultSpec_cxx` to properly resolve imports.
|
|
86
90
|
namespace NitroAR { class HybridARRaycastResultSpec_cxx; }
|
|
91
|
+
// Forward declaration of `HybridARSegmentationResultSpec_cxx` to properly resolve imports.
|
|
92
|
+
namespace NitroAR { class HybridARSegmentationResultSpec_cxx; }
|
|
87
93
|
// Forward declaration of `HybridARSessionSpec_cxx` to properly resolve imports.
|
|
88
94
|
namespace NitroAR { class HybridARSessionSpec_cxx; }
|
|
89
95
|
// Forward declaration of `HybridARViewSpec_cxx` to properly resolve imports.
|
|
@@ -94,6 +100,7 @@ namespace NitroAR { class HybridARVolumeSpec_cxx; }
|
|
|
94
100
|
namespace NitroAR { class HybridARWorldMapSpec_cxx; }
|
|
95
101
|
|
|
96
102
|
// Include C++ defined types
|
|
103
|
+
#include "ARObjectMeasurement.hpp"
|
|
97
104
|
#include "ARSessionConfiguration.hpp"
|
|
98
105
|
#include "ARViewHitResult.hpp"
|
|
99
106
|
#include "CameraPose.hpp"
|
|
@@ -109,6 +116,7 @@ namespace NitroAR { class HybridARWorldMapSpec_cxx; }
|
|
|
109
116
|
#include "HybridARPlaneAnchorSpec.hpp"
|
|
110
117
|
#include "HybridARPlaneGeometrySpec.hpp"
|
|
111
118
|
#include "HybridARRaycastResultSpec.hpp"
|
|
119
|
+
#include "HybridARSegmentationResultSpec.hpp"
|
|
112
120
|
#include "HybridARSessionSpec.hpp"
|
|
113
121
|
#include "HybridARViewSpec.hpp"
|
|
114
122
|
#include "HybridARVolumeSpec.hpp"
|
|
@@ -342,6 +350,51 @@ namespace margelo::nitro::ar::bridge::swift {
|
|
|
342
350
|
using std__weak_ptr_HybridARMeasurementSpec_ = std::weak_ptr<HybridARMeasurementSpec>;
|
|
343
351
|
inline std__weak_ptr_HybridARMeasurementSpec_ weakify_std__shared_ptr_HybridARMeasurementSpec_(const std::shared_ptr<HybridARMeasurementSpec>& strong) noexcept { return strong; }
|
|
344
352
|
|
|
353
|
+
// pragma MARK: std::optional<ARObjectMeasurement>
|
|
354
|
+
/**
|
|
355
|
+
* Specialized version of `std::optional<ARObjectMeasurement>`.
|
|
356
|
+
*/
|
|
357
|
+
using std__optional_ARObjectMeasurement_ = std::optional<ARObjectMeasurement>;
|
|
358
|
+
inline std::optional<ARObjectMeasurement> create_std__optional_ARObjectMeasurement_(const ARObjectMeasurement& value) noexcept {
|
|
359
|
+
return std::optional<ARObjectMeasurement>(value);
|
|
360
|
+
}
|
|
361
|
+
inline bool has_value_std__optional_ARObjectMeasurement_(const std::optional<ARObjectMeasurement>& optional) noexcept {
|
|
362
|
+
return optional.has_value();
|
|
363
|
+
}
|
|
364
|
+
inline ARObjectMeasurement get_std__optional_ARObjectMeasurement_(const std::optional<ARObjectMeasurement>& optional) noexcept {
|
|
365
|
+
return *optional;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// pragma MARK: std::shared_ptr<HybridARSegmentationResultSpec>
|
|
369
|
+
/**
|
|
370
|
+
* Specialized version of `std::shared_ptr<HybridARSegmentationResultSpec>`.
|
|
371
|
+
*/
|
|
372
|
+
using std__shared_ptr_HybridARSegmentationResultSpec_ = std::shared_ptr<HybridARSegmentationResultSpec>;
|
|
373
|
+
std::shared_ptr<HybridARSegmentationResultSpec> create_std__shared_ptr_HybridARSegmentationResultSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
374
|
+
void* NON_NULL get_std__shared_ptr_HybridARSegmentationResultSpec_(std__shared_ptr_HybridARSegmentationResultSpec_ cppType);
|
|
375
|
+
|
|
376
|
+
// pragma MARK: std::weak_ptr<HybridARSegmentationResultSpec>
|
|
377
|
+
using std__weak_ptr_HybridARSegmentationResultSpec_ = std::weak_ptr<HybridARSegmentationResultSpec>;
|
|
378
|
+
inline std__weak_ptr_HybridARSegmentationResultSpec_ weakify_std__shared_ptr_HybridARSegmentationResultSpec_(const std::shared_ptr<HybridARSegmentationResultSpec>& strong) noexcept { return strong; }
|
|
379
|
+
|
|
380
|
+
// pragma MARK: Result<std::vector<double>>
|
|
381
|
+
using Result_std__vector_double__ = Result<std::vector<double>>;
|
|
382
|
+
inline Result_std__vector_double__ create_Result_std__vector_double__(const std::vector<double>& value) noexcept {
|
|
383
|
+
return Result<std::vector<double>>::withValue(value);
|
|
384
|
+
}
|
|
385
|
+
inline Result_std__vector_double__ create_Result_std__vector_double__(const std::exception_ptr& error) noexcept {
|
|
386
|
+
return Result<std::vector<double>>::withError(error);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// pragma MARK: Result<std::optional<ARObjectMeasurement>>
|
|
390
|
+
using Result_std__optional_ARObjectMeasurement__ = Result<std::optional<ARObjectMeasurement>>;
|
|
391
|
+
inline Result_std__optional_ARObjectMeasurement__ create_Result_std__optional_ARObjectMeasurement__(const std::optional<ARObjectMeasurement>& value) noexcept {
|
|
392
|
+
return Result<std::optional<ARObjectMeasurement>>::withValue(value);
|
|
393
|
+
}
|
|
394
|
+
inline Result_std__optional_ARObjectMeasurement__ create_Result_std__optional_ARObjectMeasurement__(const std::exception_ptr& error) noexcept {
|
|
395
|
+
return Result<std::optional<ARObjectMeasurement>>::withError(error);
|
|
396
|
+
}
|
|
397
|
+
|
|
345
398
|
// pragma MARK: std::shared_ptr<HybridARPlaneGeometrySpec>
|
|
346
399
|
/**
|
|
347
400
|
* Specialized version of `std::shared_ptr<HybridARPlaneGeometrySpec>`.
|
|
@@ -901,6 +954,89 @@ namespace margelo::nitro::ar::bridge::swift {
|
|
|
901
954
|
return *optional;
|
|
902
955
|
}
|
|
903
956
|
|
|
957
|
+
// pragma MARK: std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>
|
|
958
|
+
/**
|
|
959
|
+
* Specialized version of `std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>`.
|
|
960
|
+
*/
|
|
961
|
+
using std__optional_std__shared_ptr_HybridARSegmentationResultSpec__ = std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>;
|
|
962
|
+
inline std::optional<std::shared_ptr<HybridARSegmentationResultSpec>> create_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__(const std::shared_ptr<HybridARSegmentationResultSpec>& value) noexcept {
|
|
963
|
+
return std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>(value);
|
|
964
|
+
}
|
|
965
|
+
inline bool has_value_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& optional) noexcept {
|
|
966
|
+
return optional.has_value();
|
|
967
|
+
}
|
|
968
|
+
inline std::shared_ptr<HybridARSegmentationResultSpec> get_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& optional) noexcept {
|
|
969
|
+
return *optional;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
// pragma MARK: std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>>
|
|
973
|
+
/**
|
|
974
|
+
* Specialized version of `std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>>`.
|
|
975
|
+
*/
|
|
976
|
+
using std__shared_ptr_Promise_std__optional_std__shared_ptr_HybridARSegmentationResultSpec____ = std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>>;
|
|
977
|
+
inline std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>> create_std__shared_ptr_Promise_std__optional_std__shared_ptr_HybridARSegmentationResultSpec____() noexcept {
|
|
978
|
+
return Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>::create();
|
|
979
|
+
}
|
|
980
|
+
inline PromiseHolder<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>> wrap_std__shared_ptr_Promise_std__optional_std__shared_ptr_HybridARSegmentationResultSpec____(std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>> promise) noexcept {
|
|
981
|
+
return PromiseHolder<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>(std::move(promise));
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
// pragma MARK: std::function<void(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& /* result */)>
|
|
985
|
+
/**
|
|
986
|
+
* Specialized version of `std::function<void(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>&)>`.
|
|
987
|
+
*/
|
|
988
|
+
using Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__ = std::function<void(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& /* result */)>;
|
|
989
|
+
/**
|
|
990
|
+
* Wrapper class for a `std::function<void(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& / * result * /)>`, this can be used from Swift.
|
|
991
|
+
*/
|
|
992
|
+
class Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec___Wrapper final {
|
|
993
|
+
public:
|
|
994
|
+
explicit Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec___Wrapper(std::function<void(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& /* result */)>>(std::move(func))) {}
|
|
995
|
+
inline void call(std::optional<std::shared_ptr<HybridARSegmentationResultSpec>> result) const noexcept {
|
|
996
|
+
_function->operator()(result);
|
|
997
|
+
}
|
|
998
|
+
private:
|
|
999
|
+
std::unique_ptr<std::function<void(const std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>& /* result */)>> _function;
|
|
1000
|
+
} SWIFT_NONCOPYABLE;
|
|
1001
|
+
Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__ create_Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
1002
|
+
inline Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec___Wrapper wrap_Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__(Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec__ value) noexcept {
|
|
1003
|
+
return Func_void_std__optional_std__shared_ptr_HybridARSegmentationResultSpec___Wrapper(std::move(value));
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// pragma MARK: std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>>
|
|
1007
|
+
/**
|
|
1008
|
+
* Specialized version of `std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>>`.
|
|
1009
|
+
*/
|
|
1010
|
+
using std__shared_ptr_Promise_std__optional_ARObjectMeasurement___ = std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>>;
|
|
1011
|
+
inline std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>> create_std__shared_ptr_Promise_std__optional_ARObjectMeasurement___() noexcept {
|
|
1012
|
+
return Promise<std::optional<ARObjectMeasurement>>::create();
|
|
1013
|
+
}
|
|
1014
|
+
inline PromiseHolder<std::optional<ARObjectMeasurement>> wrap_std__shared_ptr_Promise_std__optional_ARObjectMeasurement___(std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>> promise) noexcept {
|
|
1015
|
+
return PromiseHolder<std::optional<ARObjectMeasurement>>(std::move(promise));
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// pragma MARK: std::function<void(const std::optional<ARObjectMeasurement>& /* result */)>
|
|
1019
|
+
/**
|
|
1020
|
+
* Specialized version of `std::function<void(const std::optional<ARObjectMeasurement>&)>`.
|
|
1021
|
+
*/
|
|
1022
|
+
using Func_void_std__optional_ARObjectMeasurement_ = std::function<void(const std::optional<ARObjectMeasurement>& /* result */)>;
|
|
1023
|
+
/**
|
|
1024
|
+
* Wrapper class for a `std::function<void(const std::optional<ARObjectMeasurement>& / * result * /)>`, this can be used from Swift.
|
|
1025
|
+
*/
|
|
1026
|
+
class Func_void_std__optional_ARObjectMeasurement__Wrapper final {
|
|
1027
|
+
public:
|
|
1028
|
+
explicit Func_void_std__optional_ARObjectMeasurement__Wrapper(std::function<void(const std::optional<ARObjectMeasurement>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::optional<ARObjectMeasurement>& /* result */)>>(std::move(func))) {}
|
|
1029
|
+
inline void call(std::optional<ARObjectMeasurement> result) const noexcept {
|
|
1030
|
+
_function->operator()(result);
|
|
1031
|
+
}
|
|
1032
|
+
private:
|
|
1033
|
+
std::unique_ptr<std::function<void(const std::optional<ARObjectMeasurement>& /* result */)>> _function;
|
|
1034
|
+
} SWIFT_NONCOPYABLE;
|
|
1035
|
+
Func_void_std__optional_ARObjectMeasurement_ create_Func_void_std__optional_ARObjectMeasurement_(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
1036
|
+
inline Func_void_std__optional_ARObjectMeasurement__Wrapper wrap_Func_void_std__optional_ARObjectMeasurement_(Func_void_std__optional_ARObjectMeasurement_ value) noexcept {
|
|
1037
|
+
return Func_void_std__optional_ARObjectMeasurement__Wrapper(std::move(value));
|
|
1038
|
+
}
|
|
1039
|
+
|
|
904
1040
|
// pragma MARK: std::shared_ptr<HybridARViewSpec>
|
|
905
1041
|
/**
|
|
906
1042
|
* Specialized version of `std::shared_ptr<HybridARViewSpec>`.
|
|
@@ -930,5 +1066,23 @@ namespace margelo::nitro::ar::bridge::swift {
|
|
|
930
1066
|
inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept {
|
|
931
1067
|
return Result<bool>::withError(error);
|
|
932
1068
|
}
|
|
1069
|
+
|
|
1070
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>>>
|
|
1071
|
+
using Result_std__shared_ptr_Promise_std__optional_std__shared_ptr_HybridARSegmentationResultSpec_____ = Result<std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>>>;
|
|
1072
|
+
inline Result_std__shared_ptr_Promise_std__optional_std__shared_ptr_HybridARSegmentationResultSpec_____ create_Result_std__shared_ptr_Promise_std__optional_std__shared_ptr_HybridARSegmentationResultSpec_____(const std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>>& value) noexcept {
|
|
1073
|
+
return Result<std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>>>::withValue(value);
|
|
1074
|
+
}
|
|
1075
|
+
inline Result_std__shared_ptr_Promise_std__optional_std__shared_ptr_HybridARSegmentationResultSpec_____ create_Result_std__shared_ptr_Promise_std__optional_std__shared_ptr_HybridARSegmentationResultSpec_____(const std::exception_ptr& error) noexcept {
|
|
1076
|
+
return Result<std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>>>::withError(error);
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>>>
|
|
1080
|
+
using Result_std__shared_ptr_Promise_std__optional_ARObjectMeasurement____ = Result<std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>>>;
|
|
1081
|
+
inline Result_std__shared_ptr_Promise_std__optional_ARObjectMeasurement____ create_Result_std__shared_ptr_Promise_std__optional_ARObjectMeasurement____(const std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>>& value) noexcept {
|
|
1082
|
+
return Result<std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>>>::withValue(value);
|
|
1083
|
+
}
|
|
1084
|
+
inline Result_std__shared_ptr_Promise_std__optional_ARObjectMeasurement____ create_Result_std__shared_ptr_Promise_std__optional_ARObjectMeasurement____(const std::exception_ptr& error) noexcept {
|
|
1085
|
+
return Result<std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>>>::withError(error);
|
|
1086
|
+
}
|
|
933
1087
|
|
|
934
1088
|
} // namespace margelo::nitro::ar::bridge::swift
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `ARObjectMeasurement` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::ar { struct ARObjectMeasurement; }
|
|
11
13
|
// Forward declaration of `ARSessionConfiguration` to properly resolve imports.
|
|
12
14
|
namespace margelo::nitro::ar { struct ARSessionConfiguration; }
|
|
13
15
|
// Forward declaration of `ARViewHitResult` to properly resolve imports.
|
|
@@ -38,6 +40,8 @@ namespace margelo::nitro::ar { class HybridARPlaneAnchorSpec; }
|
|
|
38
40
|
namespace margelo::nitro::ar { class HybridARPlaneGeometrySpec; }
|
|
39
41
|
// Forward declaration of `HybridARRaycastResultSpec` to properly resolve imports.
|
|
40
42
|
namespace margelo::nitro::ar { class HybridARRaycastResultSpec; }
|
|
43
|
+
// Forward declaration of `HybridARSegmentationResultSpec` to properly resolve imports.
|
|
44
|
+
namespace margelo::nitro::ar { class HybridARSegmentationResultSpec; }
|
|
41
45
|
// Forward declaration of `HybridARSessionSpec` to properly resolve imports.
|
|
42
46
|
namespace margelo::nitro::ar { class HybridARSessionSpec; }
|
|
43
47
|
// Forward declaration of `HybridARViewSpec` to properly resolve imports.
|
|
@@ -74,6 +78,7 @@ namespace margelo::nitro::ar { enum class WorldAlignment; }
|
|
|
74
78
|
namespace margelo::nitro::ar { enum class WorldMappingStatus; }
|
|
75
79
|
|
|
76
80
|
// Include C++ defined types
|
|
81
|
+
#include "ARObjectMeasurement.hpp"
|
|
77
82
|
#include "ARSessionConfiguration.hpp"
|
|
78
83
|
#include "ARViewHitResult.hpp"
|
|
79
84
|
#include "CameraPose.hpp"
|
|
@@ -89,6 +94,7 @@ namespace margelo::nitro::ar { enum class WorldMappingStatus; }
|
|
|
89
94
|
#include "HybridARPlaneAnchorSpec.hpp"
|
|
90
95
|
#include "HybridARPlaneGeometrySpec.hpp"
|
|
91
96
|
#include "HybridARRaycastResultSpec.hpp"
|
|
97
|
+
#include "HybridARSegmentationResultSpec.hpp"
|
|
92
98
|
#include "HybridARSessionSpec.hpp"
|
|
93
99
|
#include "HybridARViewSpec.hpp"
|
|
94
100
|
#include "HybridARVolumeSpec.hpp"
|
|
@@ -147,6 +153,8 @@ namespace NitroAR { class HybridARPlaneAnchorSpec_cxx; }
|
|
|
147
153
|
namespace NitroAR { class HybridARPlaneGeometrySpec_cxx; }
|
|
148
154
|
// Forward declaration of `HybridARRaycastResultSpec_cxx` to properly resolve imports.
|
|
149
155
|
namespace NitroAR { class HybridARRaycastResultSpec_cxx; }
|
|
156
|
+
// Forward declaration of `HybridARSegmentationResultSpec_cxx` to properly resolve imports.
|
|
157
|
+
namespace NitroAR { class HybridARSegmentationResultSpec_cxx; }
|
|
150
158
|
// Forward declaration of `HybridARSessionSpec_cxx` to properly resolve imports.
|
|
151
159
|
namespace NitroAR { class HybridARSessionSpec_cxx; }
|
|
152
160
|
// Forward declaration of `HybridARViewSpec_cxx` to properly resolve imports.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridARSegmentationResultSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridARSegmentationResultSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::ar {
|
|
11
|
+
} // namespace margelo::nitro::ar
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridARSegmentationResultSpecSwift.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridARSegmentationResultSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridARSegmentationResultSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroAR { class HybridARSegmentationResultSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
// Forward declaration of `ARObjectMeasurement` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::ar { struct ARObjectMeasurement; }
|
|
17
|
+
|
|
18
|
+
#include <vector>
|
|
19
|
+
#include "ARObjectMeasurement.hpp"
|
|
20
|
+
#include <optional>
|
|
21
|
+
|
|
22
|
+
#include "NitroAR-Swift-Cxx-Umbrella.hpp"
|
|
23
|
+
|
|
24
|
+
namespace margelo::nitro::ar {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The C++ part of HybridARSegmentationResultSpec_cxx.swift.
|
|
28
|
+
*
|
|
29
|
+
* HybridARSegmentationResultSpecSwift (C++) accesses HybridARSegmentationResultSpec_cxx (Swift), and might
|
|
30
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
31
|
+
*
|
|
32
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
33
|
+
* the future, HybridARSegmentationResultSpec_cxx can directly inherit from the C++ class HybridARSegmentationResultSpec
|
|
34
|
+
* to simplify the whole structure and memory management.
|
|
35
|
+
*/
|
|
36
|
+
class HybridARSegmentationResultSpecSwift: public virtual HybridARSegmentationResultSpec {
|
|
37
|
+
public:
|
|
38
|
+
// Constructor from a Swift instance
|
|
39
|
+
explicit HybridARSegmentationResultSpecSwift(const NitroAR::HybridARSegmentationResultSpec_cxx& swiftPart):
|
|
40
|
+
HybridObject(HybridARSegmentationResultSpec::TAG),
|
|
41
|
+
_swiftPart(swiftPart) { }
|
|
42
|
+
|
|
43
|
+
public:
|
|
44
|
+
// Get the Swift part
|
|
45
|
+
inline NitroAR::HybridARSegmentationResultSpec_cxx& getSwiftPart() noexcept {
|
|
46
|
+
return _swiftPart;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
51
|
+
return _swiftPart.getMemorySize();
|
|
52
|
+
}
|
|
53
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
54
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridARSegmentationResultSpecSwift>(other)) {
|
|
55
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
void dispose() noexcept override {
|
|
60
|
+
_swiftPart.dispose();
|
|
61
|
+
}
|
|
62
|
+
std::string toString() override {
|
|
63
|
+
return _swiftPart.toString();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
// Properties
|
|
68
|
+
inline bool getSuccess() noexcept override {
|
|
69
|
+
return _swiftPart.getSuccess();
|
|
70
|
+
}
|
|
71
|
+
inline std::vector<double> getBoundingBox() noexcept override {
|
|
72
|
+
auto __result = _swiftPart.getBoundingBox();
|
|
73
|
+
return __result;
|
|
74
|
+
}
|
|
75
|
+
inline double getMaskPixelCount() noexcept override {
|
|
76
|
+
return _swiftPart.getMaskPixelCount();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public:
|
|
80
|
+
// Methods
|
|
81
|
+
inline std::vector<double> getDepthPoints() override {
|
|
82
|
+
auto __result = _swiftPart.getDepthPoints();
|
|
83
|
+
if (__result.hasError()) [[unlikely]] {
|
|
84
|
+
std::rethrow_exception(__result.error());
|
|
85
|
+
}
|
|
86
|
+
auto __value = std::move(__result.value());
|
|
87
|
+
return __value;
|
|
88
|
+
}
|
|
89
|
+
inline std::optional<ARObjectMeasurement> measure() override {
|
|
90
|
+
auto __result = _swiftPart.measure();
|
|
91
|
+
if (__result.hasError()) [[unlikely]] {
|
|
92
|
+
std::rethrow_exception(__result.error());
|
|
93
|
+
}
|
|
94
|
+
auto __value = std::move(__result.value());
|
|
95
|
+
return __value;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private:
|
|
99
|
+
NitroAR::HybridARSegmentationResultSpec_cxx _swiftPart;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
} // namespace margelo::nitro::ar
|
|
@@ -16,11 +16,20 @@ namespace NitroAR { class HybridARViewSpec_cxx; }
|
|
|
16
16
|
namespace margelo::nitro::ar { enum class SceneReconstructionMode; }
|
|
17
17
|
// Forward declaration of `ARViewHitResult` to properly resolve imports.
|
|
18
18
|
namespace margelo::nitro::ar { struct ARViewHitResult; }
|
|
19
|
+
// Forward declaration of `HybridARSegmentationResultSpec` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::ar { class HybridARSegmentationResultSpec; }
|
|
21
|
+
// Forward declaration of `ARObjectMeasurement` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::ar { struct ARObjectMeasurement; }
|
|
19
23
|
|
|
20
24
|
#include <optional>
|
|
21
25
|
#include "SceneReconstructionMode.hpp"
|
|
22
26
|
#include <string>
|
|
23
27
|
#include "ARViewHitResult.hpp"
|
|
28
|
+
#include <memory>
|
|
29
|
+
#include "HybridARSegmentationResultSpec.hpp"
|
|
30
|
+
#include <NitroModules/Promise.hpp>
|
|
31
|
+
#include "ARObjectMeasurement.hpp"
|
|
32
|
+
#include <vector>
|
|
24
33
|
|
|
25
34
|
#include "NitroAR-Swift-Cxx-Umbrella.hpp"
|
|
26
35
|
|
|
@@ -235,6 +244,22 @@ namespace margelo::nitro::ar {
|
|
|
235
244
|
auto __value = std::move(__result.value());
|
|
236
245
|
return __value;
|
|
237
246
|
}
|
|
247
|
+
inline std::shared_ptr<Promise<std::optional<std::shared_ptr<HybridARSegmentationResultSpec>>>> segmentObject(double x, double y) override {
|
|
248
|
+
auto __result = _swiftPart.segmentObject(std::forward<decltype(x)>(x), std::forward<decltype(y)>(y));
|
|
249
|
+
if (__result.hasError()) [[unlikely]] {
|
|
250
|
+
std::rethrow_exception(__result.error());
|
|
251
|
+
}
|
|
252
|
+
auto __value = std::move(__result.value());
|
|
253
|
+
return __value;
|
|
254
|
+
}
|
|
255
|
+
inline std::shared_ptr<Promise<std::optional<ARObjectMeasurement>>> measureObject(double x, double y) override {
|
|
256
|
+
auto __result = _swiftPart.measureObject(std::forward<decltype(x)>(x), std::forward<decltype(y)>(y));
|
|
257
|
+
if (__result.hasError()) [[unlikely]] {
|
|
258
|
+
std::rethrow_exception(__result.error());
|
|
259
|
+
}
|
|
260
|
+
auto __value = std::move(__result.value());
|
|
261
|
+
return __value;
|
|
262
|
+
}
|
|
238
263
|
|
|
239
264
|
private:
|
|
240
265
|
NitroAR::HybridARViewSpec_cxx _swiftPart;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ARObjectMeasurement.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `ARObjectMeasurement`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias ARObjectMeasurement = margelo.nitro.ar.ARObjectMeasurement
|
|
14
|
+
|
|
15
|
+
public extension ARObjectMeasurement {
|
|
16
|
+
private typealias bridge = margelo.nitro.ar.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `ARObjectMeasurement`.
|
|
20
|
+
*/
|
|
21
|
+
init(width: Double, height: Double, depth: Double, center: [Double], axes: [Double], confidence: Double, pointCount: Double) {
|
|
22
|
+
self.init(width, height, depth, { () -> bridge.std__vector_double_ in
|
|
23
|
+
var __vector = bridge.create_std__vector_double_(center.count)
|
|
24
|
+
for __item in center {
|
|
25
|
+
__vector.push_back(__item)
|
|
26
|
+
}
|
|
27
|
+
return __vector
|
|
28
|
+
}(), { () -> bridge.std__vector_double_ in
|
|
29
|
+
var __vector = bridge.create_std__vector_double_(axes.count)
|
|
30
|
+
for __item in axes {
|
|
31
|
+
__vector.push_back(__item)
|
|
32
|
+
}
|
|
33
|
+
return __vector
|
|
34
|
+
}(), confidence, pointCount)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@inline(__always)
|
|
38
|
+
var width: Double {
|
|
39
|
+
return self.__width
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@inline(__always)
|
|
43
|
+
var height: Double {
|
|
44
|
+
return self.__height
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@inline(__always)
|
|
48
|
+
var depth: Double {
|
|
49
|
+
return self.__depth
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@inline(__always)
|
|
53
|
+
var center: [Double] {
|
|
54
|
+
return self.__center.map({ __item in __item })
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@inline(__always)
|
|
58
|
+
var axes: [Double] {
|
|
59
|
+
return self.__axes.map({ __item in __item })
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@inline(__always)
|
|
63
|
+
var confidence: Double {
|
|
64
|
+
return self.__confidence
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@inline(__always)
|
|
68
|
+
var pointCount: Double {
|
|
69
|
+
return self.__pointCount
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__optional_ARObjectMeasurement_.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ value: ARObjectMeasurement?) -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void_std__optional_ARObjectMeasurement_ {
|
|
15
|
+
public typealias bridge = margelo.nitro.ar.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: ARObjectMeasurement?) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: ARObjectMeasurement?) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: bridge.std__optional_ARObjectMeasurement_) -> Void {
|
|
25
|
+
self.closure(value.value)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_std__optional_ARObjectMeasurement_`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__optional_ARObjectMeasurement_>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__optional_ARObjectMeasurement_ {
|
|
44
|
+
return Unmanaged<Func_void_std__optional_ARObjectMeasurement_>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|