diff --git a/rtiow/src/output.rs b/rtiow/src/output.rs index ccf9777..8c2f6af 100644 --- a/rtiow/src/output.rs +++ b/rtiow/src/output.rs @@ -1,5 +1,6 @@ use std::collections::HashMap; use std::fs::File; +use std::io::BufWriter; use std::path::Path; use std::sync::Arc; use std::sync::Mutex; @@ -189,6 +190,7 @@ pub fn write_images>( }; info!("Saving {}", binary_path.to_string_lossy()); let f = File::create(output_dir.join(binary_path))?; + let f = BufWriter::new(f); match it { ImageType::RGB01 => { serde_json::ser::to_writer( @@ -200,12 +202,12 @@ pub fn write_images>( )?; } ImageType::Grey01 | ImageType::GreyNormalized => { - // TODO(wathiede): make grey scale serde_json::ser::to_writer(f, &img.pix.iter().map(|v| v.x).collect::>())?; } }; } let f = File::create(output_dir.join("data.json"))?; + let f = BufWriter::new(f); serde_json::ser::to_writer( f, &Data {