import type { Frame, Page } from 'playwright'; import type { CamSpec, Vec3 } from './vehicleMath'; /** The eight fixed exterior angles, body frame (+x left, +y up, +z forward). */ export declare const INSPECTION_ANGLES: ReadonlyArray; /** Dusk, not black: the share of the world's exposure kept at night (the body reads beside its lit lamps). */ export declare const INSPECTION_NIGHT_DIM = 0.18; export interface InspectionFrame { id: string; label: string; group: 'inspect.day' | 'inspect.night' | 'inspect.lamp'; file: string; } export interface InspectionFacts { frames: InspectionFrame[]; errors: string[]; night: boolean | null; } export interface CaptureInspectionArgs { page: Page; frame: Frame; carMin: Vec3; carMax: Vec3; /** Capture the current view to `inspection/frames/.jpg` (relative to the run's out dir); returns that relative path. */ snap: (id: string, settleMs: number) => Promise; setCam: (c: CamSpec) => Promise; clearCam: () => Promise; /** Lamp functions the package declares (vehicleLamps planLamps signals); a function the car lacks is not photographed. */ lampSignals: string[]; /** The run's out dir (what `snap` paths are relative to): lets a blink burst keep its lit and dark frames and drop the rest. */ outDir?: string; } /** * A blinking lamp is photographed over a FULL blink period, not at two instants: indicators run at 0.5-1.5 Hz with a * ~50 % duty, so two frames 0.35 s apart both landed in the dark half often enough to read a working corner as dark * (the R34's right indicator: dark on one run, lit on the next). At least BLINK_MIN_FRAMES frames over at least * BLINK_WINDOW_MS (one whole period at 0.5 Hz plus margin); the brightest is kept as the LIT frame and the darkest as the * DARK one (proof it blinks), the rest are deleted. */ export declare const BLINK_WINDOW_MS = 2200; export declare const BLINK_MIN_FRAMES = 4; /** A pixel counts as the blinking lens when its amber-ness swings by more than this across the burst. */ export declare const BLINK_SWING_MIN = 40; /** * Rank the frames of one burst (same camera) by how lit the BLINKING lens is in each, from the pixels the critic will see. * The pixels whose amber-ness swings across the burst are the lens; each frame scores the mean amber-ness there. Neither * the runtime's emissive read (it ran on a different phase from the frames the headless renderer presented: lit reads * on frames that drew the lens off) nor whole-frame brightness (the night exposure drifts up across a burst) picked the * lit frame reliably; this did on every corner of the R34. All zeros when nothing blinks. */ export declare function blinkScores(files: string[]): Promise; /** * A burst over a full blink period from the current camera: at least BLINK_MIN_FRAMES frames, the last at least * BLINK_WINDOW_MS after the first; keeps the frame with the lens brightest as `.lit` and darkest as `.dark` * and deletes the rest. When no lens changed in any frame it keeps one frame and says so. */ export declare function blinkBurst(o: { id: string; label: string; group: InspectionFrame['group']; settleMs: number; snap: (id: string, settleMs: number) => Promise; outDir?: string; gapMs?: number; }): Promise; /** Pick the lit (brightest) and dark (darkest) frame of a blink burst. */ export declare function pickBlinkFrames(scores: number[]): { lit: number; dark: number; }; export declare function captureInspection(a: CaptureInspectionArgs): Promise;