Skip to main content

Preprocessor

Trait Preprocessor 

Source
pub trait Preprocessor: Send + 'static {
    // Required method
    fn process(
        &mut self,
        view: &FrameView<'_>,
    ) -> Result<Arc<Frame>, DetectorError>;

    // Provided method
    fn set_label(&mut self, _label: &str) { ... }
}
Expand description

Transforms a watcher’s cropped view into the frame the rest of the pipeline sees. Runs BEFORE the implicit frame-diff gate, so a preprocessor whose output is static (e.g. a fully-suppressed stability mask) holds the detector at zero cost until its output actually changes.

Preprocessors run every tick on the async path — they must be cheap (block math, copies), never heavy inference.

Required Methods§

Source

fn process(&mut self, view: &FrameView<'_>) -> Result<Arc<Frame>, DetectorError>

Provided Methods§

Source

fn set_label(&mut self, _label: &str)

Called once at subscribe time with the watcher’s name, so stages with debug output can label their artifacts. Default: ignore.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§