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>;

    // Provided method
    fn pixel_counts(&self) -> Result<Vec<u64>, 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).

Provided Methods§

Source

fn pixel_counts(&self) -> Result<Vec<u64>, IoError>

Per-pixel event counts over the whole file (row-major width·height), out-of-bounds events dropped — what the reader’s hot-pixel pre-scan needs. The default tallies through slice_index in bounded chunks; a source that can read coordinates alone (HDF5) overrides this to skip the t/p columns and stream construction, which is most of the work.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§