react-native-image-stitcher 0.14.2 → 0.15.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/CHANGELOG.md +164 -0
- package/README.md +35 -0
- package/RNImageStitcher.podspec +8 -7
- package/android/build.gradle +0 -16
- package/android/src/main/cpp/CMakeLists.txt +2 -63
- package/android/src/main/cpp/image_stitcher_jni.cpp +14 -0
- package/android/src/main/cpp/keyframe_gate_jni.cpp +13 -0
- package/android/src/main/java/io/imagestitcher/rn/BatchStitcher.kt +285 -3
- package/android/src/main/java/io/imagestitcher/rn/IncrementalStitcher.kt +180 -1162
- package/android/src/main/java/io/imagestitcher/rn/KeyframeGate.kt +29 -0
- package/android/src/main/java/io/imagestitcher/rn/RNImageStitcherPackage.kt +0 -4
- package/android/src/main/java/io/imagestitcher/rn/RNSARCameraView.kt +129 -71
- package/android/src/main/java/io/imagestitcher/rn/RNSARSession.kt +49 -0
- package/cpp/keyframe_gate.cpp +82 -23
- package/cpp/keyframe_gate.hpp +31 -2
- package/cpp/stitcher.cpp +208 -28
- package/cpp/tests/CMakeLists.txt +18 -12
- package/cpp/tests/keyframe_timebudget_test.cpp +65 -0
- package/cpp/tests/warp_guard_test.cpp +48 -0
- package/cpp/warp_guard.hpp +41 -0
- package/dist/camera/Camera.d.ts +31 -16
- package/dist/camera/Camera.js +11 -3
- package/dist/camera/CameraView.js +93 -3
- package/dist/camera/CaptureStitchStatsToast.d.ts +15 -2
- package/dist/camera/CaptureStitchStatsToast.js +27 -7
- package/dist/camera/PanoramaSettings.d.ts +10 -223
- package/dist/camera/PanoramaSettings.js +6 -28
- package/dist/camera/PanoramaSettingsBridge.d.ts +1 -24
- package/dist/camera/PanoramaSettingsBridge.js +3 -102
- package/dist/camera/PanoramaSettingsModal.js +7 -1
- package/dist/camera/buildPanoramaInitialSettings.d.ts +11 -0
- package/dist/camera/buildPanoramaInitialSettings.js +4 -0
- package/dist/camera/cameraErrorMessages.d.ts +32 -0
- package/dist/camera/cameraErrorMessages.js +53 -0
- package/dist/camera/selectCaptureDevice.d.ts +5 -1
- package/dist/camera/selectCaptureDevice.js +22 -2
- package/dist/camera/useCapture.js +38 -0
- package/dist/index.d.ts +5 -8
- package/dist/index.js +11 -34
- package/dist/stitching/incremental.d.ts +1 -117
- package/dist/stitching/stitchVideo.d.ts +0 -35
- package/dist/types.d.ts +0 -87
- package/ios/Sources/RNImageStitcher/IncrementalStitcher.swift +96 -674
- package/ios/Sources/RNImageStitcher/IncrementalStitcherBridge.swift +9 -12
- package/ios/Sources/RNImageStitcher/KeyframeGate.swift +14 -0
- package/ios/Sources/RNImageStitcher/KeyframeGateBridge.h +7 -0
- package/ios/Sources/RNImageStitcher/KeyframeGateBridge.mm +6 -0
- package/ios/Sources/RNImageStitcher/OpenCVKeyframeCollector.h +2 -2
- package/ios/Sources/RNImageStitcher/OpenCVKeyframeCollector.mm +3 -3
- package/ios/Sources/RNImageStitcher/OpenCVStitcher.h +28 -60
- package/ios/Sources/RNImageStitcher/OpenCVStitcher.mm +180 -921
- package/ios/Sources/RNImageStitcher/RNSARCameraView.swift +82 -7
- package/ios/Sources/RNImageStitcher/RNSARSession.swift +10 -35
- package/ios/Sources/RNImageStitcher/Stitcher.swift +84 -35
- package/ios/Sources/RNImageStitcher/StitcherBridge.m +13 -0
- package/ios/Sources/RNImageStitcher/StitcherBridge.swift +132 -5
- package/package.json +3 -2
- package/src/camera/Camera.tsx +44 -23
- package/src/camera/CameraView.tsx +113 -4
- package/src/camera/CaptureStitchStatsToast.tsx +58 -14
- package/src/camera/PanoramaSettings.ts +16 -289
- package/src/camera/PanoramaSettingsBridge.ts +3 -114
- package/src/camera/PanoramaSettingsModal.tsx +14 -1
- package/src/camera/__tests__/PanoramaSettingsBridge.test.ts +3 -188
- package/src/camera/__tests__/buildPanoramaInitialSettings.test.ts +41 -0
- package/src/camera/__tests__/cameraErrorMessages.test.ts +76 -0
- package/src/camera/__tests__/selectCaptureDevice.test.ts +33 -0
- package/src/camera/buildPanoramaInitialSettings.ts +17 -0
- package/src/camera/cameraErrorMessages.ts +84 -0
- package/src/camera/selectCaptureDevice.ts +28 -3
- package/src/camera/useCapture.ts +44 -1
- package/src/index.ts +11 -40
- package/src/stitching/incremental.ts +3 -140
- package/src/stitching/stitchVideo.ts +0 -26
- package/src/types.ts +0 -95
- package/android/src/main/cpp/stitcher_jsi_install_jni.cpp +0 -227
- package/android/src/main/java/io/imagestitcher/rn/IncrementalFirstwinsEngine.kt +0 -1081
- package/android/src/main/java/io/imagestitcher/rn/StitcherJsiInstallerModule.kt +0 -103
- package/android/src/main/java/io/imagestitcher/rn/StitcherWorkletRuntime.kt +0 -256
- package/cpp/stitcher_frame_jsi.cpp +0 -214
- package/cpp/stitcher_frame_jsi.hpp +0 -108
- package/cpp/stitcher_proxy_jsi.cpp +0 -109
- package/cpp/stitcher_proxy_jsi.hpp +0 -46
- package/cpp/stitcher_worklet_dispatch.cpp +0 -103
- package/cpp/stitcher_worklet_dispatch.hpp +0 -71
- package/cpp/stitcher_worklet_registry.cpp +0 -91
- package/cpp/stitcher_worklet_registry.hpp +0 -146
- package/cpp/tests/stitcher_worklet_registry_test.cpp +0 -195
- package/dist/stitching/IncrementalStitcherView.d.ts +0 -41
- package/dist/stitching/IncrementalStitcherView.js +0 -157
- package/dist/stitching/StitcherWorkletRegistry.d.ts +0 -117
- package/dist/stitching/StitcherWorkletRegistry.js +0 -78
- package/dist/stitching/ensureStitcherProxyInstalled.d.ts +0 -8
- package/dist/stitching/ensureStitcherProxyInstalled.js +0 -81
- package/dist/stitching/useFrameProcessor.d.ts +0 -119
- package/dist/stitching/useFrameProcessor.js +0 -196
- package/dist/stitching/useFrameStream.d.ts +0 -34
- package/dist/stitching/useFrameStream.js +0 -234
- package/dist/stitching/useThrottledFrameProcessor.d.ts +0 -33
- package/dist/stitching/useThrottledFrameProcessor.js +0 -132
- package/ios/Sources/RNImageStitcher/OpenCVIncrementalStitcher.h +0 -474
- package/ios/Sources/RNImageStitcher/OpenCVIncrementalStitcher.mm +0 -1328
- package/ios/Sources/RNImageStitcher/OpenCVSlitScanStitcher.h +0 -103
- package/ios/Sources/RNImageStitcher/OpenCVSlitScanStitcher.mm +0 -3285
- package/ios/Sources/RNImageStitcher/RNSARWorkletRuntime.h +0 -128
- package/ios/Sources/RNImageStitcher/RNSARWorkletRuntime.mm +0 -313
- package/ios/Sources/RNImageStitcher/SaveFrameAsJpegPlugin.mm +0 -185
- package/ios/Sources/RNImageStitcher/StitcherFrameHostObject.h +0 -60
- package/ios/Sources/RNImageStitcher/StitcherFrameHostObject.mm +0 -214
- package/ios/Sources/RNImageStitcher/StitcherJsiInstaller.h +0 -42
- package/ios/Sources/RNImageStitcher/StitcherJsiInstaller.mm +0 -160
- package/src/stitching/IncrementalStitcherView.tsx +0 -198
- package/src/stitching/StitcherWorkletRegistry.ts +0 -156
- package/src/stitching/__tests__/StitcherWorkletRegistry.test.ts +0 -176
- package/src/stitching/__tests__/ensureStitcherProxyInstalled.test.ts +0 -94
- package/src/stitching/__tests__/useThrottledFrameProcessor.test.ts +0 -178
- package/src/stitching/ensureStitcherProxyInstalled.ts +0 -141
- package/src/stitching/useFrameProcessor.ts +0 -226
- package/src/stitching/useFrameStream.ts +0 -271
- package/src/stitching/useThrottledFrameProcessor.ts +0 -145
|
@@ -69,41 +69,6 @@ export interface StitchVideoOptions {
|
|
|
69
69
|
* Right choice on low-RAM devices or with `feather`.
|
|
70
70
|
*/
|
|
71
71
|
seamFinderType?: 'graphcut' | 'skip';
|
|
72
|
-
/**
|
|
73
|
-
* Phase 5: pose-driven stitching. When present and non-empty,
|
|
74
|
-
* the native stitcher skips features → matching → BundleAdjuster
|
|
75
|
-
* and builds cv::detail::CameraParams directly from each pose's
|
|
76
|
-
* intrinsics + quaternion. Each entry has the shape returned
|
|
77
|
-
* by `NativeModules.RNSARSession.snapshotPoseLog()`:
|
|
78
|
-
*
|
|
79
|
-
* { tx, ty, tz, qx, qy, qz, qw,
|
|
80
|
-
* fx, fy, cx, cy,
|
|
81
|
-
* imageWidth, imageHeight,
|
|
82
|
-
* timestampMs, trackingState }
|
|
83
|
-
*
|
|
84
|
-
* Frames whose closest pose is beyond a 100 ms tolerance are
|
|
85
|
-
* dropped before stitching; if fewer than 2 remain the call
|
|
86
|
-
* rejects with `opencv-failed-1032` so the host can fall back
|
|
87
|
-
* to the feature-matched path (re-call `stitchVideo` without
|
|
88
|
-
* `poses`).
|
|
89
|
-
*/
|
|
90
|
-
poses?: Array<{
|
|
91
|
-
tx: number;
|
|
92
|
-
ty: number;
|
|
93
|
-
tz: number;
|
|
94
|
-
qx: number;
|
|
95
|
-
qy: number;
|
|
96
|
-
qz: number;
|
|
97
|
-
qw: number;
|
|
98
|
-
fx: number;
|
|
99
|
-
fy: number;
|
|
100
|
-
cx: number;
|
|
101
|
-
cy: number;
|
|
102
|
-
imageWidth: number;
|
|
103
|
-
imageHeight: number;
|
|
104
|
-
timestampMs: number;
|
|
105
|
-
trackingState: number;
|
|
106
|
-
}>;
|
|
107
72
|
}
|
|
108
73
|
/**
|
|
109
74
|
* Stitch a recorded video file into a single panoramic JPEG.
|
package/dist/types.d.ts
CHANGED
|
@@ -35,93 +35,6 @@ export interface DeviceMetadata {
|
|
|
35
35
|
cameraId: string;
|
|
36
36
|
flashEnabled: boolean;
|
|
37
37
|
}
|
|
38
|
-
/**
|
|
39
|
-
* v0.9.0 Layer 3 — one sampled frame delivered by `useFrameStream`
|
|
40
|
-
* to the JS-thread handler.
|
|
41
|
-
*
|
|
42
|
-
* The JPEG file at `jpegPath` is the stream's own copy. Hosts that
|
|
43
|
-
* need long-term retention MUST copy the file synchronously inside
|
|
44
|
-
* the handler — the same path may be overwritten by a subsequent
|
|
45
|
-
* sample (slot reuse — see the hook's docstring for the rotation
|
|
46
|
-
* policy).
|
|
47
|
-
*/
|
|
48
|
-
export interface SampledFrame {
|
|
49
|
-
/** Absolute filesystem path to the JPEG. No `file://` prefix. */
|
|
50
|
-
jpegPath: string;
|
|
51
|
-
/**
|
|
52
|
-
* Pose at sample time. `translation` is `undefined` in non-AR
|
|
53
|
-
* mode (gyro provides rotation only; no spatial anchor).
|
|
54
|
-
*/
|
|
55
|
-
pose: {
|
|
56
|
-
rotation: [number, number, number, number];
|
|
57
|
-
translation?: [number, number, number];
|
|
58
|
-
};
|
|
59
|
-
/** Frame timestamp (ms; per the v0.8.0 StitcherFrame contract). */
|
|
60
|
-
timestamp: number;
|
|
61
|
-
/** JPEG width / height in pixels. */
|
|
62
|
-
width: number;
|
|
63
|
-
height: number;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* v0.9.0 Layer 3 — options for `useFrameStream`.
|
|
67
|
-
*
|
|
68
|
-
* For worklet-native processing without JPEG roundtrip (OCR via
|
|
69
|
-
* Vision/ML Kit, TFLite ML, LiDAR depth), use
|
|
70
|
-
* `useThrottledFrameProcessor` (Layer 2) instead.
|
|
71
|
-
*/
|
|
72
|
-
export interface FrameStreamOptions {
|
|
73
|
-
/**
|
|
74
|
-
* Target sampling rate in Hertz. Clamped to `[0.5, 10]`. The
|
|
75
|
-
* Layer 2 throttle gate enforces the rate inside the worklet;
|
|
76
|
-
* ticks too close together are dropped silently.
|
|
77
|
-
*
|
|
78
|
-
* Clamp upper bound (10 Hz) is intentionally lower than Layer 2's
|
|
79
|
-
* (30 Hz) — beyond 10 Hz the per-frame JPEG encode + JS-bridge
|
|
80
|
-
* cost dominates the wall-clock budget. Hosts that need higher
|
|
81
|
-
* rates should be on Layer 2 with their own JPEG encoder call
|
|
82
|
-
* (or no JPEG at all).
|
|
83
|
-
*/
|
|
84
|
-
sampleHz: number;
|
|
85
|
-
/**
|
|
86
|
-
* JPEG quality (0-100). Default 75. Clamped silently to
|
|
87
|
-
* `[1, 100]` by the underlying `save_frame_as_jpeg` native plugin.
|
|
88
|
-
*/
|
|
89
|
-
quality?: number;
|
|
90
|
-
/**
|
|
91
|
-
* Directory to write JPEG files into. Defaults to a per-app
|
|
92
|
-
* `<cache>/rnis-frame-stream/` subdirectory. The directory is
|
|
93
|
-
* `mkdir -p`'d on first use; hosts that supply an existing
|
|
94
|
-
* absolute path are responsible for its lifecycle.
|
|
95
|
-
*/
|
|
96
|
-
outputDir?: string;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* v0.9.0 Layer 2 — options for `useThrottledFrameProcessor`.
|
|
100
|
-
*
|
|
101
|
-
* Wraps v0.8.0's `useFrameProcessor` with a monotonic-time throttle
|
|
102
|
-
* gate so the supplied worklet fires at most `sampleHz` times per
|
|
103
|
-
* second. Use for sub-frame-rate worklet-native processing — native
|
|
104
|
-
* OCR (Vision.framework / ML Kit), TFLite ML detection, LiDAR depth
|
|
105
|
-
* processing — where the bbox / depth payloads are small enough to
|
|
106
|
-
* bridge to JS via `runOnJS`.
|
|
107
|
-
*
|
|
108
|
-
* For JS-thread JPEG consumers (file-path OCR libraries, cloud
|
|
109
|
-
* upload, thumbnail UI), use `useFrameStream` (Layer 3) instead.
|
|
110
|
-
*/
|
|
111
|
-
export interface ThrottledFrameProcessorOptions {
|
|
112
|
-
/**
|
|
113
|
-
* Target sampling rate in Hertz. Clamped to `[0.5, 30]`. Inside
|
|
114
|
-
* the worklet a monotonic-time gate enforces the rate; ticks too
|
|
115
|
-
* close together are silently dropped.
|
|
116
|
-
*
|
|
117
|
-
* The clamp upper bound (30 Hz) sits at typical AR rates on
|
|
118
|
-
* mid-range Android devices — beyond that, the host should just
|
|
119
|
-
* use `useFrameProcessor` directly (no throttle). The clamp
|
|
120
|
-
* lower bound (0.5 Hz) prevents accidentally-zero-divide values
|
|
121
|
-
* + matches `useFrameStream`'s convention.
|
|
122
|
-
*/
|
|
123
|
-
sampleHz: number;
|
|
124
|
-
}
|
|
125
38
|
export interface CaptureResult {
|
|
126
39
|
/** Unique device-generated UUID */
|
|
127
40
|
deviceUuid: string;
|