From ce3b45ddaab7ddc7017fa75dc5de64cd6ca70f93 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Fri, 30 Oct 2026 09:44:43 +0100 Subject: cli: -V flag; restricted export ignores occlusion; web visibility knob - gipfel-cli export-hills gains -V (the visibility/prominence threshold, C default 0.07); default unchanged - export_hill_rows: restricted mode (-e, curated lists like the gipfelweb photo index) no longer drops FLAG_HIDDEN entries. The occlusion heuristic is for thinning the full peak database; a curated photo list should show every entry inside the field of view. Unrestricted export (golden-pinned) unchanged. - gipfelweb Makefile: V ?= 0.05 knob for the peak view, -V 0 for the photo index; per-image %.opts now appended after the standard flags (they were placed before the subcommand and silently ignored) --- crates/gipfel-cli/src/main.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'crates/gipfel-cli/src/main.rs') diff --git a/crates/gipfel-cli/src/main.rs b/crates/gipfel-cli/src/main.rs index f0690a8..06b1447 100644 --- a/crates/gipfel-cli/src/main.rs +++ b/crates/gipfel-cli/src/main.rs @@ -12,7 +12,7 @@ fn usage() { \n\ commands:\n\ \x20 export-position print position CSV line\n\ - \x20 export-hills [-d ] [-e ] export hill positions\n\ + \x20 export-hills [-d ] [-e ] [-V ] export hill positions\n\ \x20 info show parsed metadata\n\ \x20 stitch [-t out.tif [-4]] [-j out.jpg] [-w N]\n\ \x20 [-h N] [-r from,to] [-b] img... cylindrical panorama\n\ @@ -45,7 +45,7 @@ fn fmt_f(v: f64) -> String { } } -fn export_hills(img: &str, data: &str, export_file: Option<&str>) -> i32 { +fn export_hills(img: &str, data: &str, export_file: Option<&str>, vis: f64) -> i32 { let Some((w, h)) = image_dimensions(img) else { eprintln!("could not read image {}", img); return 1; @@ -61,7 +61,7 @@ fn export_hills(img: &str, data: &str, export_file: Option<&str>) -> i32 { eprintln!("Could not load datafile {}: {}", data, e); return 1; } - pan.set_height_dist_ratio(0.07); // C default "visibility" + pan.set_height_dist_ratio(vis); // "visibility" threshold, C default 0.07 if !have_info { eprintln!("No gipfel info available for {}.", img); @@ -328,9 +328,16 @@ fn main() { let img = &args[2]; let mut data = "gipfel.dat".to_string(); let mut export_file: Option = None; + let mut vis = 0.07; let mut i = 3; while i < args.len() { match args[i].as_str() { + "-V" => { + if i + 1 < args.len() { + vis = args[i + 1].trim().parse().unwrap_or(0.07); + i += 1; + } + } "-d" => { if i + 1 < args.len() { data = args[i + 1].clone(); @@ -347,7 +354,7 @@ fn main() { } i += 1; } - export_hills(img, &data, export_file.as_deref()) + export_hills(img, &data, export_file.as_deref(), vis) } } "info" => { -- cgit v1.2.3