From 7ceb92beaf8c6040fdde683722dccc8cf4aad702 Mon Sep 17 00:00:00 2001 From: gennyble Date: Fri, 17 Nov 2023 05:15:51 -0600 Subject: i left the repo dirty. what was i doing again? --- lri-study/.gitignore | 1 + lri-study/src/main.rs | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 lri-study/.gitignore (limited to 'lri-study') diff --git a/lri-study/.gitignore b/lri-study/.gitignore new file mode 100644 index 0000000..f923e39 --- /dev/null +++ b/lri-study/.gitignore @@ -0,0 +1 @@ +dbg \ No newline at end of file diff --git a/lri-study/src/main.rs b/lri-study/src/main.rs index ac14c45..962fc26 100644 --- a/lri-study/src/main.rs +++ b/lri-study/src/main.rs @@ -7,8 +7,6 @@ use camino::Utf8PathBuf; use lri_rs::{DataFormat, HdrMode, LriFile, SceneMode, SensorModel}; use owo_colors::OwoColorize; -const DATA: &'static str = "/Users/gen/thanks_lak"; - fn main() { match std::env::args().nth(1).as_deref() { Some("gather") => gather(), @@ -17,7 +15,8 @@ fn main() { } fn gather() -> ! { - let data_dir = Utf8PathBuf::from(DATA); + let path = std::env::args().nth(2).unwrap(); + let data_dir = Utf8PathBuf::from(path); let mut files: HashMap = HashMap::new(); for entry in data_dir.read_dir_utf8().unwrap() { @@ -51,7 +50,7 @@ fn gather() -> ! { let mut photos: Vec = files.into_values().collect(); photos.sort_by(|a, b| a.lri.as_deref().unwrap().cmp(b.lri.as_deref().unwrap())); - for photo in photos { + for (idx, photo) in photos.into_iter().enumerate() { let lri_path = match photo.lri { Some(p) => p, None => continue, @@ -67,6 +66,10 @@ fn gather() -> ! { print!("{} - ", lri_path.file_stem().unwrap()); + let path = format!("{}_{idx}", lri_path.file_stem().unwrap_or_default()); + let dbg = format!("{:#?}", lri.sig); + std::fs::write(path, dbg.as_bytes()).unwrap(); + if let Some(fwv) = lri.firmware_version.as_ref() { print!( "[{}] focal:{:<3} iit:{:>2}ms gain:{:2.0} ", -- cgit 1.4.1-3-g733a5