Permalink
Browse files

finish fixing pixel alignment for raster rendering in cairo - closes #…

  • Loading branch information...
1 parent 61e8a9c commit 2a3a402f5db9c8bf14fcc5ddd2e1d6fed2928bdc Dane Springmeyer committed Sep 12, 2012
Showing with 12 additions and 10 deletions.
  1. +3 −3 src/agg/process_raster_symbolizer.cpp
  2. +9 −7 src/cairo_renderer.cpp
@@ -68,10 +68,10 @@ void agg_renderer<T>::process(raster_symbolizer const& sym,
raster target(target_ext, target_data);
scaling_method_e scaling_method = sym.get_scaling_method();
double filter_radius = sym.calculate_filter_factor();
- double offset_x = ext.minx() - start_x;
- double offset_y = ext.miny() - start_y;
if (!prj_trans.equal())
{
+ double offset_x = ext.minx() - start_x;
+ double offset_y = ext.miny() - start_y;
reproject_and_scale_raster(target, *source, prj_trans,
offset_x, offset_y,
sym.get_mesh_size(),
@@ -82,7 +82,7 @@ void agg_renderer<T>::process(raster_symbolizer const& sym,
{
if (scaling_method == SCALING_BILINEAR8)
{
- scale_image_bilinear8<image_data_32>(target.data_,source->data_, offset_x, offset_y);
+ scale_image_bilinear8<image_data_32>(target.data_,source->data_, 0.0, 0.0);
} else
{
double scaling_ratio = ext.width() / source->data_.width();
View
@@ -1434,10 +1434,10 @@ void cairo_renderer_base::process(raster_symbolizer const& sym,
raster target(target_ext, target_data);
scaling_method_e scaling_method = sym.get_scaling_method();
double filter_radius = sym.calculate_filter_factor();
- double offset_x = ext.minx() - start_x;
- double offset_y = ext.miny() - start_y;
if (!prj_trans.equal())
{
+ double offset_x = ext.minx() - start_x;
+ double offset_y = ext.miny() - start_y;
reproject_and_scale_raster(target, *source, prj_trans,
offset_x, offset_y,
sym.get_mesh_size(),
@@ -1446,16 +1446,18 @@ void cairo_renderer_base::process(raster_symbolizer const& sym,
}
else
{
- if (scaling_method == SCALING_BILINEAR8){
- scale_image_bilinear8<image_data_32>(target.data_,source->data_, offset_x, offset_y);
- } else {
+ if (scaling_method == SCALING_BILINEAR8)
+ {
+ scale_image_bilinear8<image_data_32>(target.data_,source->data_, 0.0, 0.0);
+ } else
+ {
double scaling_ratio = ext.width() / source->data_.width();
scale_image_agg<image_data_32>(target.data_,
source->data_,
scaling_method,
scaling_ratio,
- offset_x,
- offset_y,
+ 0.0,
+ 0.0,
filter_radius);
}
}

0 comments on commit 2a3a402

Please sign in to comment.