/** * PanoramaGuidance — gyroscope-driven pan-speed indicator for the * tap-and-hold panorama flow. * * ┌──────────────────────────────────────────────────────────┐ * │ (camera preview) │ * │ │ * │ ↓ │ ← portrait + landscape pan * │ green / yellow / red │ * │ │ * │ "Pan slowly" / "Slow down" / "Too fast" │ * └──────────────────────────────────────────────────────────┘ * * Why this exists * The SCANS-mode stitcher needs ~30–50 % overlap between * consecutive frames. At 30 fps, frames are ~33 ms apart, so * pan rates above roughly 30°/s (≈ 0.5 rad/s) produce frames * the stitcher can't align — and the user finds out only after * the post-release "Stitching failed" alert. Real-time feedback * prevents that failure mode. * * What it does * - Subscribes to the device gyroscope (react-native-sensors) * ONLY while `active` is true; tears down on inactive so the * sensor isn't running the rest of the time the screen is up. * - Detects portrait vs landscape from window dimensions; the * dominant pan axis changes accordingly: * portrait → user pans horizontally → we track gyro Y. * landscape → user pans vertically → we track gyro X. * - Maps the dominant axis's |rad/s| onto a colour scale and a * human-readable hint. Defaults are tuned for SCANS but * overrideable. * * Performance * The gyroscope fires ~30 Hz. We update an Animated.Value (which * updates the colour interpolation on the native driver) and only * call setState when the qualitative bucket (good/warn/bad) * changes — keeps re-render volume low. */ import React from 'react'; import { type StyleProp, type ViewStyle } from 'react-native'; export type PanoramaSpeedBucket = 'good' | 'warn' | 'bad'; type PanAxis = 'horizontal' | 'vertical'; export interface PanoramaGuidanceProps { /** * Subscribe to the gyroscope only while this is true. Typically * driven by the host's `statusPhase === 'recording'`. */ active: boolean; /** * Force the pan axis instead of auto-detecting from window * orientation. Useful for hosts that lock orientation but want * the user to pan the orthogonal axis. * * Default: undefined → auto-detect ("horizontal" in portrait, * "vertical" in landscape — matches the user's described * "pan top-to-bottom in landscape, left-to-right in portrait"). */ axis?: PanAxis; /** * Rotation rates in rad/s defining the speed buckets. Defaults * tuned for cv::Stitcher::SCANS at 30 fps with iPhone FOV ≈ 70°: * |rate| ≤ goodMax → green ("good") * |rate| ≤ warnMax → amber ("slow down a bit") * else → red ("too fast") */ goodMaxRadPerSec?: number; warnMaxRadPerSec?: number; /** Optional hint message overrides. */ messages?: { good?: string; warn?: string; bad?: string; }; style?: StyleProp; } export declare function PanoramaGuidance({ active, axis, goodMaxRadPerSec, warnMaxRadPerSec, messages, style, }: PanoramaGuidanceProps): React.JSX.Element | null; export {}; //# sourceMappingURL=PanoramaGuidance.d.ts.map