summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GipfelWidget.H10
-rw-r--r--src/GipfelWidget.cxx5
-rw-r--r--src/Panorama.H2
-rw-r--r--src/Panorama.cxx15
-rw-r--r--src/ProjectionTangentialLSQ.cxx5
-rw-r--r--src/gipfel.cxx8
6 files changed, 17 insertions, 28 deletions
diff --git a/src/GipfelWidget.H b/src/GipfelWidget.H
index 0389896..d8b08fe 100644
--- a/src/GipfelWidget.H
+++ b/src/GipfelWidget.H
@@ -37,13 +37,13 @@ class GipfelWidget : public Fl_Widget {
int get_rel_track_width(Hill *m);
static int get_pixel_nearest(Fl_Image *img, double x, double y,
- uchar *r, uchar *g, uchar *b);
+ uchar *r, uchar *g, uchar *b);
- static int get_pixel_bilinear(Fl_Image *img, double x, double y,
- uchar *r, uchar *g, uchar *b);
+ static int get_pixel_bilinear(Fl_Image *img, double x, double y,
+ uchar *r, uchar *g, uchar *b);
static int get_pixel(Fl_Image *img, int x, int y,
- uchar *r, uchar *g, uchar *b);
+ uchar *r, uchar *g, uchar *b);
public:
GipfelWidget(int X,int Y,int W, int H);
@@ -118,7 +118,7 @@ class GipfelWidget : public Fl_Widget {
int update();
- int get_pixel(double a_view, double a_nick,
+ int get_pixel(double a_alph, double a_nick,
uchar *r, uchar *g, uchar *b);
void draw();
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index 0d92095..939eccc 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -678,16 +678,15 @@ GipfelWidget::handle(int event) {
}
int
-GipfelWidget::get_pixel(double a_view, double a_nick,
+GipfelWidget::get_pixel(double a_alph, double a_nick,
uchar *r, uchar *g, uchar *b) {
double px, py;
-
if (img == NULL) {
return 1;
}
- if (pan->get_coordinates(a_view, a_nick, &px, &py) != 0) {
+ if (pan->get_coordinates(a_alph, a_nick, &px, &py) != 0) {
return 1;
}
diff --git a/src/Panorama.H b/src/Panorama.H
index 4db046e..60ccb8e 100644
--- a/src/Panorama.H
+++ b/src/Panorama.H
@@ -133,6 +133,6 @@ class Panorama {
void set_distortion_params(double k0, double k1);
- int get_coordinates(double a_view, double a_nick, double *x, double *y);
+ int get_coordinates(double a_alph, double a_nick, double *x, double *y);
};
#endif
diff --git a/src/Panorama.cxx b/src/Panorama.cxx
index 8b21fda..521a4ab 100644
--- a/src/Panorama.cxx
+++ b/src/Panorama.cxx
@@ -583,20 +583,9 @@ Panorama::get_real_distance(Hill *m) {
}
int
-Panorama::get_coordinates(double a_view, double a_nick, double *x, double *y) {
- a_view = a_view - parms.a_center;
+Panorama::get_coordinates(double a_alph, double a_nick, double *x, double *y) {
- if (a_view > pi_d) {
- a_view -= 2.0*pi_d;
- } else if (a_view < -pi_d) {
- a_view += 2.0*pi_d;
- }
-
- if (a_view > view_angle || a_view < - view_angle) {
- return 1;
- }
-
- proj->get_coordinates(a_view, a_nick, &parms, x, y);
+ proj->get_coordinates(a_alph, a_nick, &parms, x, y);
return 0;
}
diff --git a/src/ProjectionTangentialLSQ.cxx b/src/ProjectionTangentialLSQ.cxx
index 73a4bad..1a2f0f9 100644
--- a/src/ProjectionTangentialLSQ.cxx
+++ b/src/ProjectionTangentialLSQ.cxx
@@ -193,10 +193,7 @@ ProjectionTangentialLSQ::lsq(const Hills *h, ViewParams *parms) {
int status;
int num_params = h->get_num()>3?6:4;
- fprintf(stderr, "x %f, y %f\n",
- h->get(0)->x,
- h->get(0)->y);
-
+ fprintf(stderr, "k0 %f, k1 %f num %d\n", parms->k0, parms->k1, num_params);
dat.h = h;
dat.old_params = parms;
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 3f6bb08..de5d748 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -324,7 +324,7 @@ int main(int argc, char** argv) {
char *view_point = NULL;
int err, bflag = 0, dflag = 0, my_argc;
int stitch_flag = 0, stitch_w = 2000, stitch_h = 500;
- int jpeg_flag = 0, tiff_flag = 0;
+ int jpeg_flag = 0, tiff_flag = 0, distortion_flag = 0;
double stitch_from = 0.0, stitch_to = 380.0;
double dist_k0 = 0.0, dist_k1 = 0.0;
char *outpath;
@@ -354,6 +354,7 @@ int main(int argc, char** argv) {
}
break;
case 'u':
+ distortion_flag++;
if (optarg && strcmp(optarg, ":")) {
dist_k0 = atof(optarg);
if (strchr(optarg, ',')) {
@@ -429,7 +430,10 @@ int main(int argc, char** argv) {
control_win->label(img_file);
}
- gipf->set_distortion_params(dist_k0, dist_k1);
+ if (distortion_flag) {
+ gipf->set_distortion_params(dist_k0, dist_k1);
+ }
+
view_win->size(gipf->w(), gipf->h());
scroll->size(gipf->w(), gipf->h());