summaryrefslogtreecommitdiff
path: root/src/Stitch.cxx
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/Stitch.cxx
parent5b4a674c5922c6516ce6fe580800bacb5bf18b91 (diff)
limit output values
Diffstat (limited to 'src/Stitch.cxx')
-rw-r--r--src/Stitch.cxx4
1 files changed, 4 insertions, 0 deletions
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);
}