From 0c74cc4f4dc739772f7c1f450c96e4b6abd9bd3a Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 26 Jan 2009 11:07:11 +0100 Subject: standardize -t option for stitching to a TIFF file --- src/Stitch.H | 3 --- src/Stitch.cxx | 41 ++--------------------------------------- src/gipfel.cxx | 19 +++---------------- 3 files changed, 5 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/Stitch.H b/src/Stitch.H index 0632192..1617379 100644 --- a/src/Stitch.H +++ b/src/Stitch.H @@ -18,7 +18,6 @@ class Stitch { private: GipfelWidget *gipf[MAX_PICS]; int num_pics; - OutputImage *single_images[MAX_PICS]; OutputImage *merged_image; public: @@ -30,8 +29,6 @@ class Stitch { OutputImage * set_output(OutputImage *img); - OutputImage * set_output(const char *file, OutputImage *img); - int resample(GipfelWidget::sample_mode_t m, int w, int h, double view_start, double view_end); }; diff --git a/src/Stitch.cxx b/src/Stitch.cxx index 251323d..6ab6542 100644 --- a/src/Stitch.cxx +++ b/src/Stitch.cxx @@ -23,10 +23,8 @@ static double pi_d = asin(1.0) * 2.0; static double deg2rad = pi_d / 180.0; Stitch::Stitch() { - for (int i=0; iget_image_filename(); - if (img_file && strcmp(file, img_file) == 0) { - ret = single_images[i]; - single_images[i] = img; - break; - } - } - } - - return ret; -} - int Stitch::resample(GipfelWidget::sample_mode_t m, int w, int h, double view_start, double view_end) { @@ -102,11 +82,6 @@ Stitch::resample(GipfelWidget::sample_mode_t m, if (merged_image->init(w, h) != 0) merged_image = NULL; - for (int i=0; iinit(w, h) != 0) - single_images[i] = NULL; - for (int y = 0; y < h; y++) { double a_nick = atan((double)(y_off - y)/radius); @@ -115,7 +90,7 @@ Stitch::resample(GipfelWidget::sample_mode_t m, a_view = view_start + x * step_view; merged_pixel_set = 0; for (int i = 0; i < num_pics; i++) { - if (merged_pixel_set && !single_images[i]) + if (merged_pixel_set) continue; if (gipf[i]->get_pixel(m, a_view, a_nick, @@ -125,9 +100,6 @@ Stitch::resample(GipfelWidget::sample_mode_t m, g = std::max(std::min(g, MAX_VALUE), 0); b = std::max(std::min(b, MAX_VALUE), 0); - if (single_images[i]) - single_images[i]->set_pixel(x, r, g, b); - if (!merged_pixel_set && merged_image) { merged_image->set_pixel(x, r, g, b); merged_pixel_set++; @@ -138,19 +110,10 @@ Stitch::resample(GipfelWidget::sample_mode_t m, if (merged_image) merged_image->next_line(); - - for (int i=0; inext_line(); - } } if (merged_image) merged_image->done(); - for (int i=0; idone(); - return 0; } diff --git a/src/gipfel.cxx b/src/gipfel.cxx index ce90816..69648d6 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -293,8 +293,8 @@ void usage() { " -b Use bicubic interpolation for stitching.\n" " -w Width of result image.\n" " -h Height of result image.\n" - " -j JPEG output file for Stitch mode.\n" - " -t Output directory for TIFF images in Stitch mode.\n" + " -j JPEG output file in Stitch mode.\n" + " -t TIFF output file in Stitch mode.\n" " -p Export position of image to stdout.\n" " -e Export positions of hills from on image.\n" " -E Export hills from default data file.\n" @@ -623,20 +623,7 @@ stitch(GipfelWidget::sample_mode_t m, int b_16, } else if (type & STITCH_TIFF) { - for (int i=0; iset_output(argv[i], new TIFFOutputImage(buf, b_16?16:8)); - } - + st->set_output(new TIFFOutputImage(path, 90)); st->resample(m, stitch_w, stitch_h, from, to); } else { -- cgit v1.2.3