168 img.pixels_mut() |
168 img.pixels_mut() |
169 .zip(rawdata) |
169 .zip(rawdata) |
170 .for_each(|(p, v)| { |
170 .for_each(|(p, v)| { |
171 let t = v/m; |
171 let t = v/m; |
172 // A very colourful option for bug hunting. |
172 // A very colourful option for bug hunting. |
173 //let rgb = [(50.0*t).cos(), (20.0*t).sin(), (3.0*t).cos()]; |
173 let rgb = [(50.0*t).cos(), (20.0*t).sin(), (3.0*t).cos()]; |
174 let rgb = [1.0-t, 1.0-t, 1.0]; |
174 //let rgb = [1.0-t, 1.0-t, 1.0]; |
175 *p = Rgb(rgb.map(|v| (v*(u8::RANGE_MAX as f64)) as u8)) |
175 *p = Rgb(rgb.map(|v| (v*(u8::RANGE_MAX as f64)) as u8)) |
176 }); |
176 }); |
177 |
177 |
178 img.save_with_format(format!("{PREFIX}/{face}.png"), ImageFormat::Png)?; |
178 img.save_with_format(format!("{PREFIX}/{face}.png"), ImageFormat::Png)?; |
179 } |
179 } |