react-native-nitro-ar 2026.2.1
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/README.md +347 -0
- package/app.plugin.js +24 -0
- package/ios/Bridge.h +8 -0
- package/ios/HybridARAnchor.swift +58 -0
- package/ios/HybridARBoundingBoxBuilder.swift +142 -0
- package/ios/HybridARDepthData.swift +138 -0
- package/ios/HybridARFrame.swift +121 -0
- package/ios/HybridARLightEstimate.swift +58 -0
- package/ios/HybridARMeasurement.swift +33 -0
- package/ios/HybridARMeshAnchor.swift +108 -0
- package/ios/HybridARPlaneAnchor.swift +114 -0
- package/ios/HybridARRaycastResult.swift +53 -0
- package/ios/HybridARSession.swift +505 -0
- package/ios/HybridARView.swift +725 -0
- package/ios/HybridARVolume.swift +52 -0
- package/ios/HybridARWorldMap.swift +55 -0
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +3 -0
- package/lib/commonjs/specs/ARAnchor.nitro.js +6 -0
- package/lib/commonjs/specs/ARAnchor.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARBoundingBoxBuilder.nitro.js +6 -0
- package/lib/commonjs/specs/ARBoundingBoxBuilder.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARDepthData.nitro.js +6 -0
- package/lib/commonjs/specs/ARDepthData.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARFrame.nitro.js +6 -0
- package/lib/commonjs/specs/ARFrame.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARLightEstimate.nitro.js +6 -0
- package/lib/commonjs/specs/ARLightEstimate.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARMeasurement.nitro.js +6 -0
- package/lib/commonjs/specs/ARMeasurement.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARPlaneAnchor.nitro.js +6 -0
- package/lib/commonjs/specs/ARPlaneAnchor.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARRaycastResult.nitro.js +6 -0
- package/lib/commonjs/specs/ARRaycastResult.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARSceneMesh.nitro.js +6 -0
- package/lib/commonjs/specs/ARSceneMesh.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARSession.nitro.js +6 -0
- package/lib/commonjs/specs/ARSession.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARView.nitro.js +6 -0
- package/lib/commonjs/specs/ARView.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARVolume.nitro.js +6 -0
- package/lib/commonjs/specs/ARVolume.nitro.js.map +1 -0
- package/lib/commonjs/specs/ARWorldMap.nitro.js +6 -0
- package/lib/commonjs/specs/ARWorldMap.nitro.js.map +1 -0
- package/lib/module/index.js +18 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/ARAnchor.nitro.js +4 -0
- package/lib/module/specs/ARAnchor.nitro.js.map +1 -0
- package/lib/module/specs/ARBoundingBoxBuilder.nitro.js +4 -0
- package/lib/module/specs/ARBoundingBoxBuilder.nitro.js.map +1 -0
- package/lib/module/specs/ARDepthData.nitro.js +4 -0
- package/lib/module/specs/ARDepthData.nitro.js.map +1 -0
- package/lib/module/specs/ARFrame.nitro.js +4 -0
- package/lib/module/specs/ARFrame.nitro.js.map +1 -0
- package/lib/module/specs/ARLightEstimate.nitro.js +4 -0
- package/lib/module/specs/ARLightEstimate.nitro.js.map +1 -0
- package/lib/module/specs/ARMeasurement.nitro.js +4 -0
- package/lib/module/specs/ARMeasurement.nitro.js.map +1 -0
- package/lib/module/specs/ARPlaneAnchor.nitro.js +4 -0
- package/lib/module/specs/ARPlaneAnchor.nitro.js.map +1 -0
- package/lib/module/specs/ARRaycastResult.nitro.js +4 -0
- package/lib/module/specs/ARRaycastResult.nitro.js.map +1 -0
- package/lib/module/specs/ARSceneMesh.nitro.js +4 -0
- package/lib/module/specs/ARSceneMesh.nitro.js.map +1 -0
- package/lib/module/specs/ARSession.nitro.js +4 -0
- package/lib/module/specs/ARSession.nitro.js.map +1 -0
- package/lib/module/specs/ARView.nitro.js +4 -0
- package/lib/module/specs/ARView.nitro.js.map +1 -0
- package/lib/module/specs/ARVolume.nitro.js +4 -0
- package/lib/module/specs/ARVolume.nitro.js.map +1 -0
- package/lib/module/specs/ARWorldMap.nitro.js +4 -0
- package/lib/module/specs/ARWorldMap.nitro.js.map +1 -0
- package/lib/typescript/src/index.d.ts +20 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARAnchor.nitro.d.ts +18 -0
- package/lib/typescript/src/specs/ARAnchor.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARBoundingBoxBuilder.nitro.d.ts +11 -0
- package/lib/typescript/src/specs/ARBoundingBoxBuilder.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARDepthData.nitro.d.ts +26 -0
- package/lib/typescript/src/specs/ARDepthData.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARFrame.nitro.d.ts +32 -0
- package/lib/typescript/src/specs/ARFrame.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARLightEstimate.nitro.d.ts +18 -0
- package/lib/typescript/src/specs/ARLightEstimate.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARMeasurement.nitro.d.ts +11 -0
- package/lib/typescript/src/specs/ARMeasurement.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARPlaneAnchor.nitro.d.ts +32 -0
- package/lib/typescript/src/specs/ARPlaneAnchor.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARRaycastResult.nitro.d.ts +26 -0
- package/lib/typescript/src/specs/ARRaycastResult.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARSceneMesh.nitro.d.ts +47 -0
- package/lib/typescript/src/specs/ARSceneMesh.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARSession.nitro.d.ts +75 -0
- package/lib/typescript/src/specs/ARSession.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARView.nitro.d.ts +51 -0
- package/lib/typescript/src/specs/ARView.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARVolume.nitro.d.ts +14 -0
- package/lib/typescript/src/specs/ARVolume.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/ARWorldMap.nitro.d.ts +17 -0
- package/lib/typescript/src/specs/ARWorldMap.nitro.d.ts.map +1 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/ios/NitroAR+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroAR-Swift-Cxx-Bridge.cpp +335 -0
- package/nitrogen/generated/ios/NitroAR-Swift-Cxx-Bridge.hpp +934 -0
- package/nitrogen/generated/ios/NitroAR-Swift-Cxx-Umbrella.hpp +169 -0
- package/nitrogen/generated/ios/NitroARAutolinking.mm +49 -0
- package/nitrogen/generated/ios/NitroARAutolinking.swift +50 -0
- package/nitrogen/generated/ios/c++/HybridARAnchorSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARAnchorSpecSwift.hpp +99 -0
- package/nitrogen/generated/ios/c++/HybridARBoundingBoxBuilderSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARBoundingBoxBuilderSpecSwift.hpp +95 -0
- package/nitrogen/generated/ios/c++/HybridARDepthDataSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARDepthDataSpecSwift.hpp +103 -0
- package/nitrogen/generated/ios/c++/HybridARDirectionalLightEstimateSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARDirectionalLightEstimateSpecSwift.hpp +88 -0
- package/nitrogen/generated/ios/c++/HybridARFrameSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARFrameSpecSwift.hpp +135 -0
- package/nitrogen/generated/ios/c++/HybridARLightEstimateSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARLightEstimateSpecSwift.hpp +80 -0
- package/nitrogen/generated/ios/c++/HybridARMeasurementSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARMeasurementSpecSwift.hpp +90 -0
- package/nitrogen/generated/ios/c++/HybridARMeshAnchorSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARMeshAnchorSpecSwift.hpp +107 -0
- package/nitrogen/generated/ios/c++/HybridARPlaneAnchorSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARPlaneAnchorSpecSwift.hpp +116 -0
- package/nitrogen/generated/ios/c++/HybridARPlaneGeometrySpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARPlaneGeometrySpecSwift.hpp +90 -0
- package/nitrogen/generated/ios/c++/HybridARRaycastResultSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARRaycastResultSpecSwift.hpp +97 -0
- package/nitrogen/generated/ios/c++/HybridARSessionSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARSessionSpecSwift.hpp +296 -0
- package/nitrogen/generated/ios/c++/HybridARViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARViewSpecSwift.hpp +243 -0
- package/nitrogen/generated/ios/c++/HybridARVolumeSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARVolumeSpecSwift.hpp +94 -0
- package/nitrogen/generated/ios/c++/HybridARWorldMapSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridARWorldMapSpecSwift.hpp +97 -0
- package/nitrogen/generated/ios/c++/views/HybridARViewComponent.mm +152 -0
- package/nitrogen/generated/ios/swift/ARSessionConfiguration.swift +189 -0
- package/nitrogen/generated/ios/swift/ARViewHitResult.swift +39 -0
- package/nitrogen/generated/ios/swift/CameraPose.swift +46 -0
- package/nitrogen/generated/ios/swift/EnvironmentTexturing.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_TrackingState_TrackingStateReason.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_HybridARFrameSpec_.swift +50 -0
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_HybridARWorldMapSpec_.swift +50 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_HybridARAnchorSpec___std__vector_std__shared_ptr_HybridARAnchorSpec___std__vector_std__string_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_HybridARMeshAnchorSpec___std__vector_std__shared_ptr_HybridARMeshAnchorSpec___std__vector_std__string_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__shared_ptr_HybridARPlaneAnchorSpec___std__vector_std__shared_ptr_HybridARPlaneAnchorSpec___std__vector_std__string_.swift +54 -0
- package/nitrogen/generated/ios/swift/HybridARAnchorSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridARAnchorSpec_cxx.swift +192 -0
- package/nitrogen/generated/ios/swift/HybridARBoundingBoxBuilderSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridARBoundingBoxBuilderSpec_cxx.swift +161 -0
- package/nitrogen/generated/ios/swift/HybridARDepthDataSpec.swift +59 -0
- package/nitrogen/generated/ios/swift/HybridARDepthDataSpec_cxx.swift +188 -0
- package/nitrogen/generated/ios/swift/HybridARDirectionalLightEstimateSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridARDirectionalLightEstimateSpec_cxx.swift +162 -0
- package/nitrogen/generated/ios/swift/HybridARFrameSpec.swift +65 -0
- package/nitrogen/generated/ios/swift/HybridARFrameSpec_cxx.swift +285 -0
- package/nitrogen/generated/ios/swift/HybridARLightEstimateSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridARLightEstimateSpec_cxx.swift +140 -0
- package/nitrogen/generated/ios/swift/HybridARMeasurementSpec.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridARMeasurementSpec_cxx.swift +160 -0
- package/nitrogen/generated/ios/swift/HybridARMeshAnchorSpec.swift +62 -0
- package/nitrogen/generated/ios/swift/HybridARMeshAnchorSpec_cxx.swift +212 -0
- package/nitrogen/generated/ios/swift/HybridARPlaneAnchorSpec.swift +62 -0
- package/nitrogen/generated/ios/swift/HybridARPlaneAnchorSpec_cxx.swift +209 -0
- package/nitrogen/generated/ios/swift/HybridARPlaneGeometrySpec.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridARPlaneGeometrySpec_cxx.swift +178 -0
- package/nitrogen/generated/ios/swift/HybridARRaycastResultSpec.swift +59 -0
- package/nitrogen/generated/ios/swift/HybridARRaycastResultSpec_cxx.swift +179 -0
- package/nitrogen/generated/ios/swift/HybridARSessionSpec.swift +78 -0
- package/nitrogen/generated/ios/swift/HybridARSessionSpec_cxx.swift +591 -0
- package/nitrogen/generated/ios/swift/HybridARViewSpec.swift +78 -0
- package/nitrogen/generated/ios/swift/HybridARViewSpec_cxx.swift +561 -0
- package/nitrogen/generated/ios/swift/HybridARVolumeSpec.swift +60 -0
- package/nitrogen/generated/ios/swift/HybridARVolumeSpec_cxx.swift +180 -0
- package/nitrogen/generated/ios/swift/HybridARWorldMapSpec.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridARWorldMapSpec_cxx.swift +176 -0
- package/nitrogen/generated/ios/swift/LiDARCapabilities.swift +39 -0
- package/nitrogen/generated/ios/swift/MeshClassification.swift +64 -0
- package/nitrogen/generated/ios/swift/PlaneAlignment.swift +40 -0
- package/nitrogen/generated/ios/swift/PlaneClassification.swift +64 -0
- package/nitrogen/generated/ios/swift/PlaneDetectionMode.swift +40 -0
- package/nitrogen/generated/ios/swift/RaycastAlignment.swift +44 -0
- package/nitrogen/generated/ios/swift/RaycastQuery.swift +44 -0
- package/nitrogen/generated/ios/swift/RaycastTarget.swift +48 -0
- package/nitrogen/generated/ios/swift/SceneReconstructionMode.swift +44 -0
- package/nitrogen/generated/ios/swift/TrackingState.swift +44 -0
- package/nitrogen/generated/ios/swift/TrackingStateReason.swift +52 -0
- package/nitrogen/generated/ios/swift/WorldAlignment.swift +44 -0
- package/nitrogen/generated/ios/swift/WorldMappingStatus.swift +48 -0
- package/nitrogen/generated/shared/c++/ARSessionConfiguration.hpp +132 -0
- package/nitrogen/generated/shared/c++/ARViewHitResult.hpp +91 -0
- package/nitrogen/generated/shared/c++/CameraPose.hpp +87 -0
- package/nitrogen/generated/shared/c++/EnvironmentTexturing.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridARAnchorSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridARAnchorSpec.hpp +69 -0
- package/nitrogen/generated/shared/c++/HybridARBoundingBoxBuilderSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridARBoundingBoxBuilderSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/HybridARDepthDataSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridARDepthDataSpec.hpp +66 -0
- package/nitrogen/generated/shared/c++/HybridARDirectionalLightEstimateSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridARDirectionalLightEstimateSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridARFrameSpec.cpp +32 -0
- package/nitrogen/generated/shared/c++/HybridARFrameSpec.hpp +83 -0
- package/nitrogen/generated/shared/c++/HybridARLightEstimateSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridARLightEstimateSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridARMeasurementSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridARMeasurementSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridARMeshAnchorSpec.cpp +28 -0
- package/nitrogen/generated/shared/c++/HybridARMeshAnchorSpec.hpp +72 -0
- package/nitrogen/generated/shared/c++/HybridARPlaneAnchorSpec.cpp +28 -0
- package/nitrogen/generated/shared/c++/HybridARPlaneAnchorSpec.hpp +79 -0
- package/nitrogen/generated/shared/c++/HybridARPlaneGeometrySpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridARPlaneGeometrySpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridARRaycastResultSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridARRaycastResultSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridARSessionSpec.cpp +45 -0
- package/nitrogen/generated/shared/c++/HybridARSessionSpec.hpp +131 -0
- package/nitrogen/generated/shared/c++/HybridARViewSpec.cpp +55 -0
- package/nitrogen/generated/shared/c++/HybridARViewSpec.hpp +101 -0
- package/nitrogen/generated/shared/c++/HybridARVolumeSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridARVolumeSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridARWorldMapSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridARWorldMapSpec.hpp +66 -0
- package/nitrogen/generated/shared/c++/LiDARCapabilities.hpp +91 -0
- package/nitrogen/generated/shared/c++/MeshClassification.hpp +100 -0
- package/nitrogen/generated/shared/c++/PlaneAlignment.hpp +76 -0
- package/nitrogen/generated/shared/c++/PlaneClassification.hpp +100 -0
- package/nitrogen/generated/shared/c++/PlaneDetectionMode.hpp +76 -0
- package/nitrogen/generated/shared/c++/RaycastAlignment.hpp +80 -0
- package/nitrogen/generated/shared/c++/RaycastQuery.hpp +99 -0
- package/nitrogen/generated/shared/c++/RaycastTarget.hpp +84 -0
- package/nitrogen/generated/shared/c++/SceneReconstructionMode.hpp +80 -0
- package/nitrogen/generated/shared/c++/TrackingState.hpp +80 -0
- package/nitrogen/generated/shared/c++/TrackingStateReason.hpp +88 -0
- package/nitrogen/generated/shared/c++/WorldAlignment.hpp +80 -0
- package/nitrogen/generated/shared/c++/WorldMappingStatus.hpp +84 -0
- package/nitrogen/generated/shared/c++/views/HybridARViewComponent.cpp +182 -0
- package/nitrogen/generated/shared/c++/views/HybridARViewComponent.hpp +120 -0
- package/nitrogen/generated/shared/json/ARViewConfig.json +19 -0
- package/package.json +98 -0
- package/react-native-nitro-ar.podspec +40 -0
- package/src/index.ts +60 -0
- package/src/specs/ARAnchor.nitro.ts +21 -0
- package/src/specs/ARBoundingBoxBuilder.nitro.ts +11 -0
- package/src/specs/ARDepthData.nitro.ts +29 -0
- package/src/specs/ARFrame.nitro.ts +41 -0
- package/src/specs/ARLightEstimate.nitro.ts +20 -0
- package/src/specs/ARMeasurement.nitro.ts +10 -0
- package/src/specs/ARPlaneAnchor.nitro.ts +46 -0
- package/src/specs/ARRaycastResult.nitro.ts +32 -0
- package/src/specs/ARSceneMesh.nitro.ts +63 -0
- package/src/specs/ARSession.nitro.ts +112 -0
- package/src/specs/ARView.nitro.ts +84 -0
- package/src/specs/ARVolume.nitro.ts +15 -0
- package/src/specs/ARWorldMap.nitro.ts +20 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridARFrameSpec_cxx.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
|
+
* A class implementation that bridges HybridARFrameSpec over to C++.
|
|
12
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
13
|
+
*
|
|
14
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
15
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
16
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
17
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
18
|
+
*/
|
|
19
|
+
open class HybridARFrameSpec_cxx {
|
|
20
|
+
/**
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::ar::bridge::swift`)
|
|
22
|
+
* from `NitroAR-Swift-Cxx-Bridge.hpp`.
|
|
23
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
|
+
*/
|
|
25
|
+
public typealias bridge = margelo.nitro.ar.bridge.swift
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Holds an instance of the `HybridARFrameSpec` Swift protocol.
|
|
29
|
+
*/
|
|
30
|
+
private var __implementation: any HybridARFrameSpec
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
34
|
+
*/
|
|
35
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridARFrameSpec_
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a new `HybridARFrameSpec_cxx` that wraps the given `HybridARFrameSpec`.
|
|
39
|
+
* All properties and methods bridge to C++ types.
|
|
40
|
+
*/
|
|
41
|
+
public init(_ implementation: any HybridARFrameSpec) {
|
|
42
|
+
self.__implementation = implementation
|
|
43
|
+
self.__cxxPart = .init()
|
|
44
|
+
/* no base class */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the actual `HybridARFrameSpec` instance this class wraps.
|
|
49
|
+
*/
|
|
50
|
+
@inline(__always)
|
|
51
|
+
public func getHybridARFrameSpec() -> any HybridARFrameSpec {
|
|
52
|
+
return __implementation
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
57
|
+
* This acquires one additional strong reference on the object!
|
|
58
|
+
*/
|
|
59
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
60
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Casts an unsafe pointer to a `HybridARFrameSpec_cxx`.
|
|
65
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridARFrameSpec_cxx>`.
|
|
66
|
+
* This removes one strong reference from the object!
|
|
67
|
+
*/
|
|
68
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridARFrameSpec_cxx {
|
|
69
|
+
return Unmanaged<HybridARFrameSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
74
|
+
* The C++ part is a `std::shared_ptr<HybridARFrameSpec>`.
|
|
75
|
+
*/
|
|
76
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridARFrameSpec_ {
|
|
77
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
79
|
+
return cachedCxxPart
|
|
80
|
+
} else {
|
|
81
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridARFrameSpec_(self.toUnsafe())
|
|
82
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridARFrameSpec_(newCxxPart)
|
|
83
|
+
return newCxxPart
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
91
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
92
|
+
*/
|
|
93
|
+
@inline(__always)
|
|
94
|
+
public var memorySize: Int {
|
|
95
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Compares this object with the given [other] object for reference equality.
|
|
100
|
+
*/
|
|
101
|
+
@inline(__always)
|
|
102
|
+
public func equals(other: HybridARFrameSpec_cxx) -> Bool {
|
|
103
|
+
return self.__implementation === other.__implementation
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Call dispose() on the Swift class.
|
|
108
|
+
* This _may_ be called manually from JS.
|
|
109
|
+
*/
|
|
110
|
+
@inline(__always)
|
|
111
|
+
public func dispose() {
|
|
112
|
+
self.__implementation.dispose()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Call toString() on the Swift class.
|
|
117
|
+
*/
|
|
118
|
+
@inline(__always)
|
|
119
|
+
public func toString() -> String {
|
|
120
|
+
return self.__implementation.toString()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Properties
|
|
124
|
+
public final var timestamp: Double {
|
|
125
|
+
@inline(__always)
|
|
126
|
+
get {
|
|
127
|
+
return self.__implementation.timestamp
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public final var cameraPosition: bridge.std__vector_double_ {
|
|
132
|
+
@inline(__always)
|
|
133
|
+
get {
|
|
134
|
+
return { () -> bridge.std__vector_double_ in
|
|
135
|
+
var __vector = bridge.create_std__vector_double_(self.__implementation.cameraPosition.count)
|
|
136
|
+
for __item in self.__implementation.cameraPosition {
|
|
137
|
+
__vector.push_back(__item)
|
|
138
|
+
}
|
|
139
|
+
return __vector
|
|
140
|
+
}()
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public final var cameraRotation: bridge.std__vector_double_ {
|
|
145
|
+
@inline(__always)
|
|
146
|
+
get {
|
|
147
|
+
return { () -> bridge.std__vector_double_ in
|
|
148
|
+
var __vector = bridge.create_std__vector_double_(self.__implementation.cameraRotation.count)
|
|
149
|
+
for __item in self.__implementation.cameraRotation {
|
|
150
|
+
__vector.push_back(__item)
|
|
151
|
+
}
|
|
152
|
+
return __vector
|
|
153
|
+
}()
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public final var projectionMatrix: bridge.std__vector_double_ {
|
|
158
|
+
@inline(__always)
|
|
159
|
+
get {
|
|
160
|
+
return { () -> bridge.std__vector_double_ in
|
|
161
|
+
var __vector = bridge.create_std__vector_double_(self.__implementation.projectionMatrix.count)
|
|
162
|
+
for __item in self.__implementation.projectionMatrix {
|
|
163
|
+
__vector.push_back(__item)
|
|
164
|
+
}
|
|
165
|
+
return __vector
|
|
166
|
+
}()
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
public final var viewMatrix: bridge.std__vector_double_ {
|
|
171
|
+
@inline(__always)
|
|
172
|
+
get {
|
|
173
|
+
return { () -> bridge.std__vector_double_ in
|
|
174
|
+
var __vector = bridge.create_std__vector_double_(self.__implementation.viewMatrix.count)
|
|
175
|
+
for __item in self.__implementation.viewMatrix {
|
|
176
|
+
__vector.push_back(__item)
|
|
177
|
+
}
|
|
178
|
+
return __vector
|
|
179
|
+
}()
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
public final var cameraIntrinsics: bridge.std__vector_double_ {
|
|
184
|
+
@inline(__always)
|
|
185
|
+
get {
|
|
186
|
+
return { () -> bridge.std__vector_double_ in
|
|
187
|
+
var __vector = bridge.create_std__vector_double_(self.__implementation.cameraIntrinsics.count)
|
|
188
|
+
for __item in self.__implementation.cameraIntrinsics {
|
|
189
|
+
__vector.push_back(__item)
|
|
190
|
+
}
|
|
191
|
+
return __vector
|
|
192
|
+
}()
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
public final var imageResolution: bridge.std__vector_double_ {
|
|
197
|
+
@inline(__always)
|
|
198
|
+
get {
|
|
199
|
+
return { () -> bridge.std__vector_double_ in
|
|
200
|
+
var __vector = bridge.create_std__vector_double_(self.__implementation.imageResolution.count)
|
|
201
|
+
for __item in self.__implementation.imageResolution {
|
|
202
|
+
__vector.push_back(__item)
|
|
203
|
+
}
|
|
204
|
+
return __vector
|
|
205
|
+
}()
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
public final var lightEstimate: bridge.std__optional_std__shared_ptr_HybridARLightEstimateSpec__ {
|
|
210
|
+
@inline(__always)
|
|
211
|
+
get {
|
|
212
|
+
return { () -> bridge.std__optional_std__shared_ptr_HybridARLightEstimateSpec__ in
|
|
213
|
+
if let __unwrappedValue = self.__implementation.lightEstimate {
|
|
214
|
+
return bridge.create_std__optional_std__shared_ptr_HybridARLightEstimateSpec__({ () -> bridge.std__shared_ptr_HybridARLightEstimateSpec_ in
|
|
215
|
+
let __cxxWrapped = __unwrappedValue.getCxxWrapper()
|
|
216
|
+
return __cxxWrapped.getCxxPart()
|
|
217
|
+
}())
|
|
218
|
+
} else {
|
|
219
|
+
return .init()
|
|
220
|
+
}
|
|
221
|
+
}()
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
public final var directionalLightEstimate: bridge.std__optional_std__shared_ptr_HybridARDirectionalLightEstimateSpec__ {
|
|
226
|
+
@inline(__always)
|
|
227
|
+
get {
|
|
228
|
+
return { () -> bridge.std__optional_std__shared_ptr_HybridARDirectionalLightEstimateSpec__ in
|
|
229
|
+
if let __unwrappedValue = self.__implementation.directionalLightEstimate {
|
|
230
|
+
return bridge.create_std__optional_std__shared_ptr_HybridARDirectionalLightEstimateSpec__({ () -> bridge.std__shared_ptr_HybridARDirectionalLightEstimateSpec_ in
|
|
231
|
+
let __cxxWrapped = __unwrappedValue.getCxxWrapper()
|
|
232
|
+
return __cxxWrapped.getCxxPart()
|
|
233
|
+
}())
|
|
234
|
+
} else {
|
|
235
|
+
return .init()
|
|
236
|
+
}
|
|
237
|
+
}()
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
public final var sceneDepth: bridge.std__optional_std__shared_ptr_HybridARDepthDataSpec__ {
|
|
242
|
+
@inline(__always)
|
|
243
|
+
get {
|
|
244
|
+
return { () -> bridge.std__optional_std__shared_ptr_HybridARDepthDataSpec__ in
|
|
245
|
+
if let __unwrappedValue = self.__implementation.sceneDepth {
|
|
246
|
+
return bridge.create_std__optional_std__shared_ptr_HybridARDepthDataSpec__({ () -> bridge.std__shared_ptr_HybridARDepthDataSpec_ in
|
|
247
|
+
let __cxxWrapped = __unwrappedValue.getCxxWrapper()
|
|
248
|
+
return __cxxWrapped.getCxxPart()
|
|
249
|
+
}())
|
|
250
|
+
} else {
|
|
251
|
+
return .init()
|
|
252
|
+
}
|
|
253
|
+
}()
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
public final var smoothedSceneDepth: bridge.std__optional_std__shared_ptr_HybridARDepthDataSpec__ {
|
|
258
|
+
@inline(__always)
|
|
259
|
+
get {
|
|
260
|
+
return { () -> bridge.std__optional_std__shared_ptr_HybridARDepthDataSpec__ in
|
|
261
|
+
if let __unwrappedValue = self.__implementation.smoothedSceneDepth {
|
|
262
|
+
return bridge.create_std__optional_std__shared_ptr_HybridARDepthDataSpec__({ () -> bridge.std__shared_ptr_HybridARDepthDataSpec_ in
|
|
263
|
+
let __cxxWrapped = __unwrappedValue.getCxxWrapper()
|
|
264
|
+
return __cxxWrapped.getCxxPart()
|
|
265
|
+
}())
|
|
266
|
+
} else {
|
|
267
|
+
return .init()
|
|
268
|
+
}
|
|
269
|
+
}()
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Methods
|
|
274
|
+
@inline(__always)
|
|
275
|
+
public final func getCapturedImage(quality: Double) -> bridge.Result_std__string_ {
|
|
276
|
+
do {
|
|
277
|
+
let __result = try self.__implementation.getCapturedImage(quality: quality)
|
|
278
|
+
let __resultCpp = std.string(__result)
|
|
279
|
+
return bridge.create_Result_std__string_(__resultCpp)
|
|
280
|
+
} catch (let __error) {
|
|
281
|
+
let __exceptionPtr = __error.toCpp()
|
|
282
|
+
return bridge.create_Result_std__string_(__exceptionPtr)
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridARLightEstimateSpec.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
|
+
/// See ``HybridARLightEstimateSpec``
|
|
11
|
+
public protocol HybridARLightEstimateSpec_protocol: HybridObject {
|
|
12
|
+
// Properties
|
|
13
|
+
var ambientIntensity: Double { get }
|
|
14
|
+
var ambientColorTemperature: Double { get }
|
|
15
|
+
|
|
16
|
+
// Methods
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public extension HybridARLightEstimateSpec_protocol {
|
|
21
|
+
/// Default implementation of ``HybridObject.toString``
|
|
22
|
+
func toString() -> String {
|
|
23
|
+
return "[HybridObject ARLightEstimate]"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/// See ``HybridARLightEstimateSpec``
|
|
28
|
+
open class HybridARLightEstimateSpec_base {
|
|
29
|
+
private weak var cxxWrapper: HybridARLightEstimateSpec_cxx? = nil
|
|
30
|
+
public init() { }
|
|
31
|
+
public func getCxxWrapper() -> HybridARLightEstimateSpec_cxx {
|
|
32
|
+
#if DEBUG
|
|
33
|
+
guard self is any HybridARLightEstimateSpec else {
|
|
34
|
+
fatalError("`self` is not a `HybridARLightEstimateSpec`! Did you accidentally inherit from `HybridARLightEstimateSpec_base` instead of `HybridARLightEstimateSpec`?")
|
|
35
|
+
}
|
|
36
|
+
#endif
|
|
37
|
+
if let cxxWrapper = self.cxxWrapper {
|
|
38
|
+
return cxxWrapper
|
|
39
|
+
} else {
|
|
40
|
+
let cxxWrapper = HybridARLightEstimateSpec_cxx(self as! any HybridARLightEstimateSpec)
|
|
41
|
+
self.cxxWrapper = cxxWrapper
|
|
42
|
+
return cxxWrapper
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A Swift base-protocol representing the ARLightEstimate HybridObject.
|
|
49
|
+
* Implement this protocol to create Swift-based instances of ARLightEstimate.
|
|
50
|
+
* ```swift
|
|
51
|
+
* class HybridARLightEstimate : HybridARLightEstimateSpec {
|
|
52
|
+
* // ...
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
public typealias HybridARLightEstimateSpec = HybridARLightEstimateSpec_protocol & HybridARLightEstimateSpec_base
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridARLightEstimateSpec_cxx.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
|
+
* A class implementation that bridges HybridARLightEstimateSpec over to C++.
|
|
12
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
13
|
+
*
|
|
14
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
15
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
16
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
17
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
18
|
+
*/
|
|
19
|
+
open class HybridARLightEstimateSpec_cxx {
|
|
20
|
+
/**
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::ar::bridge::swift`)
|
|
22
|
+
* from `NitroAR-Swift-Cxx-Bridge.hpp`.
|
|
23
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
|
+
*/
|
|
25
|
+
public typealias bridge = margelo.nitro.ar.bridge.swift
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Holds an instance of the `HybridARLightEstimateSpec` Swift protocol.
|
|
29
|
+
*/
|
|
30
|
+
private var __implementation: any HybridARLightEstimateSpec
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
34
|
+
*/
|
|
35
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridARLightEstimateSpec_
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a new `HybridARLightEstimateSpec_cxx` that wraps the given `HybridARLightEstimateSpec`.
|
|
39
|
+
* All properties and methods bridge to C++ types.
|
|
40
|
+
*/
|
|
41
|
+
public init(_ implementation: any HybridARLightEstimateSpec) {
|
|
42
|
+
self.__implementation = implementation
|
|
43
|
+
self.__cxxPart = .init()
|
|
44
|
+
/* no base class */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the actual `HybridARLightEstimateSpec` instance this class wraps.
|
|
49
|
+
*/
|
|
50
|
+
@inline(__always)
|
|
51
|
+
public func getHybridARLightEstimateSpec() -> any HybridARLightEstimateSpec {
|
|
52
|
+
return __implementation
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
57
|
+
* This acquires one additional strong reference on the object!
|
|
58
|
+
*/
|
|
59
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
60
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Casts an unsafe pointer to a `HybridARLightEstimateSpec_cxx`.
|
|
65
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridARLightEstimateSpec_cxx>`.
|
|
66
|
+
* This removes one strong reference from the object!
|
|
67
|
+
*/
|
|
68
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridARLightEstimateSpec_cxx {
|
|
69
|
+
return Unmanaged<HybridARLightEstimateSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
74
|
+
* The C++ part is a `std::shared_ptr<HybridARLightEstimateSpec>`.
|
|
75
|
+
*/
|
|
76
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridARLightEstimateSpec_ {
|
|
77
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
79
|
+
return cachedCxxPart
|
|
80
|
+
} else {
|
|
81
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridARLightEstimateSpec_(self.toUnsafe())
|
|
82
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridARLightEstimateSpec_(newCxxPart)
|
|
83
|
+
return newCxxPart
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
91
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
92
|
+
*/
|
|
93
|
+
@inline(__always)
|
|
94
|
+
public var memorySize: Int {
|
|
95
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Compares this object with the given [other] object for reference equality.
|
|
100
|
+
*/
|
|
101
|
+
@inline(__always)
|
|
102
|
+
public func equals(other: HybridARLightEstimateSpec_cxx) -> Bool {
|
|
103
|
+
return self.__implementation === other.__implementation
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Call dispose() on the Swift class.
|
|
108
|
+
* This _may_ be called manually from JS.
|
|
109
|
+
*/
|
|
110
|
+
@inline(__always)
|
|
111
|
+
public func dispose() {
|
|
112
|
+
self.__implementation.dispose()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Call toString() on the Swift class.
|
|
117
|
+
*/
|
|
118
|
+
@inline(__always)
|
|
119
|
+
public func toString() -> String {
|
|
120
|
+
return self.__implementation.toString()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Properties
|
|
124
|
+
public final var ambientIntensity: Double {
|
|
125
|
+
@inline(__always)
|
|
126
|
+
get {
|
|
127
|
+
return self.__implementation.ambientIntensity
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public final var ambientColorTemperature: Double {
|
|
132
|
+
@inline(__always)
|
|
133
|
+
get {
|
|
134
|
+
return self.__implementation.ambientColorTemperature
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Methods
|
|
139
|
+
|
|
140
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridARMeasurementSpec.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
|
+
/// See ``HybridARMeasurementSpec``
|
|
11
|
+
public protocol HybridARMeasurementSpec_protocol: HybridObject {
|
|
12
|
+
// Properties
|
|
13
|
+
var start: (any HybridARAnchorSpec) { get }
|
|
14
|
+
var end: (any HybridARAnchorSpec) { get }
|
|
15
|
+
var length: Double { get }
|
|
16
|
+
var isValid: Bool { get }
|
|
17
|
+
|
|
18
|
+
// Methods
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public extension HybridARMeasurementSpec_protocol {
|
|
23
|
+
/// Default implementation of ``HybridObject.toString``
|
|
24
|
+
func toString() -> String {
|
|
25
|
+
return "[HybridObject ARMeasurement]"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/// See ``HybridARMeasurementSpec``
|
|
30
|
+
open class HybridARMeasurementSpec_base {
|
|
31
|
+
private weak var cxxWrapper: HybridARMeasurementSpec_cxx? = nil
|
|
32
|
+
public init() { }
|
|
33
|
+
public func getCxxWrapper() -> HybridARMeasurementSpec_cxx {
|
|
34
|
+
#if DEBUG
|
|
35
|
+
guard self is any HybridARMeasurementSpec else {
|
|
36
|
+
fatalError("`self` is not a `HybridARMeasurementSpec`! Did you accidentally inherit from `HybridARMeasurementSpec_base` instead of `HybridARMeasurementSpec`?")
|
|
37
|
+
}
|
|
38
|
+
#endif
|
|
39
|
+
if let cxxWrapper = self.cxxWrapper {
|
|
40
|
+
return cxxWrapper
|
|
41
|
+
} else {
|
|
42
|
+
let cxxWrapper = HybridARMeasurementSpec_cxx(self as! any HybridARMeasurementSpec)
|
|
43
|
+
self.cxxWrapper = cxxWrapper
|
|
44
|
+
return cxxWrapper
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A Swift base-protocol representing the ARMeasurement HybridObject.
|
|
51
|
+
* Implement this protocol to create Swift-based instances of ARMeasurement.
|
|
52
|
+
* ```swift
|
|
53
|
+
* class HybridARMeasurement : HybridARMeasurementSpec {
|
|
54
|
+
* // ...
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
public typealias HybridARMeasurementSpec = HybridARMeasurementSpec_protocol & HybridARMeasurementSpec_base
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridARMeasurementSpec_cxx.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
|
+
* A class implementation that bridges HybridARMeasurementSpec over to C++.
|
|
12
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
13
|
+
*
|
|
14
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
15
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
16
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
17
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
18
|
+
*/
|
|
19
|
+
open class HybridARMeasurementSpec_cxx {
|
|
20
|
+
/**
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::ar::bridge::swift`)
|
|
22
|
+
* from `NitroAR-Swift-Cxx-Bridge.hpp`.
|
|
23
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
|
+
*/
|
|
25
|
+
public typealias bridge = margelo.nitro.ar.bridge.swift
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Holds an instance of the `HybridARMeasurementSpec` Swift protocol.
|
|
29
|
+
*/
|
|
30
|
+
private var __implementation: any HybridARMeasurementSpec
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
34
|
+
*/
|
|
35
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridARMeasurementSpec_
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a new `HybridARMeasurementSpec_cxx` that wraps the given `HybridARMeasurementSpec`.
|
|
39
|
+
* All properties and methods bridge to C++ types.
|
|
40
|
+
*/
|
|
41
|
+
public init(_ implementation: any HybridARMeasurementSpec) {
|
|
42
|
+
self.__implementation = implementation
|
|
43
|
+
self.__cxxPart = .init()
|
|
44
|
+
/* no base class */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the actual `HybridARMeasurementSpec` instance this class wraps.
|
|
49
|
+
*/
|
|
50
|
+
@inline(__always)
|
|
51
|
+
public func getHybridARMeasurementSpec() -> any HybridARMeasurementSpec {
|
|
52
|
+
return __implementation
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
57
|
+
* This acquires one additional strong reference on the object!
|
|
58
|
+
*/
|
|
59
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
60
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Casts an unsafe pointer to a `HybridARMeasurementSpec_cxx`.
|
|
65
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridARMeasurementSpec_cxx>`.
|
|
66
|
+
* This removes one strong reference from the object!
|
|
67
|
+
*/
|
|
68
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridARMeasurementSpec_cxx {
|
|
69
|
+
return Unmanaged<HybridARMeasurementSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
74
|
+
* The C++ part is a `std::shared_ptr<HybridARMeasurementSpec>`.
|
|
75
|
+
*/
|
|
76
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridARMeasurementSpec_ {
|
|
77
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
79
|
+
return cachedCxxPart
|
|
80
|
+
} else {
|
|
81
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridARMeasurementSpec_(self.toUnsafe())
|
|
82
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridARMeasurementSpec_(newCxxPart)
|
|
83
|
+
return newCxxPart
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
91
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
92
|
+
*/
|
|
93
|
+
@inline(__always)
|
|
94
|
+
public var memorySize: Int {
|
|
95
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Compares this object with the given [other] object for reference equality.
|
|
100
|
+
*/
|
|
101
|
+
@inline(__always)
|
|
102
|
+
public func equals(other: HybridARMeasurementSpec_cxx) -> Bool {
|
|
103
|
+
return self.__implementation === other.__implementation
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Call dispose() on the Swift class.
|
|
108
|
+
* This _may_ be called manually from JS.
|
|
109
|
+
*/
|
|
110
|
+
@inline(__always)
|
|
111
|
+
public func dispose() {
|
|
112
|
+
self.__implementation.dispose()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Call toString() on the Swift class.
|
|
117
|
+
*/
|
|
118
|
+
@inline(__always)
|
|
119
|
+
public func toString() -> String {
|
|
120
|
+
return self.__implementation.toString()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Properties
|
|
124
|
+
public final var start: bridge.std__shared_ptr_HybridARAnchorSpec_ {
|
|
125
|
+
@inline(__always)
|
|
126
|
+
get {
|
|
127
|
+
return { () -> bridge.std__shared_ptr_HybridARAnchorSpec_ in
|
|
128
|
+
let __cxxWrapped = self.__implementation.start.getCxxWrapper()
|
|
129
|
+
return __cxxWrapped.getCxxPart()
|
|
130
|
+
}()
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
public final var end: bridge.std__shared_ptr_HybridARAnchorSpec_ {
|
|
135
|
+
@inline(__always)
|
|
136
|
+
get {
|
|
137
|
+
return { () -> bridge.std__shared_ptr_HybridARAnchorSpec_ in
|
|
138
|
+
let __cxxWrapped = self.__implementation.end.getCxxWrapper()
|
|
139
|
+
return __cxxWrapped.getCxxPart()
|
|
140
|
+
}()
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public final var length: Double {
|
|
145
|
+
@inline(__always)
|
|
146
|
+
get {
|
|
147
|
+
return self.__implementation.length
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
public final var isValid: Bool {
|
|
152
|
+
@inline(__always)
|
|
153
|
+
get {
|
|
154
|
+
return self.__implementation.isValid
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Methods
|
|
159
|
+
|
|
160
|
+
}
|