From bf376cf0a996b08c39f22d46ba68be4e7957777f Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sun, 25 Jun 2006 13:02:31 +0200 Subject: first working version --- src/gipfel.cxx | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 4a284aa..8247d7d 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -41,6 +41,8 @@ #include "Fl_Value_Dial.H" #include "Fl_Search_Chooser.H" #include "GipfelWidget.H" +#include "DataImage.H" +#include "Stitch.H" #include "choose_hill.H" #include "../config.h" @@ -60,6 +62,8 @@ Fl_Value_Input *i_view_lat, *i_view_long, *i_view_height; Fl_Box *b_viewpoint; Fl_Menu_Bar *mb; +int stitch(int argc, char **argv); + void set_values() { s_center->value(gipf->get_center_angle()); s_nick->value(gipf->get_nick_angle()); @@ -319,12 +323,13 @@ int main(int argc, char** argv) { char c, *sep, *tmp, **my_argv; char *view_point = NULL; int err, bflag = 0, dflag = 0, my_argc; + int stitch_flag = 0; Fl_Window *control_win, *view_win; Fl_Scroll *scroll; err = 0; - while ((c = getopt(argc, argv, "d:v:")) != EOF) { + while ((c = getopt(argc, argv, "d:v:s")) != EOF) { switch (c) { case 'h': usage(); @@ -336,6 +341,9 @@ int main(int argc, char** argv) { case 'v': view_point = optarg; break; + case 's': + stitch_flag++; + break; default: err++; } @@ -361,6 +369,10 @@ 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); @@ -398,3 +410,20 @@ int main(int argc, char** argv) { return Fl::run(); } + +int stitch(int argc, char **argv) { + Fl_Window *win; + Stitch *st = new Stitch(); + + st->load_image("test1.jpg"); + st->load_image("test2.jpg"); + st->load_image("test3.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->show(0, argv); + Fl::run(); + exit(0); +} -- cgit v1.2.3 From 88555db930fc170f97ebbca6c17802392a5b5f25 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sun, 25 Jun 2006 13:51:38 +0200 Subject: show stitching online --- src/gipfel.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gipfel.cxx') 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); } -- cgit v1.2.3 From 5e188fda3b5d539b299a7c7ce63f98264fa8c229 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sun, 25 Jun 2006 19:31:08 +0200 Subject: adjust parameters --- src/gipfel.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/gipfel.cxx') 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); } -- cgit v1.2.3 From 76daa38e38aff35613dcaf18330192833fd83deb Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 26 Jun 2006 17:24:20 +0200 Subject: add -w and -h switch --- src/gipfel.cxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index d2850d7..3a68ec3 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -62,7 +62,7 @@ Fl_Value_Input *i_view_lat, *i_view_long, *i_view_height; Fl_Box *b_viewpoint; Fl_Menu_Bar *mb; -int stitch(int argc, char **argv); +int stitch(int stitch_w, int stitch_h, int argc, char **argv); void set_values() { s_center->value(gipf->get_center_angle()); @@ -323,13 +323,13 @@ int main(int argc, char** argv) { char c, *sep, *tmp, **my_argv; char *view_point = NULL; int err, bflag = 0, dflag = 0, my_argc; - int stitch_flag = 0; + int stitch_flag = 0, stitch_w = 2000, stitch_h = 500; Fl_Window *control_win, *view_win; Fl_Scroll *scroll; err = 0; - while ((c = getopt(argc, argv, "d:v:s")) != EOF) { + while ((c = getopt(argc, argv, "d:v:sw:b:")) != EOF) { switch (c) { case 'h': usage(); @@ -344,6 +344,12 @@ int main(int argc, char** argv) { case 's': stitch_flag++; break; + case 'w': + stitch_w = atoi(optarg); + break; + case 'b': + stitch_h = atoi(optarg); + break; default: err++; } @@ -363,7 +369,7 @@ int main(int argc, char** argv) { } if (stitch_flag) { - stitch(my_argc, my_argv); + stitch(stitch_w, stitch_h, my_argc, my_argv); } Fl::get_system_colors(); @@ -411,7 +417,7 @@ int main(int argc, char** argv) { return Fl::run(); } -int stitch(int argc, char **argv) { +int stitch(int stitch_w, int stitch_h, int argc, char **argv) { Fl_Window *win; Fl_Scroll *scroll; Stitch *st = new Stitch(); @@ -428,9 +434,9 @@ int stitch(int argc, char **argv) { st->load_image("test10.jpg"); st->load_image("test11.jpg"); - win = new Fl_Window(0,0, 1000, 1000); + win = new Fl_Window(0,0, 1000, stitch_h); scroll = new Fl_Scroll(0, 0, win->w(), win->h()); - DataImage *img = new DataImage(0, 0, 10000, 2000); + DataImage *img = new DataImage(0, 0, stitch_w, stitch_h); win->resizable(scroll); win->show(0, argv); -- cgit v1.2.3 From fe07ad525e8326bf857d5ac8e1998ff3b7c343d1 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 29 Jun 2006 21:16:14 +0200 Subject: use image files from command line for stitching --- src/gipfel.cxx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 3a68ec3..a5b0fc9 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -422,17 +422,9 @@ int stitch(int stitch_w, int stitch_h, int argc, char **argv) { 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"); - 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"); + for (int i=0; iload_image(argv[i]); + } win = new Fl_Window(0,0, 1000, stitch_h); scroll = new Fl_Scroll(0, 0, win->w(), win->h()); -- cgit v1.2.3 From d258151391bead3a167f54068096a8d727ba273a Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 31 Jul 2006 17:09:25 +0200 Subject: add jpeg write support to DataImage --- src/gipfel.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index a5b0fc9..acdd1de 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -433,6 +433,8 @@ int stitch(int stitch_w, int stitch_h, int argc, char **argv) { win->show(0, argv); st->resample(img, 0.0, 7.0); + + img->write_jpeg("/tmp/bla.jpg", 90); Fl::run(); exit(0); } -- cgit v1.2.3 From ff7773a8da615e4dc91320636beb4e6877777a01 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 31 Jul 2006 20:34:14 +0200 Subject: initial tiff write support --- src/gipfel.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index acdd1de..309ee9d 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -435,6 +435,7 @@ int stitch(int stitch_w, int stitch_h, int argc, char **argv) { st->resample(img, 0.0, 7.0); img->write_jpeg("/tmp/bla.jpg", 90); + img->write_tiff("/tmp/bla.tiff"); Fl::run(); exit(0); } -- cgit v1.2.3 From a00d85aef36050ffd29b46ed19e04a5af9a47488 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 31 Jul 2006 21:11:27 +0200 Subject: add tiff stitching --- src/gipfel.cxx | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 309ee9d..d8cea1c 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -62,7 +62,8 @@ Fl_Value_Input *i_view_lat, *i_view_long, *i_view_height; Fl_Box *b_viewpoint; Fl_Menu_Bar *mb; -int stitch(int stitch_w, int stitch_h, int argc, char **argv); +static int tiffstitch(int stitch_w, int stitch_h, int argc, char **argv); +static int stitch(int stitch_w, int stitch_h, int argc, char **argv); void set_values() { s_center->value(gipf->get_center_angle()); @@ -323,13 +324,13 @@ int main(int argc, char** argv) { char c, *sep, *tmp, **my_argv; char *view_point = NULL; int err, bflag = 0, dflag = 0, my_argc; - int stitch_flag = 0, stitch_w = 2000, stitch_h = 500; + int stitch_flag = 0, tiff_flag = 0, stitch_w = 2000, stitch_h = 500; Fl_Window *control_win, *view_win; Fl_Scroll *scroll; err = 0; - while ((c = getopt(argc, argv, "d:v:sw:b:")) != EOF) { + while ((c = getopt(argc, argv, "d:v:sw:b:t")) != EOF) { switch (c) { case 'h': usage(); @@ -344,6 +345,10 @@ int main(int argc, char** argv) { case 's': stitch_flag++; break; + case 't': + stitch_flag++; + tiff_flag++; + break; case 'w': stitch_w = atoi(optarg); break; @@ -369,7 +374,12 @@ int main(int argc, char** argv) { } if (stitch_flag) { - stitch(stitch_w, stitch_h, my_argc, my_argv); + if (tiff_flag) { + tiffstitch(stitch_w, stitch_h, my_argc, my_argv); + } else { + stitch(stitch_w, stitch_h, my_argc, my_argv); + } + exit(0); } Fl::get_system_colors(); @@ -417,7 +427,27 @@ int main(int argc, char** argv) { return Fl::run(); } -int stitch(int stitch_w, int stitch_h, int argc, char **argv) { +static int tiffstitch(int stitch_w, int stitch_h, int argc, char **argv) { + char buf[256]; + + for (int i=0; iload_image(argv[i]); + + st->resample(img, 0.0, 7.0); + snprintf(buf, sizeof(buf), "gipfel_%d.tiff", i); + img->write_tiff(buf); + delete st; + delete img; + } + + return 0; +} + + +static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { Fl_Window *win; Fl_Scroll *scroll; Stitch *st = new Stitch(); @@ -435,7 +465,7 @@ int stitch(int stitch_w, int stitch_h, int argc, char **argv) { st->resample(img, 0.0, 7.0); img->write_jpeg("/tmp/bla.jpg", 90); - img->write_tiff("/tmp/bla.tiff"); Fl::run(); - exit(0); + + return 0; } -- cgit v1.2.3 From 52669d81a766eacc1b4e60d0cf477e35b598fcbe Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 2 Aug 2006 17:12:55 +0200 Subject: change Stitch to use OutputImage instead of DataImage --- src/gipfel.cxx | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index d8cea1c..5cd170a 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -41,7 +41,7 @@ #include "Fl_Value_Dial.H" #include "Fl_Search_Chooser.H" #include "GipfelWidget.H" -#include "DataImage.H" +#include "JPEGOutputImage.H" #include "Stitch.H" #include "choose_hill.H" #include "../config.h" @@ -62,7 +62,6 @@ Fl_Value_Input *i_view_lat, *i_view_long, *i_view_height; Fl_Box *b_viewpoint; Fl_Menu_Bar *mb; -static int tiffstitch(int stitch_w, int stitch_h, int argc, char **argv); static int stitch(int stitch_w, int stitch_h, int argc, char **argv); void set_values() { @@ -324,13 +323,13 @@ int main(int argc, char** argv) { char c, *sep, *tmp, **my_argv; char *view_point = NULL; int err, bflag = 0, dflag = 0, my_argc; - int stitch_flag = 0, tiff_flag = 0, stitch_w = 2000, stitch_h = 500; + int stitch_flag = 0, stitch_w = 2000, stitch_h = 500; Fl_Window *control_win, *view_win; Fl_Scroll *scroll; err = 0; - while ((c = getopt(argc, argv, "d:v:sw:b:t")) != EOF) { + while ((c = getopt(argc, argv, "d:v:sw:b:")) != EOF) { switch (c) { case 'h': usage(); @@ -345,10 +344,6 @@ int main(int argc, char** argv) { case 's': stitch_flag++; break; - case 't': - stitch_flag++; - tiff_flag++; - break; case 'w': stitch_w = atoi(optarg); break; @@ -374,11 +369,7 @@ int main(int argc, char** argv) { } if (stitch_flag) { - if (tiff_flag) { - tiffstitch(stitch_w, stitch_h, my_argc, my_argv); - } else { - stitch(stitch_w, stitch_h, my_argc, my_argv); - } + stitch(stitch_w, stitch_h, my_argc, my_argv); exit(0); } @@ -427,6 +418,7 @@ int main(int argc, char** argv) { return Fl::run(); } +#if 0 static int tiffstitch(int stitch_w, int stitch_h, int argc, char **argv) { char buf[256]; @@ -445,6 +437,7 @@ static int tiffstitch(int stitch_w, int stitch_h, int argc, char **argv) { return 0; } +#endif static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { @@ -455,16 +448,18 @@ static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { for (int i=0; iload_image(argv[i]); } - +#if 0 win = new Fl_Window(0,0, 1000, stitch_h); scroll = new Fl_Scroll(0, 0, win->w(), win->h()); - DataImage *img = new DataImage(0, 0, stitch_w, stitch_h); + PreviewOutputImage *img = new PreviewOutputImage(); win->resizable(scroll); win->show(0, argv); st->resample(img, 0.0, 7.0); +#endif - img->write_jpeg("/tmp/bla.jpg", 90); + st->set_output((OutputImage*) new JPEGOutputImage("/tmp/bla.jpg", 90)); + st->resample(stitch_w, stitch_h, 0.0, 7.0); Fl::run(); return 0; -- cgit v1.2.3 From 732e18ac89479a9a789068b32145825bb0c98ba4 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 2 Aug 2006 18:00:23 +0200 Subject: implement PreviewOutputImage --- src/gipfel.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 5cd170a..5dd69a7 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -42,6 +42,7 @@ #include "Fl_Search_Chooser.H" #include "GipfelWidget.H" #include "JPEGOutputImage.H" +#include "PreviewOutputImage.H" #include "Stitch.H" #include "choose_hill.H" #include "../config.h" @@ -448,18 +449,18 @@ static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { for (int i=0; iload_image(argv[i]); } -#if 0 + win = new Fl_Window(0,0, 1000, stitch_h); scroll = new Fl_Scroll(0, 0, win->w(), win->h()); - PreviewOutputImage *img = new PreviewOutputImage(); + PreviewOutputImage *img = new PreviewOutputImage(0, 0, stitch_w, stitch_h); win->resizable(scroll); win->show(0, argv); - st->resample(img, 0.0, 7.0); -#endif - st->set_output((OutputImage*) new JPEGOutputImage("/tmp/bla.jpg", 90)); + //st->set_output((OutputImage*) new JPEGOutputImage("/tmp/bla.jpg", 90)); + st->set_output((OutputImage*) img); st->resample(stitch_w, stitch_h, 0.0, 7.0); + img->redraw(); Fl::run(); return 0; -- cgit v1.2.3 From f2e115a29f85d8d637f2e0894532212e93691118 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 2 Aug 2006 18:06:28 +0200 Subject: cleanup --- src/gipfel.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 5dd69a7..8256cd8 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -450,7 +450,7 @@ static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { st->load_image(argv[i]); } - win = new Fl_Window(0,0, 1000, stitch_h); + win = new Fl_Window(0,0, stitch_w, stitch_h); scroll = new Fl_Scroll(0, 0, win->w(), win->h()); PreviewOutputImage *img = new PreviewOutputImage(0, 0, stitch_w, stitch_h); win->resizable(scroll); -- cgit v1.2.3 From 699556f7efcf6a9af39c37bd0c881ee3edc21da3 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 2 Aug 2006 18:21:54 +0200 Subject: add JPEGOutputImage.cxx --- src/gipfel.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 8256cd8..8e0e1b9 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -457,8 +457,8 @@ static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { win->show(0, argv); - //st->set_output((OutputImage*) new JPEGOutputImage("/tmp/bla.jpg", 90)); - st->set_output((OutputImage*) img); + st->set_output((OutputImage*) new JPEGOutputImage("/tmp/bla.jpg", 90)); + //st->set_output((OutputImage*) img); st->resample(stitch_w, stitch_h, 0.0, 7.0); img->redraw(); Fl::run(); -- cgit v1.2.3 From 6524c95bb8ea0339908ab9bff03211f8c42e77d9 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 3 Aug 2006 20:45:57 +0200 Subject: add TIFFOutputImage --- src/gipfel.cxx | 95 +++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 38 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 8e0e1b9..74b092a 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -42,6 +42,7 @@ #include "Fl_Search_Chooser.H" #include "GipfelWidget.H" #include "JPEGOutputImage.H" +#include "TIFFOutputImage.H" #include "PreviewOutputImage.H" #include "Stitch.H" #include "choose_hill.H" @@ -63,7 +64,11 @@ Fl_Value_Input *i_view_lat, *i_view_long, *i_view_height; Fl_Box *b_viewpoint; Fl_Menu_Bar *mb; -static int stitch(int stitch_w, int stitch_h, int argc, char **argv); +#define STITCH_PREVIEW 1 +#define STITCH_JPEG 2 +#define STITCH_TIFF 4 +static int stitch(int stitch_w, int stitch_h, int type, const char *path, + int argc, char **argv); void set_values() { s_center->value(gipf->get_center_angle()); @@ -325,14 +330,16 @@ 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; + char *outpath; Fl_Window *control_win, *view_win; Fl_Scroll *scroll; err = 0; - while ((c = getopt(argc, argv, "d:v:sw:b:")) != EOF) { + while ((c = getopt(argc, argv, "?d:v:sw:h:j:t:")) != EOF) { switch (c) { - case 'h': + case '?': usage(); exit(0); break; @@ -345,10 +352,18 @@ int main(int argc, char** argv) { case 's': stitch_flag++; break; + case 'j': + jpeg_flag++; + outpath = optarg; + break; + case 't': + tiff_flag++; + outpath = optarg; + break; case 'w': stitch_w = atoi(optarg); break; - case 'b': + case 'h': stitch_h = atoi(optarg); break; default: @@ -370,7 +385,13 @@ int main(int argc, char** argv) { } if (stitch_flag) { - stitch(stitch_w, stitch_h, my_argc, my_argv); + int type = STITCH_PREVIEW; + if (jpeg_flag) { + type = STITCH_JPEG; + } else if (tiff_flag) { + type = STITCH_TIFF; + } + stitch(stitch_w, stitch_h, type, outpath, my_argc, my_argv); exit(0); } @@ -419,29 +440,7 @@ int main(int argc, char** argv) { return Fl::run(); } -#if 0 -static int tiffstitch(int stitch_w, int stitch_h, int argc, char **argv) { - char buf[256]; - - for (int i=0; iload_image(argv[i]); - - st->resample(img, 0.0, 7.0); - snprintf(buf, sizeof(buf), "gipfel_%d.tiff", i); - img->write_tiff(buf); - delete st; - delete img; - } - - return 0; -} -#endif - - -static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { +static int stitch(int stitch_w, int stitch_h, int type, const char *path, int argc, char **argv) { Fl_Window *win; Fl_Scroll *scroll; Stitch *st = new Stitch(); @@ -449,19 +448,39 @@ static int stitch(int stitch_w, int stitch_h, int argc, char **argv) { for (int i=0; iload_image(argv[i]); } + + if (type == STITCH_JPEG) { + + st->set_output((OutputImage*) new JPEGOutputImage(path, 90)); + st->resample(stitch_w, stitch_h, 0.0, 7.0); + + } else if (type == STITCH_TIFF) { - win = new Fl_Window(0,0, stitch_w, stitch_h); - scroll = new Fl_Scroll(0, 0, win->w(), win->h()); - PreviewOutputImage *img = new PreviewOutputImage(0, 0, stitch_w, stitch_h); - win->resizable(scroll); + for (int i=0; ishow(0, argv); + snprintf(buf, sizeof(buf), "%s/%s", path, argv[i]); + dot = strrchr(buf, '.'); + *dot = '\0'; + strncat(buf, ".tiff", sizeof(buf)); - st->set_output((OutputImage*) new JPEGOutputImage("/tmp/bla.jpg", 90)); - //st->set_output((OutputImage*) img); - st->resample(stitch_w, stitch_h, 0.0, 7.0); - img->redraw(); - Fl::run(); + st->set_output(argv[i], (OutputImage*) new TIFFOutputImage(buf)); + } + + st->resample(stitch_w, stitch_h, 0.0, 7.0); + + } else { + win = new Fl_Window(0,0, stitch_w, stitch_h); + scroll = new Fl_Scroll(0, 0, win->w(), win->h()); + PreviewOutputImage *img = new PreviewOutputImage(0, 0, stitch_w, stitch_h); + win->resizable(scroll); + win->show(0, argv); + st->set_output((OutputImage*) img); + st->resample(stitch_w, stitch_h, 0.0, 7.0); + img->redraw(); + Fl::run(); + } return 0; } -- cgit v1.2.3 From 641efabfea98270beef8b7f8a472b8d9e6f0c3aa Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 3 Aug 2006 20:50:47 +0200 Subject: adjust usage --- src/gipfel.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 74b092a..139b850 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -211,12 +211,16 @@ void fill_menubar(Fl_Menu_Bar* mb) { void usage() { fprintf(stderr, - "usage: gipfel [-v ] [-d ] []\n" + "usage: gipfel [-v ] [-d ]\n" + " [-s] [-j ] [-t ]\n" " -v Set point from which the picture was taken.\n" " This must be a string that unambiguously \n" " matches the name of an entry in the data file.\n" " -d Use for GPS data.\n" - " JPEG file to use.\n"); + " -s Stitch mode.\n" + " -j JPEG output file for Stitch mode.\n" + " -t Output directory for TIFF images in Stitch mode.\n" + " JPEG file(s) to use.\n"); } Fl_Window * -- cgit v1.2.3 From 145d775aa43d49e5f9de30f51bd88c0f0f46183c Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 3 Aug 2006 21:26:37 +0200 Subject: update README and usage --- src/gipfel.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gipfel.cxx') diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 139b850..9755f2e 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -212,7 +212,8 @@ void fill_menubar(Fl_Menu_Bar* mb) { void usage() { fprintf(stderr, "usage: gipfel [-v ] [-d ]\n" - " [-s] [-j ] [-t ]\n" + " [-s] [-j ] [-t ] [-h ]\n" + " []\n" " -v Set point from which the picture was taken.\n" " This must be a string that unambiguously \n" " matches the name of an entry in the data file.\n" @@ -220,7 +221,7 @@ void usage() { " -s Stitch mode.\n" " -j JPEG output file for Stitch mode.\n" " -t Output directory for TIFF images in Stitch mode.\n" - " JPEG file(s) to use.\n"); + " JPEG file(s) to use.\n"); } Fl_Window * -- cgit v1.2.3