summaryrefslogtreecommitdiff
path: root/src/Stitch.cxx
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-01-18 16:17:21 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-01-18 16:17:21 +0100
commit61988218606c52684c8121a8274245bde4d3dcf5 (patch)
tree99f633997916005ef3d457d220f36835a484aedf /src/Stitch.cxx
parent7c3b29bde40fa215f35de1197c1ef0fc51f9c113 (diff)
use std::min() std::max()
Diffstat (limited to 'src/Stitch.cxx')
-rw-r--r--src/Stitch.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index 0038b28..ae06cde 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include <algorithm>
#include <gsl/gsl_multifit.h>
@@ -16,8 +17,6 @@
#include "OutputImage.H"
#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;
@@ -122,9 +121,9 @@ 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);
+ r = std::max(std::min(r, MAX_VALUE), 0);
+ g = std::max(std::min(g, MAX_VALUE), 0);
+ b = std::max(std::min(b, MAX_VALUE), 0);
if (single_images[i]) {
single_images[i]->set_pixel(x, r, g, b);