summaryrefslogtreecommitdiff
path: root/crates/gipfel-cli/examples
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-11-06 09:52:26 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-11-06 09:52:26 +0100
commitd5967c1b91b14b3b4e5b0d9663e8a4d2a5e80533 (patch)
tree4ac34f1e81b73b24139ac0eafa2db72f524f2a42 /crates/gipfel-cli/examples
parentdbc0fd52a8497c5002e8311eb1728050a4e97c7a (diff)
wasm front end becomes the main gipfel; add desktop installers
- rename crates/wipfel -> crates/gipfel (crate, wasm artifact, dist, scripts, page titles); slogan back to "Photogrammetry for Mountain Images"; crates/wipfel-tauri -> crates/gipfel-desktop - new features in the wasm app: Save image (gipfel JPEG comment, same format as before, via browser download) and lens distortion profiles stored in localStorage in FLTK prefs format with camera auto-match on image load; profile name field, save/load and dropdown - gipfel-core: read GPSImgDirection from EXIF (magnetic -> true) as azimuth fallback; expose parse_prefs/serialize_prefs for the wasm build; ?file=/?az=/?pitch=/?roll=/?focal=/?vis= URL parameters - Tauri v2 wrapper crate building .deb, AppImage and (cross-compiled) Windows NSIS installers; safe stage-and-swap build-release.sh - README: web-centric Installation, concise Build section for the official targets (Web, Windows, Linux); drop native/Android mentions - release site moved dist/wipfel -> dist/gipfel
Diffstat (limited to 'crates/gipfel-cli/examples')
-rw-r--r--crates/gipfel-cli/examples/overlay.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/crates/gipfel-cli/examples/overlay.rs b/crates/gipfel-cli/examples/overlay.rs
new file mode 100644
index 0000000..3ce8745
--- /dev/null
+++ b/crates/gipfel-cli/examples/overlay.rs
@@ -0,0 +1,30 @@
+// Dev helper: project hills for a given viewpoint and print image coords.
+// usage: overlay <lat> <lon> <height> <az> <pitch> <roll> <focal35> <w> <h>
+use gipfel_core::panorama::Panorama;
+
+fn main() {
+ let a: Vec<String> = std::env::args().collect();
+ let n: Vec<f64> = a[1..].iter().map(|s| s.parse().unwrap()).collect();
+ let (lat, lon, height, az, pitch, roll, focal, w, h) =
+ (n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7], n[8]);
+ let mut p = Panorama::new();
+ p.load_data("gipfel.dat").unwrap();
+ p.set_view_lat(lat);
+ p.set_view_long(lon);
+ p.set_view_height(height);
+ p.set_scale(focal * w.max(h) / 36.0);
+ p.set_center_angle(az);
+ p.set_pitch_angle(pitch);
+ p.set_roll_angle(roll);
+ p.max_view_angle = 60_f64.to_radians();
+ p.update_visible_mountains(None);
+ println!("# az={az} pitch={pitch} scale={}", focal * w.max(h) / 36.0);
+ for &i in &p.visible {
+ let hill = &p.hills[i];
+ let d = p.get_real_distance(i) / 1000.0;
+ if hill.x.abs() < w / 2.0 && hill.y.abs() < h / 2.0 && hill.height > 1500.0 {
+ // convert center-relative coords to full image coords
+ println!("{:.0} {:.0} {} {:.0}m {:.1}km", hill.x + w / 2.0, hill.y + h / 2.0, hill.name, hill.height, d);
+ }
+ }
+}