about summary refs log tree commit diff
path: root/lri-study/src
diff options
context:
space:
mode:
Diffstat (limited to 'lri-study/src')
-rw-r--r--lri-study/src/main.rs11
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} ",