Skip to main content

SliceSource

Trait SliceSource 

Source
pub trait SliceSource: Send {
    // Required methods
    fn sensor_size(&self) -> (usize, usize);
    fn timestamp_scale_ms(&self) -> f64;
    fn n_events(&self) -> usize;
    fn time_span(&self) -> (i64, i64);
    fn slice_index(&self, i0: usize, i1: usize) -> Result<EventStream, IoError>;
    fn slice_time(&self, t0: i64, t1: i64) -> Result<EventStream, IoError>;
}
Expand description

Random-access view over a file’s events: fetch an arbitrary time or count range without materialising the whole stream. This backs the lazy open handle — the OpenCV VideoCapture to load’s imread. Each call returns a new EventStream.

Required Methods§

Source

fn sensor_size(&self) -> (usize, usize)

Source

fn timestamp_scale_ms(&self) -> f64

Source

fn n_events(&self) -> usize

Total events in the file.

Source

fn time_span(&self) -> (i64, i64)

(t_min, t_max) in microseconds across the whole file; (0, 0) when empty.

Source

fn slice_index(&self, i0: usize, i1: usize) -> Result<EventStream, IoError>

Events whose index lies in [i0, i1) (clamped to the file).

Source

fn slice_time(&self, t0: i64, t1: i64) -> Result<EventStream, IoError>

Events whose timestamp (µs) lies in the half-open window [t0, t1).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§