Skip to main content

sample

Function sample 

Source
pub fn sample(
    band: &Band,
    width: u32,
    height: u32,
    x: f64,
    y: f64,
    method: ResamplingMethod,
) -> Option<f64>
Expand description

Sample one fractional (x, y) from band using the chosen method.

x and y are in source pixel coordinates — (0.5, 0.5) is the centre of pixel (0, 0), (1.5, 0.5) is the centre of pixel (1, 0), etc. Returns None if out of bounds or the dtype is unsupported.