cargo fmt

This commit is contained in:
2025-03-24 16:27:11 -04:00
parent 3a9940dfba
commit f0d4e883f6
7 changed files with 313 additions and 86 deletions

View File

@@ -9,7 +9,6 @@ pub struct ThinGridData {
pub data: Vec<f32>,
}
impl Clone for ThinGridData {
fn clone(&self) -> ThinGridData {
ThinGridData {
@@ -32,9 +31,10 @@ impl ThinGridData {
#[allow(dead_code)]
pub fn new_from_grid_vec(in_grids: Vec<Grid>) -> Vec<Self> {
in_grids.iter().map(|grid|{
Self::new_from_grid(grid)
}).collect()
in_grids
.iter()
.map(|grid| Self::new_from_grid(grid))
.collect()
}
// from grid.rs (needed in image gen)
@@ -109,13 +109,13 @@ impl ImgData {
pub fn save_to_image(&self) {
let (width, height) = (self.grids[0].width, self.grids[0].height);
let mut img = image::RgbImage::new(width as u32, height as u32);
let max_values: Vec<_> = self
.grids
.iter()
.map(|grid| grid.quantile(0.999) * 1.5)
.collect();
for y in 0..height {
for x in 0..width {
let i = y * width + x;
@@ -135,7 +135,7 @@ impl ImgData {
img.put_pixel(x as u32, y as u32, image::Rgb([r as u8, g as u8, b as u8]));
}
}
img.save(format!("./tmp/out_{}.png", self.iteration).as_str())
.unwrap();
}