import { type DetectionFrame, type DetectionMask } from "#types/detections"; import { type DetectionFrameSelectionOptions } from "#types/detection-timeline"; export interface DecodedDetectionMask { readonly width: number; readonly height: number; readonly data: Uint8Array; } /** * A playhead compared by time can arrive perturbed by whatever plane it crossed * to get here: a producer that publishes whole milliseconds reports a source * frame at 5.033333s as 5.033s, and even an exact producer loses a bit to a * seconds-to-milliseconds-and-back trip. A frame starting within that reach may * already be on screen while one starting past it cannot. * * Selection by identity carries none of this, which is why it lives in its own * function and not in a smaller number here. */ export declare const PLAYHEAD_QUANTIZATION_TOLERANCE_SECONDS = 0.0005; /** * Validates and orders a window without copying it. The frames stay the * caller's own objects, which is what a source wants: `DetectionFrame` and its * `detections` are both `readonly`, nothing in the library writes to either, * and the buffer that receives this window already keeps the objects it * recognises and copies only the ones it does not * (`reuseBufferedFrameSnapshots`). A source that copies first pays for every * frame the buffer is about to discard. */ export declare function sortedDetectionFrames(detectionFrames: readonly DetectionFrame[] | undefined): DetectionFrame[]; export declare function copySortedDetectionFrames(detectionFrames: readonly DetectionFrame[] | undefined): DetectionFrame[]; /** * One frame's deep copy, for a caller that already knows which frames it is * keeping and only needs the ones it does not hold. */ export declare function copyDetectionFrame(frame: DetectionFrame): DetectionFrame; export declare function validateDetectionFrames(detectionFrames: readonly DetectionFrame[]): void; export declare function filterDetectionFramesForRange(detectionFrames: readonly DetectionFrame[], startTime: number, endTime: number): DetectionFrame[]; export declare function selectDetectionFrame(detectionFrames: readonly DetectionFrame[], mediaTime: number, options?: DetectionFrameSelectionOptions): DetectionFrame | undefined; export declare function decodeCompressedRleMask(mask: DetectionMask): DecodedDetectionMask; export declare function detectionFrameOverlapsRange(frame: DetectionFrame, startTime: number, endTime: number): boolean; export declare function decodeCompressedRleCounts(counts: string): number[]; export declare function encodeCompressedRleCounts(counts: readonly number[]): string; //# sourceMappingURL=detection-frames.d.ts.map