summaryrefslogtreecommitdiff
path: root/crates/gipfel-core/examples
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-26 20:05:20 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-26 20:05:20 +0100
commit375d87a9b0ec1cf2fffd705adb870c86144d2400 (patch)
tree1e8e05e7cd58686628d0f4622622456613a42e4d /crates/gipfel-core/examples
parent45425dd047b791fe63f13a46a3251c529cfffc94 (diff)
Replace the C++ implementation with the Rust port
The Rust port (formerly gipfel-rs) is now the official successor to the FLTK/GSL C++ code base. This squashes the port into a single commit and removes the C++ sources (they remain in the git history below). Layout: crates/gipfel-core headless core: hills, panorama geometry, projections (maxima-generated derivatives), pure-Rust LM fit, gipfel: JPEG comment + EXIF I/O, profiles, stitching crates/gipfel-cli command-line tools (export, info, stitch, profiles) crates/gipfel-app Cosmic DE (libcosmic) GUI, binary name `gipfel` codegen/ maxima scripts + regen.sh for the projection code tests/ golden files + C++ reference harnesses (historical) The original README is kept for now; it will be updated to describe the Rust build. gipfel.dat, AUTHORS, ChangeLog and NEWS are unchanged.
Diffstat (limited to 'crates/gipfel-core/examples')
-rw-r--r--crates/gipfel-core/examples/genjpg.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/gipfel-core/examples/genjpg.rs b/crates/gipfel-core/examples/genjpg.rs
new file mode 100644
index 0000000..ae12b94
--- /dev/null
+++ b/crates/gipfel-core/examples/genjpg.rs
@@ -0,0 +1,24 @@
+// creates a test JPEG with a gipfel comment: genjpg <out.jpg>
+use gipfel_core::metadata::ImageMetaData;
+
+fn main() {
+ let out = std::env::args().nth(1).unwrap();
+ let (w, h) = (1600u32, 900u32);
+ let img = image::DynamicImage::new_rgb8(w, h).grayscale();
+ img.save(&out).unwrap();
+
+ let mut md = ImageMetaData::new();
+ md.longitude = 11.15;
+ md.latitude = 47.36;
+ md.height = 2100.0;
+ md.direction = 20.0;
+ md.pitch = 0.0;
+ md.roll = 1.0;
+ md.focal_length_35mm = 35.0;
+ md.projection_type = 0;
+ md.k0 = 0.0;
+ md.k1 = 0.0;
+ md.x0 = 0.0;
+ md.save_image(&out, &out).unwrap();
+ println!("wrote {}", out);
+}