summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-05-11 17:23:20 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-05-11 17:23:20 +0200
commit9256a7ef7644f12c5e2f20400b7bf8943433e080 (patch)
treec89de173dcc6f897ac121eef0c8294e9afb3b5f9 /src
parent5b4a674c5922c6516ce6fe580800bacb5bf18b91 (diff)
limit output values
Diffstat (limited to 'src')
-rw-r--r--src/GipfelWidget.cxx1
-rw-r--r--src/Stitch.cxx4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index c8a2fae..7abb1dd 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -756,7 +756,6 @@ GipfelWidget::get_pixel_bicubic(Fl_Image *img, double x, double y,
*r = (int) rint(interp_cubic(dy, dy2, dy3, c1[0]));
*g = (int) rint(interp_cubic(dy, dy2, dy3, c1[1]));
*b = (int) rint(interp_cubic(dy, dy2, dy3, c1[2]));
-
return 0;
}
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index 49d2c77..0038b28 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -122,6 +122,10 @@ Stitch::resample(GipfelWidget::sample_mode_t m,
if (gipf[i]->get_pixel(m, a_view, a_nick,
&r, &g, &b) == 0) {
+ r = MAX(MIN(r, MAX_VALUE), 0);
+ g = MAX(MIN(g, MAX_VALUE), 0);
+ b = MAX(MIN(b, MAX_VALUE), 0);
+
if (single_images[i]) {
single_images[i]->set_pixel(x, r, g, b);
}