diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2007-03-18 13:26:50 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2007-03-18 13:26:50 +0100 |
commit | d7696768c7c89442e4a65ba089401bf2d3b619c6 (patch) | |
tree | be960b8083909239567331fe3968204c74dc9c19 /src | |
parent | eba7fcd8f7f91f7076ee291438d86545fdb9856d (diff) |
limit color values
Diffstat (limited to 'src')
-rw-r--r-- | src/Stitch.cxx | 3 |
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 |