jxl_frame/data/
noise.rs

1#[derive(Debug)]
2pub struct NoiseParameters {
3    pub lut: [f32; 8],
4}
5
6impl<Ctx> jxl_oxide_common::Bundle<Ctx> for NoiseParameters {
7    type Error = crate::Error;
8
9    fn parse(bitstream: &mut jxl_bitstream::Bitstream, _: Ctx) -> crate::Result<Self> {
10        let mut lut = [0.0f32; 8];
11        for slot in &mut lut {
12            *slot = bitstream.read_bits(10)? as f32 / (1 << 10) as f32;
13        }
14
15        Ok(Self { lut })
16    }
17}