From c469a63615f36fe984fed54e1e6935234b6e5e95 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Thu, 10 May 2012 18:17:14 +0100 Subject: [PATCH] + use standard compositing ops (process raster symbolizer) --- src/agg/process_raster_symbolizer.cpp | 32 ++------------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/src/agg/process_raster_symbolizer.cpp b/src/agg/process_raster_symbolizer.cpp index 8e932a463..e37b3bb6c 100644 --- a/src/agg/process_raster_symbolizer.cpp +++ b/src/agg/process_raster_symbolizer.cpp @@ -22,6 +22,7 @@ // mapnik #include +#include #include #include #include @@ -76,36 +77,7 @@ void agg_renderer::process(raster_symbolizer const& sym, scale_factor, sym.get_scaling()); - if (sym.get_mode() == "normal"){ - if (sym.get_opacity() == 1.0) { - pixmap_.set_rectangle_alpha(start_x,start_y,target.data_); - } else { - pixmap_.set_rectangle_alpha2(target.data_,start_x,start_y, sym.get_opacity()); - } - } else if (sym.get_mode() == "grain_merge"){ - pixmap_.template merge_rectangle (target.data_,start_x,start_y, sym.get_opacity()); - } else if (sym.get_mode() == "grain_merge2"){ - pixmap_.template merge_rectangle (target.data_,start_x,start_y, sym.get_opacity()); - } else if (sym.get_mode() == "multiply"){ - pixmap_.template merge_rectangle (target.data_,start_x,start_y, sym.get_opacity()); - } else if (sym.get_mode() == "multiply2"){ - pixmap_.template merge_rectangle (target.data_,start_x,start_y, sym.get_opacity()); - } else if (sym.get_mode() == "divide"){ - pixmap_.template merge_rectangle (target.data_,start_x,start_y, sym.get_opacity()); - } else if (sym.get_mode() == "divide2"){ - pixmap_.template merge_rectangle (target.data_,start_x,start_y, sym.get_opacity()); - } else if (sym.get_mode() == "screen"){ - pixmap_.template merge_rectangle (target.data_,start_x,start_y, sym.get_opacity()); - } else if (sym.get_mode() == "hard_light"){ - pixmap_.template merge_rectangle (target.data_,start_x,start_y, sym.get_opacity()); - } else { - if (sym.get_opacity() == 1.0){ - pixmap_.set_rectangle(start_x,start_y,target.data_); - } else { - pixmap_.set_rectangle_alpha2(target.data_,start_x,start_y, sym.get_opacity()); - } - } - // TODO: other modes? (add,diff,sub,...) + composite(current_buffer_->data(),target.data_,sym.comp_op(), sym.get_opacity(), false ,false); } } }