summaryrefslogtreecommitdiff
path: root/src/Stitch.cxx
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 /src/Stitch.cxx
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 'src/Stitch.cxx')
-rw-r--r--src/Stitch.cxx117
1 files changed, 0 insertions, 117 deletions
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
deleted file mode 100644
index 7b9fc04..0000000
--- a/src/Stitch.cxx
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// Copyright 2007-2009 Johannes Hofmann <Johannes.Hofmann@gmx.de>
-//
-// This software may be used and distributed according to the terms
-// of the GNU General Public License, incorporated herein by reference.
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-#include <algorithm>
-
-#include <gsl/gsl_multifit.h>
-
-#include <FL/Fl.H>
-
-#include "OutputImage.H"
-#include "Stitch.H"
-
-#define MAX_VALUE 65025
-
-static double pi_d = asin(1.0) * 2.0;
-static double deg2rad = pi_d / 180.0;
-
-Stitch::Stitch() {
- for (int i = 0; i < MAX_PICS; i++)
- gipf[i] = NULL;
-
- merged_image = NULL;
- num_pics = 0;
-}
-
-Stitch::~Stitch() {
- for (int i = 0; i < MAX_PICS; i++)
- if (gipf[i])
- delete gipf[i];
- else
- break;
-}
-
-int
-Stitch::load_image(char *file) {
- for (int i = 0; i < MAX_PICS; i++) {
- if (gipf[i] == NULL) {
- gipf[i] = new GipfelWidget(0, 0, 800, 600, NULL);
- if (gipf[i]->load_image(file) != 0) {
- delete gipf[i];
- gipf[i] = NULL;
- } else {
- num_pics++;
- }
- break;
- }
- }
-
- return 0;
-}
-
-OutputImage*
-Stitch::set_output(OutputImage *img) {
- OutputImage *ret = merged_image;
- merged_image = img;
- return ret;
-}
-
-int
-Stitch::resample(ScanImage::mode_t m,
- int w, int h, double view_start, double view_end) {
-
- view_start = view_start * deg2rad;
- view_end = view_end * deg2rad;
-
- double step_view = (view_end - view_start) / w;
- int r, g, b;
- int y_off = h / 2;
- int merged_pixel_set;
- double radius = (double) w / (view_end -view_start);
-
- if (merged_image)
- if (merged_image->init(w, h) != 0)
- merged_image = NULL;
-
- for (int y = 0; y < h; y++) {
- double a_nick = atan((double)(y_off - y)/radius);
-
- for (int x = 0; x < w; x++) {
- double a_view;
- a_view = view_start + x * step_view;
- merged_pixel_set = 0;
- for (int i = 0; i < num_pics; i++) {
- if (merged_pixel_set)
- continue;
-
- if (gipf[i]->get_pixel(m, a_view, a_nick,
- &r, &g, &b) == 0) {
-
- r = std::max(std::min(r, MAX_VALUE), 0);
- g = std::max(std::min(g, MAX_VALUE), 0);
- b = std::max(std::min(b, MAX_VALUE), 0);
-
- if (!merged_pixel_set && merged_image) {
- merged_image->set_pixel(x, r, g, b);
- merged_pixel_set++;
- }
- }
- }
- }
-
- if (merged_image)
- merged_image->next_line();
- }
-
- if (merged_image)
- merged_image->done();
-
- return 0;
-}