summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-03-18 13:26:50 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-03-18 13:26:50 +0100
commitd7696768c7c89442e4a65ba089401bf2d3b619c6 (patch)
treebe960b8083909239567331fe3968204c74dc9c19 /src
parenteba7fcd8f7f91f7076ee291438d86545fdb9856d (diff)
limit color values
Diffstat (limited to 'src')
-rw-r--r--src/Stitch.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index c0a770b..23558ef 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -17,6 +17,7 @@
#include "Stitch.H"
#define MIN(A,B) ((A)<(B)?(A):(B))
+#define MAX(A,B) ((A)>(B)?(A):(B))
#define MAX_VALUE 65025
static double pi_d = asin(1.0) * 2.0;
@@ -235,7 +236,7 @@ Stitch::color_correct(int c, double a, int pic, int color) {
V1 * a * a +
V2 * a * a * a * a);
- return (int) MIN(rint(cd), 65025.0);
+ return MAX(MIN((int) rint(cd), 65025), 0);
}
int