Skip to main content

WindowAlgorithm

Trait WindowAlgorithm 

Source
pub trait WindowAlgorithm: Send + Sync {
    // Required methods
    fn kernel_radius(&self) -> usize;
    fn process_chunk(
        &self,
        input: &Array2<f64>,
        output: &mut Array2<f64>,
        nodata: Option<f64>,
        cell_size_x: f64,
        cell_size_y: f64,
    );
}
Expand description

Trait for algorithms that operate on a moving window.

Implementations define the kernel radius and how to process a chunk of rows. The StripProcessor handles I/O and buffer management.

Required Methods§

Source

fn kernel_radius(&self) -> usize

Kernel radius (1 for 3x3, 10 for 21x21).

Source

fn process_chunk( &self, input: &Array2<f64>, output: &mut Array2<f64>, nodata: Option<f64>, cell_size_x: f64, cell_size_y: f64, )

Process a chunk of input rows, producing output rows.

input has (chunk_rows + top_pad + bottom_pad) rows x cols columns, where the padding is the halo clamped to image bounds. output has chunk_rows rows x cols columns. The algorithm should write results for the center rows only.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§