diff options
author | gennyble <gen@nyble.dev> | 2023-11-17 05:15:51 -0600 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2023-11-17 05:15:51 -0600 |
commit | 7ceb92beaf8c6040fdde683722dccc8cf4aad702 (patch) | |
tree | 5a425ec0aeac7278fc5aa9ed5f3e6a3a96953aec /lri-study/src/main.rs | |
parent | 4c9a87939c97247d182293ff696de1355ba06194 (diff) | |
download | lri-rs-7ceb92beaf8c6040fdde683722dccc8cf4aad702.tar.gz lri-rs-7ceb92beaf8c6040fdde683722dccc8cf4aad702.zip |
i left the repo dirty. what was i doing again?
Diffstat (limited to 'lri-study/src/main.rs')
-rw-r--r-- | lri-study/src/main.rs | 11 |
1 files changed, 7 insertions, 4 deletions
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<String, Photo> = HashMap::new(); for entry in data_dir.read_dir_utf8().unwrap() { @@ -51,7 +50,7 @@ fn gather() -> ! { let mut photos: Vec<Photo> = 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} ", |