From c7a40505652adc10d29b2049bb4553cf91cec823 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 15 Mar 2007 15:58:00 +0100 Subject: make it work with fixed vignetting params --- src/Stitch.cxx | 2 +- src/gipfel.cxx | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/Stitch.cxx b/src/Stitch.cxx index dbd0d53..1391fff 100644 --- a/src/Stitch.cxx +++ b/src/Stitch.cxx @@ -192,7 +192,7 @@ Stitch::color_calib(GipfelWidget::sample_mode_t m, c2[l]=((uchar)MIN(rint((double) c2[l] * devign), 255)); } - if (fabs(a1-a2) < 0.02 && + if (fabs(a1-a2) < 0.01 && fabs(((double) c1[1]) / ((double) c1[0]) - ((double) c2[1]) / ((double) c2[0])) < 1.0 && fabs(((double) c1[2]) / ((double) c1[0]) - diff --git a/src/gipfel.cxx b/src/gipfel.cxx index 7aad38f..23a5c5f 100644 --- a/src/gipfel.cxx +++ b/src/gipfel.cxx @@ -484,13 +484,17 @@ int main(int argc, char** argv) { } if (stitch_flag) { - int type = STITCH_PREVIEW; + int type = 0; if (jpeg_flag) { type = STITCH_JPEG; } else if (tiff_flag) { type = STITCH_TIFF; - } else if (vignette_flag) { - type = STITCH_VIGNETTE_CALIB; + } else { + type = STITCH_PREVIEW; + } + + if (vignette_flag) { + type |= STITCH_VIGNETTE_CALIB; } stitch(bilinear_flag?GipfelWidget::BILINEAR:GipfelWidget::NEAREST, @@ -564,12 +568,17 @@ stitch(GipfelWidget::sample_mode_t m, st->load_image(argv[i]); } - if (type == STITCH_JPEG) { + if (type & STITCH_VIGNETTE_CALIB) { + st->color_calib(m, stitch_w, stitch_h, from, to); + //st->vignette_calib(m, stitch_w, stitch_h, from, to); + } + + if (type & STITCH_JPEG) { st->set_output((OutputImage*) new JPEGOutputImage(path, 90)); st->resample(m, stitch_w, stitch_h, from, to); - } else if (type == STITCH_TIFF) { + } else if (type & STITCH_TIFF) { for (int i=0; ishow(0, argv); st->set_output((OutputImage*) img); - if (type == STITCH_VIGNETTE_CALIB) { - st->color_calib(m, stitch_w, stitch_h, from, to); - //st->vignette_calib(m, stitch_w, stitch_h, from, to); - st->resample(m, stitch_w, stitch_h, from, to); - } else { - st->resample(m, stitch_w, stitch_h, from, to); - } + st->resample(m, stitch_w, stitch_h, from, to); img->redraw(); Fl::run(); -- cgit v1.2.3