+ use standard compositing ops (process raster symbolizer)

This commit is contained in:
Artem Pavlenko 2012-05-10 18:17:14 +01:00
parent 5f5ca030b7
commit c469a63615

View file

@ -22,6 +22,7 @@
// mapnik
#include <mapnik/agg_renderer.hpp>
#include <mapnik/image_compositing.hpp>
#include <mapnik/graphics.hpp>
#include <mapnik/agg_rasterizer.hpp>
#include <mapnik/image_data.hpp>
@ -76,36 +77,7 @@ void agg_renderer<T>::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<MergeGrain> (target.data_,start_x,start_y, sym.get_opacity());
} else if (sym.get_mode() == "grain_merge2"){
pixmap_.template merge_rectangle<MergeGrain2> (target.data_,start_x,start_y, sym.get_opacity());
} else if (sym.get_mode() == "multiply"){
pixmap_.template merge_rectangle<Multiply> (target.data_,start_x,start_y, sym.get_opacity());
} else if (sym.get_mode() == "multiply2"){
pixmap_.template merge_rectangle<Multiply2> (target.data_,start_x,start_y, sym.get_opacity());
} else if (sym.get_mode() == "divide"){
pixmap_.template merge_rectangle<Divide> (target.data_,start_x,start_y, sym.get_opacity());
} else if (sym.get_mode() == "divide2"){
pixmap_.template merge_rectangle<Divide2> (target.data_,start_x,start_y, sym.get_opacity());
} else if (sym.get_mode() == "screen"){
pixmap_.template merge_rectangle<Screen> (target.data_,start_x,start_y, sym.get_opacity());
} else if (sym.get_mode() == "hard_light"){
pixmap_.template merge_rectangle<HardLight> (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);
}
}
}