summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Stitch.cxx21
-rw-r--r--src/gipfel.cxx20
2 files changed, 28 insertions, 13 deletions
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index 21b0ba7..ae3158d 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -50,7 +50,10 @@ 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);
- gipf[i]->load_image(file);
+ if (gipf[i]->load_image(file) != 0) {
+ delete gipf[i];
+ gipf[i] = NULL;
+ }
break;
}
}
@@ -65,11 +68,12 @@ Stitch::resample(DataImage *img,
char r, g, b;
int y_off = img->h() / 2;
- for (int x=0; x<img->w(); x++) {
- for (int y=0; y<img->h(); y++) {
- double a_view, a_nick;
+ for (int y=0; y<img->h(); y++) {
+ double a_nick = atan(((double)(y_off - y)/(double)img->h()));
+
+ for (int x=0; x<img->w(); x++) {
+ double a_view;
a_view = view_start + x * step_view;
- a_nick = (y_off - y) * step_view;
for (int i=0; i<MAX_PICS; i++) {
if (gipf[i] == NULL) {
@@ -80,7 +84,10 @@ Stitch::resample(DataImage *img,
}
}
}
- img->redraw();
- Fl::check();
+
+ if (y % (img->h() / 200) == 0) {
+ img->redraw();
+ Fl::check();
+ }
}
}
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 19c21cb..d2850d7 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -362,6 +362,10 @@ int main(int argc, char** argv) {
exit(1);
}
+ if (stitch_flag) {
+ stitch(my_argc, my_argv);
+ }
+
Fl::get_system_colors();
if (getenv("FLTK_SCHEME")) {
Fl::scheme(NULL);
@@ -369,10 +373,6 @@ int main(int argc, char** argv) {
Fl::scheme("plastic");
}
- if (stitch_flag) {
- stitch(my_argc, my_argv);
- }
-
control_win = create_control_window();
view_win = new Fl_Window(800, 600);
@@ -420,13 +420,21 @@ int stitch(int argc, char **argv) {
st->load_image("test2.jpg");
st->load_image("test3.jpg");
st->load_image("test4.jpg");
+ st->load_image("test5.jpg");
+ st->load_image("test6.jpg");
+ st->load_image("test7.jpg");
+ st->load_image("test8.jpg");
+ st->load_image("test9.jpg");
+ st->load_image("test10.jpg");
+ st->load_image("test11.jpg");
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);
+ DataImage *img = new DataImage(0, 0, 10000, 2000);
+ win->resizable(scroll);
win->show(0, argv);
- st->resample(img, 0.0, 6.3);
+ st->resample(img, 0.0, 7.0);
Fl::run();
exit(0);
}