Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

deprecate 'mode' on raster_symbolizer and map it to new comp-op - clo…

…ses #1257
  • Loading branch information...
commit 74990138438a8abf3954e1c1d147e9320d72cf24 1 parent c44b921
@springmeyer springmeyer authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 include/mapnik/raster_symbolizer.hpp
View
16 include/mapnik/raster_symbolizer.hpp
@@ -25,9 +25,11 @@
// mapnik
#include <mapnik/config.hpp>
+#include <mapnik/debug.hpp>
#include <mapnik/raster_colorizer.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/image_util.hpp>
+#include <mapnik/image_compositing.hpp>
namespace mapnik
{
@@ -54,11 +56,25 @@ struct MAPNIK_DECL raster_symbolizer : public symbolizer_base
std::string const& get_mode() const
{
+ MAPNIK_LOG_ERROR(raster_symbolizer) << "getting 'mode' is deprecated and will be removed in Mapnik 3.x, use 'comp-op' with Mapnik >= 2.1.x";
return mode_;
}
void set_mode(std::string const& mode)
{
+ MAPNIK_LOG_ERROR(raster_symbolizer) << "setting 'mode' is deprecated and will be removed in Mapnik 3.x, use 'comp-op' with Mapnik >= 2.1.x";
mode_ = mode;
+ if (mode == "normal")
+ {
+ this->set_comp_op(src_over);
+ }
+ else
+ {
+ boost::optional<composite_mode_e> comp_op = comp_op_from_string(mode);
+ if (comp_op)
+ this->set_comp_op(*comp_op);
+ else
+ MAPNIK_LOG_ERROR(raster_symbolizer) << "could not convert mode into comp-op";
+ }
}
std::string const& get_scaling() const
{
Please sign in to comment.
Something went wrong with that request. Please try again.