Skip to main content

encode

Function encode 

Source
pub fn encode(elevations: &[f32], width: u32, height: u32) -> Vec<u8> 
Expand description

Encode elevations (metres) into a flat width × height × 3 RGB buffer.

Walks elevations in row-major order and delegates to encode_pixel for each sample.

§Panics

Panics if elevations.len() != (width * height) as usize.