From a84256591579b7aa8edf7e9a8d9fcd6c18b27d63 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Tue, 29 Nov 2011 14:36:39 +0000 Subject: [PATCH] use explicit conversions --- src/raster_colorizer.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/raster_colorizer.cpp b/src/raster_colorizer.cpp index 03f2968f5..95aec3cb7 100644 --- a/src/raster_colorizer.cpp +++ b/src/raster_colorizer.cpp @@ -120,11 +120,9 @@ void raster_colorizer::colorize(raster_ptr const& raster,const std::map::const_iterator fi = Props.find("NODATA"); if (fi != Props.end()) - //if (Props.count("NODATA")>0) { hasNoData = true; - //noDataValue = Props.at("NODATA").to_double(); - noDataValue = fi->second.to_double(); + noDataValue = static_cast(fi->second.to_double()); } for (int i=0; i(fraction * (end - start) + start); } color raster_colorizer::get_color(float value) const { @@ -213,10 +211,10 @@ color raster_colorizer::get_color(float value) const { else { float fraction = (value - stopValue) / (nextStopValue - stopValue); - float r = interpolate(stopColor.red(), nextStopColor.red(),fraction); - float g = interpolate(stopColor.green(), nextStopColor.green(),fraction); - float b = interpolate(stopColor.blue(), nextStopColor.blue(),fraction); - float a = interpolate(stopColor.alpha(), nextStopColor.alpha(),fraction); + unsigned r = interpolate(stopColor.red(), nextStopColor.red(),fraction); + unsigned g = interpolate(stopColor.green(), nextStopColor.green(),fraction); + unsigned b = interpolate(stopColor.blue(), nextStopColor.blue(),fraction); + unsigned a = interpolate(stopColor.alpha(), nextStopColor.alpha(),fraction); outputColor.set_red(r); outputColor.set_green(g);