summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DataImage.cxx6
-rw-r--r--src/Panorama.cxx6
-rw-r--r--src/Stitch.cxx7
-rw-r--r--src/gipfel.cxx9
4 files changed, 19 insertions, 9 deletions
diff --git a/src/DataImage.cxx b/src/DataImage.cxx
index f7109cd..680d218 100644
--- a/src/DataImage.cxx
+++ b/src/DataImage.cxx
@@ -55,7 +55,11 @@ DataImage::set_pixel(int x, int y, char r, char g, char b) {
void
DataImage::draw() {
- fl_draw_image(data, 0, 0, w(), h(), d);
+ fl_push_clip(x(), y(), w(), h());
+
+ fl_draw_image(data, x(), y(), w(), h(), d);
+
+ fl_pop_clip();
}
int
diff --git a/src/Panorama.cxx b/src/Panorama.cxx
index b33a260..a644732 100644
--- a/src/Panorama.cxx
+++ b/src/Panorama.cxx
@@ -593,17 +593,17 @@ Panorama::get_coordinates(double a_view, double a_nick, int *x, int *y) {
m.a_view = a_view - parms.a_center;
-
+
if (m.a_view > pi_d) {
m.a_view -= 2.0*pi_d;
} else if (m.a_view < -pi_d) {
m.a_view += 2.0*pi_d;
}
- if (m.a_view < view_angle && m.a_view > - view_angle) {
+ if (m.a_view > view_angle || m.a_view < - view_angle) {
return 1;
}
-
+
m.a_nick = a_nick;
proj->set_coordinates(&m, &parms);
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index 9080259..21b0ba7 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -24,6 +24,8 @@
#include <string.h>
#include <math.h>
+#include <Fl/Fl.H>
+
#include "Stitch.H"
Stitch::Stitch() {
@@ -66,8 +68,7 @@ Stitch::resample(DataImage *img,
for (int x=0; x<img->w(); x++) {
for (int y=0; y<img->h(); y++) {
double a_view, a_nick;
-
- a_view = x * step_view;
+ a_view = view_start + x * step_view;
a_nick = (y_off - y) * step_view;
for (int i=0; i<MAX_PICS; i++) {
@@ -79,5 +80,7 @@ Stitch::resample(DataImage *img,
}
}
}
+ img->redraw();
+ Fl::check();
}
}
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 8247d7d..19c21cb 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -413,17 +413,20 @@ int main(int argc, char** argv) {
int stitch(int argc, char **argv) {
Fl_Window *win;
+ Fl_Scroll *scroll;
Stitch *st = new Stitch();
st->load_image("test1.jpg");
st->load_image("test2.jpg");
st->load_image("test3.jpg");
+ st->load_image("test4.jpg");
- win = new Fl_Window(0,0, 1000, 200);
- DataImage *img = new DataImage(0, 0, 1000, 200);
- st->resample(img, 2.0, 6.0);
+ win = new Fl_Window(0,0, 1000, 1000);
+ scroll = new Fl_Scroll(0, 0, win->w(), win->h());
+ DataImage *img = new DataImage(0, 0, 2000, 500);
win->show(0, argv);
+ st->resample(img, 0.0, 6.3);
Fl::run();
exit(0);
}