remove raster_symbolizer and line_pattern_symbolizer from agg_renderer, moved to src/agg in r1929
This commit is contained in:
parent
36928706bb
commit
83f91867bc
1 changed files with 0 additions and 112 deletions
|
@ -169,117 +169,5 @@ void agg_renderer<T>::end_layer_processing(layer const&)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
void agg_renderer<T>::process(line_pattern_symbolizer const& sym,
|
|
||||||
Feature const& feature,
|
|
||||||
proj_transform const& prj_trans)
|
|
||||||
{
|
|
||||||
typedef coord_transform2<CoordTransform,geometry2d> path_type;
|
|
||||||
typedef agg::line_image_pattern<agg::pattern_filter_bilinear_rgba8> pattern_type;
|
|
||||||
typedef agg::renderer_base<agg::pixfmt_rgba32_plain> renderer_base;
|
|
||||||
typedef agg::renderer_outline_image<renderer_base, pattern_type> renderer_type;
|
|
||||||
typedef agg::rasterizer_outline_aa<renderer_type> rasterizer_type;
|
|
||||||
|
|
||||||
agg::rendering_buffer buf(pixmap_.raw_data(),width_,height_, width_ * 4);
|
|
||||||
agg::pixfmt_rgba32_plain pixf(buf);
|
|
||||||
|
|
||||||
std::string filename = path_processor_type::evaluate( *sym.get_filename(), feature);
|
|
||||||
boost::optional<image_ptr> pat = image_cache::instance()->find(filename,true);
|
|
||||||
|
|
||||||
if (!pat) return;
|
|
||||||
|
|
||||||
renderer_base ren_base(pixf);
|
|
||||||
agg::pattern_filter_bilinear_rgba8 filter;
|
|
||||||
pattern_source source(*(*pat));
|
|
||||||
pattern_type pattern (filter,source);
|
|
||||||
renderer_type ren(ren_base, pattern);
|
|
||||||
ren.clip_box(0,0,width_,height_);
|
|
||||||
rasterizer_type ras(ren);
|
|
||||||
|
|
||||||
for (unsigned i=0;i<feature.num_geometries();++i)
|
|
||||||
{
|
|
||||||
geometry2d const& geom = feature.get_geometry(i);
|
|
||||||
if (geom.num_points() > 1)
|
|
||||||
{
|
|
||||||
path_type path(t_,geom,prj_trans);
|
|
||||||
ras.add_path(path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
void agg_renderer<T>::process(raster_symbolizer const& sym,
|
|
||||||
Feature const& feature,
|
|
||||||
proj_transform const& prj_trans)
|
|
||||||
{
|
|
||||||
raster_ptr const& raster=feature.get_raster();
|
|
||||||
if (raster)
|
|
||||||
{
|
|
||||||
// If there's a colorizer defined, use it to color the raster in-place
|
|
||||||
raster_colorizer_ptr colorizer = sym.get_colorizer();
|
|
||||||
if (colorizer)
|
|
||||||
colorizer->colorize(raster);
|
|
||||||
|
|
||||||
box2d<double> ext=t_.forward(raster->ext_);
|
|
||||||
|
|
||||||
int start_x = rint(ext.minx());
|
|
||||||
int start_y = rint(ext.miny());
|
|
||||||
int raster_width = rint(ext.width());
|
|
||||||
int raster_height = rint(ext.height());
|
|
||||||
int end_x = start_x + raster_width;
|
|
||||||
int end_y = start_y + raster_height;
|
|
||||||
double err_offs_x = (ext.minx()-start_x + ext.maxx()-end_x)/2;
|
|
||||||
double err_offs_y = (ext.miny()-start_y + ext.maxy()-end_y)/2;
|
|
||||||
|
|
||||||
if ( raster_width > 0 && raster_height > 0)
|
|
||||||
{
|
|
||||||
image_data_32 target(raster_width,raster_height);
|
|
||||||
|
|
||||||
if (sym.get_scaling() == "fast") {
|
|
||||||
scale_image<image_data_32>(target,raster->data_);
|
|
||||||
} else if (sym.get_scaling() == "bilinear"){
|
|
||||||
scale_image_bilinear<image_data_32>(target,raster->data_, err_offs_x, err_offs_y);
|
|
||||||
} else if (sym.get_scaling() == "bilinear8"){
|
|
||||||
scale_image_bilinear8<image_data_32>(target,raster->data_, err_offs_x, err_offs_y);
|
|
||||||
} else {
|
|
||||||
scale_image<image_data_32>(target,raster->data_);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sym.get_mode() == "normal"){
|
|
||||||
if (sym.get_opacity() == 1.0) {
|
|
||||||
pixmap_.set_rectangle(start_x,start_y,target);
|
|
||||||
} else {
|
|
||||||
pixmap_.set_rectangle_alpha2(target,start_x,start_y, sym.get_opacity());
|
|
||||||
}
|
|
||||||
} else if (sym.get_mode() == "grain_merge"){
|
|
||||||
pixmap_.template merge_rectangle<MergeGrain> (target,start_x,start_y, sym.get_opacity());
|
|
||||||
} else if (sym.get_mode() == "grain_merge2"){
|
|
||||||
pixmap_.template merge_rectangle<MergeGrain2> (target,start_x,start_y, sym.get_opacity());
|
|
||||||
} else if (sym.get_mode() == "multiply"){
|
|
||||||
pixmap_.template merge_rectangle<Multiply> (target,start_x,start_y, sym.get_opacity());
|
|
||||||
} else if (sym.get_mode() == "multiply2"){
|
|
||||||
pixmap_.template merge_rectangle<Multiply2> (target,start_x,start_y, sym.get_opacity());
|
|
||||||
} else if (sym.get_mode() == "divide"){
|
|
||||||
pixmap_.template merge_rectangle<Divide> (target,start_x,start_y, sym.get_opacity());
|
|
||||||
} else if (sym.get_mode() == "divide2"){
|
|
||||||
pixmap_.template merge_rectangle<Divide2> (target,start_x,start_y, sym.get_opacity());
|
|
||||||
} else if (sym.get_mode() == "screen"){
|
|
||||||
pixmap_.template merge_rectangle<Screen> (target,start_x,start_y, sym.get_opacity());
|
|
||||||
} else if (sym.get_mode() == "hard_light"){
|
|
||||||
pixmap_.template merge_rectangle<HardLight> (target,start_x,start_y, sym.get_opacity());
|
|
||||||
} else {
|
|
||||||
if (sym.get_opacity() == 1.0){
|
|
||||||
pixmap_.set_rectangle(start_x,start_y,target);
|
|
||||||
} else {
|
|
||||||
pixmap_.set_rectangle_alpha2(target,start_x,start_y, sym.get_opacity());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// TODO: other modes? (add,diff,sub,...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template class agg_renderer<image_32>;
|
template class agg_renderer<image_32>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue