react-native-image-stitcher 0.14.2 → 0.15.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.
- package/CHANGELOG.md +131 -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 +13 -64
- 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 +10 -2
- 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/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 +43 -22
- 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
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
-
//
|
|
3
|
-
// OpenCVFirstWinsCylindricalStitcher.h
|
|
4
|
-
//
|
|
5
|
-
// Apple-style slit-scan panorama engine. Alternative to
|
|
6
|
-
// OpenCVIncrementalStitcher (which is the Samsung-style hybrid
|
|
7
|
-
// frame-based approach). Both engines expose the same JS-facing
|
|
8
|
-
// API contract; the host picks one via the `engine` flag in start
|
|
9
|
-
// options.
|
|
10
|
-
//
|
|
11
|
-
// What slit-scan does differently:
|
|
12
|
-
//
|
|
13
|
-
// Hybrid (v9): accepts WHOLE frames at intervals, warps each via
|
|
14
|
-
// cylindrical projection, blends with feather over a substantial
|
|
15
|
-
// overlap region (~30-50% of frame width).
|
|
16
|
-
//
|
|
17
|
-
// Slit-scan (v10): continuously samples the camera buffer. For
|
|
18
|
-
// each AR frame, takes a NARROW VERTICAL STRIP (typically 30-60
|
|
19
|
-
// pixels) whose width tracks the gyro angular delta since the
|
|
20
|
-
// last strip. Strips are painted onto the cylindrical canvas at
|
|
21
|
-
// their exact angular positions, so the per-strip overlap is just
|
|
22
|
-
// 1-3 pixels. The "stitching" problem mostly disappears because
|
|
23
|
-
// the overlap region is too narrow to show parallax.
|
|
24
|
-
//
|
|
25
|
-
// Why both engines:
|
|
26
|
-
//
|
|
27
|
-
// Slit-scan produces near-perfect output for clean rotational
|
|
28
|
-
// pans (Apple Camera-app quality) but is sensitive to gyro drift
|
|
29
|
-
// on long pans and to non-rotational motion (operator translates
|
|
30
|
-
// their body slightly). Hybrid is more forgiving but has visible
|
|
31
|
-
// seams where alignment is imperfect. Field captures decide which
|
|
32
|
-
// wins for the actual gesture our reps use.
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
#import <Foundation/Foundation.h>
|
|
36
|
-
#import <CoreVideo/CoreVideo.h>
|
|
37
|
-
#import "OpenCVIncrementalStitcher.h" // RLISFrameOutcome, RLISFrameTelemetry, RLISSnapshot
|
|
38
|
-
|
|
39
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
40
|
-
|
|
41
|
-
@interface OpenCVFirstWinsCylindricalStitcher : NSObject
|
|
42
|
-
|
|
43
|
-
- (instancetype)initWithComposeWidth:(NSInteger)composeWidth
|
|
44
|
-
composeHeight:(NSInteger)composeHeight
|
|
45
|
-
canvasWidth:(NSInteger)canvasWidth
|
|
46
|
-
canvasHeight:(NSInteger)canvasHeight
|
|
47
|
-
featherPx:(NSInteger)featherPx
|
|
48
|
-
frameRotationDegrees:(NSInteger)frameRotationDegrees
|
|
49
|
-
useRectilinear:(BOOL)useRectilinear NS_DESIGNATED_INITIALIZER;
|
|
50
|
-
|
|
51
|
-
- (instancetype)init NS_UNAVAILABLE;
|
|
52
|
-
|
|
53
|
-
/// V15 — set the per-stage correction config. Should be called once
|
|
54
|
-
/// after init, before any `ingestPixelBuffer:` call. Subsequent calls
|
|
55
|
-
/// replace the config but mid-capture changes can produce inconsistent
|
|
56
|
-
/// state (prev features tracked under different settings). Best
|
|
57
|
-
/// practice: reset the engine when config changes. If never called,
|
|
58
|
-
/// the engine uses a default equivalent to
|
|
59
|
-
/// `+[RLISStitcherConfig configForMode:@"slitscan-both"]`.
|
|
60
|
-
- (void)setConfig:(RLISStitcherConfig *)config;
|
|
61
|
-
|
|
62
|
-
/// V15.0b — set the world-frame plane transform (4×4, column-major,
|
|
63
|
-
/// 16 floats). Should be called once a vertical plane has been
|
|
64
|
-
/// detected by ARKit and before any subsequent ingest. If never
|
|
65
|
-
/// called, the engine ignores `_config.useDetectedPlane` and falls
|
|
66
|
-
/// back to pose-driven projection.
|
|
67
|
-
- (void)setPlaneTransformFlat:(NSArray<NSNumber *> *)transform16;
|
|
68
|
-
|
|
69
|
-
- (RLISFrameTelemetry *)ingestPixelBuffer:(CVPixelBufferRef)pixelBuffer
|
|
70
|
-
qx:(double)qx
|
|
71
|
-
qy:(double)qy
|
|
72
|
-
qz:(double)qz
|
|
73
|
-
qw:(double)qw
|
|
74
|
-
tx:(double)tx
|
|
75
|
-
ty:(double)ty
|
|
76
|
-
tz:(double)tz
|
|
77
|
-
fx:(double)fx
|
|
78
|
-
fy:(double)fy
|
|
79
|
-
cx:(double)cx
|
|
80
|
-
cy:(double)cy
|
|
81
|
-
imageWidth:(NSInteger)imageWidth
|
|
82
|
-
imageHeight:(NSInteger)imageHeight
|
|
83
|
-
yaw:(double)yaw
|
|
84
|
-
pitch:(double)pitch
|
|
85
|
-
fovHorizDegrees:(double)fovHorizDegrees
|
|
86
|
-
fovVertDegrees:(double)fovVertDegrees
|
|
87
|
-
trackingPoor:(BOOL)trackingPoor
|
|
88
|
-
NS_SWIFT_NAME(ingest(pixelBuffer:qx:qy:qz:qw:tx:ty:tz:fx:fy:cx:cy:imageWidth:imageHeight:yaw:pitch:fovHorizDegrees:fovVertDegrees:trackingPoor:));
|
|
89
|
-
|
|
90
|
-
- (nullable RLISSnapshot *)snapshotWithJpegQuality:(NSInteger)quality
|
|
91
|
-
error:(NSError **)error;
|
|
92
|
-
|
|
93
|
-
- (nullable RLISSnapshot *)finalizeAtPath:(NSString *)outputPath
|
|
94
|
-
jpegQuality:(NSInteger)quality
|
|
95
|
-
error:(NSError **)error;
|
|
96
|
-
|
|
97
|
-
- (void)reset;
|
|
98
|
-
|
|
99
|
-
@property (nonatomic, readonly) NSInteger acceptedCount;
|
|
100
|
-
|
|
101
|
-
@end
|
|
102
|
-
|
|
103
|
-
NS_ASSUME_NONNULL_END
|