From e5700eff3f09a6c0b78663b397c141f677c5b16b Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 27 Jun 2014 11:33:09 +0200 Subject: [PATCH 3/3] round is not available on windows --- src/lib/PMDParser.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/PMDParser.cpp b/src/lib/PMDParser.cpp index 7c9ff2d..736ea1c 100644 --- a/src/lib/PMDParser.cpp +++ b/src/lib/PMDParser.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -608,9 +607,9 @@ void PMDParser::parseColors(const PMDRecordContainer &container) uint16_t max = (std::numeric_limits::max)(); - red = 255* round((1 - std::min(1.0, (double)cyan/max + (double)black/max))); - green = 255*round((1 - std::min(1.0, (double)magenta/max + (double)black/max))); - blue = 255*round((1 - std::min(1.0, (double)yellow/max + (double)black/max))); + red = 255* std::floor((1 - std::min(1.0, (double)cyan/max + (double)black/max) + 0.5)); + green = 255*std::floor((1 - std::min(1.0, (double)magenta/max + (double)black/max) + 0.5)); + blue = 255*std::floor((1 - std::min(1.0, (double)yellow/max + (double)black/max) + 0.5)); } else if (colorModel == HLS) { } -- 1.9.3