react-native-image-stitcher 0.17.0 → 0.18.0

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/RNImageStitcher.podspec +1 -1
  3. package/android/src/main/cpp/CMakeLists.txt +4 -4
  4. package/android/src/main/cpp/stitcher_jsi_install_jni.cpp +216 -7
  5. package/android/src/main/java/io/imagestitcher/rn/RNSARCameraView.kt +656 -0
  6. package/android/src/main/java/io/imagestitcher/rn/RNSARSession.kt +156 -0
  7. package/android/src/main/java/io/imagestitcher/rn/StitcherJsiInstallerModule.kt +1 -1
  8. package/android/src/main/java/io/imagestitcher/rn/StitcherWorkletRuntime.kt +84 -2
  9. package/cpp/{stitcher_frame_data.hpp → camera_frame_data.hpp} +96 -13
  10. package/cpp/{stitcher_frame_jsi.cpp → camera_frame_jsi.cpp} +154 -11
  11. package/cpp/{stitcher_frame_jsi.hpp → camera_frame_jsi.hpp} +12 -12
  12. package/cpp/stitcher_proxy_jsi.cpp +31 -0
  13. package/cpp/stitcher_proxy_jsi.hpp +16 -0
  14. package/cpp/stitcher_worklet_dispatch.cpp +5 -5
  15. package/cpp/stitcher_worklet_dispatch.hpp +5 -5
  16. package/dist/camera/ARCameraView.d.ts +60 -3
  17. package/dist/camera/ARCameraView.js +68 -1
  18. package/dist/camera/Camera.d.ts +54 -7
  19. package/dist/camera/Camera.js +2 -2
  20. package/dist/index.d.ts +2 -1
  21. package/dist/stitching/ARFrameMeta.d.ts +100 -0
  22. package/dist/stitching/{StitcherFrame.js → ARFrameMeta.js} +1 -1
  23. package/dist/stitching/{StitcherFrame.d.ts → CameraFrame.d.ts} +70 -11
  24. package/dist/stitching/CameraFrame.js +4 -0
  25. package/dist/stitching/useStitcherWorklet.d.ts +4 -4
  26. package/dist/stitching/useStitcherWorklet.js +4 -4
  27. package/ios/Sources/RNImageStitcher/ARSessionBridge.m +23 -1
  28. package/ios/Sources/RNImageStitcher/ARSessionBridge.swift +137 -2
  29. package/ios/Sources/RNImageStitcher/{StitcherFrameHostObject.h → CameraFrameHostObject.h} +26 -3
  30. package/ios/Sources/RNImageStitcher/CameraFrameHostObject.mm +760 -0
  31. package/ios/Sources/RNImageStitcher/RNSARSession.swift +292 -34
  32. package/ios/Sources/RNImageStitcher/RNSARWorkletRuntime.h +2 -2
  33. package/ios/Sources/RNImageStitcher/RNSARWorkletRuntime.mm +4 -4
  34. package/package.json +1 -1
  35. package/src/camera/ARCameraView.tsx +165 -5
  36. package/src/camera/Camera.tsx +69 -7
  37. package/src/index.ts +7 -3
  38. package/src/stitching/ARFrameMeta.ts +107 -0
  39. package/src/stitching/{StitcherFrame.ts → CameraFrame.ts} +79 -11
  40. package/src/stitching/useStitcherWorklet.ts +9 -9
  41. package/ios/Sources/RNImageStitcher/StitcherFrameHostObject.mm +0 -214
@@ -1,6 +1,6 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  //
3
- // StitcherFrameHostObject.h — Obj-C facade for the v0.8.0
3
+ // CameraFrameHostObject.h — Obj-C facade for the v0.8.0
4
4
  // `StitcherFrame` JSI host object. Header is intentionally
5
5
  // Obj-C-only (no `<jsi/jsi.h>` import) so this can land in the
6
6
  // public CocoaPods umbrella without breaking `use_frameworks!` hosts
@@ -30,8 +30,8 @@
30
30
 
31
31
  NS_ASSUME_NONNULL_BEGIN
32
32
 
33
- NS_SWIFT_NAME(StitcherFrameHostObject)
34
- @interface StitcherFrameHostObject : NSObject
33
+ NS_SWIFT_NAME(CameraFrameHostObject)
34
+ @interface CameraFrameHostObject : NSObject
35
35
 
36
36
  /// Construct a host object backed by the supplied ARFrame + pose.
37
37
  /// Retains the ARFrame for the host object's lifetime — caller can
@@ -55,6 +55,29 @@ NS_SWIFT_NAME(StitcherFrameHostObject)
55
55
  /// Returns `NULL` if the host object has been invalidated.
56
56
  - (nullable void *)jsiHostObjectPtr;
57
57
 
58
+ /// Build the LIGHT per-frame AR metadata dictionary for the `onArFrame`
59
+ /// callback (the `ARFrameMeta` TS shape). Distinct from the full
60
+ /// host-object factory above: this copies NO pixel / vertex / face bytes
61
+ /// — only scalars, dimensions, anchor transforms, and mesh COUNTS — so
62
+ /// it's cheap enough to run at the throttled `onArFrame` cadence.
63
+ ///
64
+ /// Gating mirrors the full extraction path: `depth` only when the JS
65
+ /// `enableDepth` flag is on (read from the shared C++ extraction config),
66
+ /// `anchors` only when `enableAnchors`, `mesh` (counts) only when
67
+ /// `enableMesh`. `intrinsics` / `pose` / `trackingState` / `timestamp`
68
+ /// are always populated. `intrinsics` is `NSNull` only when the frame
69
+ /// reported a degenerate (zero) resolution.
70
+ ///
71
+ /// Returns a JSON-safe `NSDictionary` (NSNumber / NSString / NSArray /
72
+ /// NSDictionary / NSNull leaves) ready to hand to
73
+ /// `bridge.enqueueJSCall("RCTDeviceEventEmitter", "emit", ...)`.
74
+ ///
75
+ /// Thread: safe to call from the ARSession delegate queue (reads the
76
+ /// frame synchronously; copies nothing that outlives the call).
77
+ + (NSDictionary *)lightArFrameMetaFromARFrame:(ARFrame *)arFrame
78
+ pose:(RNSARFramePose *)pose
79
+ NS_SWIFT_NAME(lightArFrameMeta(from:pose:));
80
+
58
81
  @end
59
82
 
60
83
  NS_ASSUME_NONNULL_END