Skip to main content

downsample_index_range

Function downsample_index_range 

Source
pub fn downsample_index_range<F>(
    len: usize,
    value_at: F,
    max_points: Option<usize>,
) -> Vec<(usize, f64)>
where F: Fn(usize) -> f64,
Expand description

Downsample an indexed value slice without first allocating every finite (index, value) pair. It makes one cheap count pass and one bucket pass, returning only the bounded render set while preserving first/last finite values and local min/max extrema.