Skip to main content

encode_pixel

Function encode_pixel 

Source
pub fn encode_pixel(elevation: f32) -> [u8; 3]
Expand description

Encode a single elevation sample (metres) into Terrarium (R, G, B).

Values are clamped to the representable range [-32768, 8388.99…] metres. NaN encodes as zero metres.