dither_float_with

Function dither_float_with 

Source
pub fn dither_float_with<Src, Dest, M: LinearRng>(
    value: Src,
    index: u32,
    method: &M,
) -> Dest
Expand description

Dither a float value when converting to lower precision using a specific linear RNG method.

ยงExample

use dithereens::{R2, dither_float_with};

let value: f32 = 1.234567;
let method = R2::new(42);
let result: f16 = dither_float_with(value, 0, &method);