diff --git a/include/mapnik/raster_colorizer.hpp b/include/mapnik/raster_colorizer.hpp index 8a743e2d7..d7dbf65ad 100644 --- a/include/mapnik/raster_colorizer.hpp +++ b/include/mapnik/raster_colorizer.hpp @@ -206,7 +206,7 @@ public: //! //! \param[in] value Input value //! \return color associated with the value - color get_color(float value) const; + unsigned get_color(float value) const; //! \brief Set the epsilon value for exact mode diff --git a/src/raster_colorizer.cpp b/src/raster_colorizer.cpp index dd1dd126a..6bc0c052b 100644 --- a/src/raster_colorizer.cpp +++ b/src/raster_colorizer.cpp @@ -138,7 +138,7 @@ void raster_colorizer::colorize(raster_ptr const& raster, feature_impl const& f) } else { - imageData[i] = get_color(value).rgba(); + imageData[i] = get_color(value); } } } @@ -148,14 +148,14 @@ inline unsigned interpolate(unsigned start, unsigned end, float fraction) return static_cast(fraction * ((float)end - (float)start) + start); } -color raster_colorizer::get_color(float value) const +unsigned raster_colorizer::get_color(float value) const { int stopCount = stops_.size(); //use default color if no stops if(stopCount == 0) { - return default_color_; + return default_color_.rgba(); } //1 - Find the stop that the value is in @@ -278,7 +278,7 @@ color raster_colorizer::get_color(float value) const MAPNIK_LOG_DEBUG(raster_colorizer) << "\toutputColor: " << outputColor.to_string(); */ - return outputColor; + return outputColor.rgba(); }