finish fixing pixel alignment for raster rendering in cairo - closes #1471
This commit is contained in:
parent
61e8a9c236
commit
2a3a402f5d
2 changed files with 12 additions and 10 deletions
|
@ -68,10 +68,10 @@ void agg_renderer<T>::process(raster_symbolizer const& sym,
|
||||||
raster target(target_ext, target_data);
|
raster target(target_ext, target_data);
|
||||||
scaling_method_e scaling_method = sym.get_scaling_method();
|
scaling_method_e scaling_method = sym.get_scaling_method();
|
||||||
double filter_radius = sym.calculate_filter_factor();
|
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())
|
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,
|
reproject_and_scale_raster(target, *source, prj_trans,
|
||||||
offset_x, offset_y,
|
offset_x, offset_y,
|
||||||
sym.get_mesh_size(),
|
sym.get_mesh_size(),
|
||||||
|
@ -82,7 +82,7 @@ void agg_renderer<T>::process(raster_symbolizer const& sym,
|
||||||
{
|
{
|
||||||
if (scaling_method == SCALING_BILINEAR8)
|
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
|
} else
|
||||||
{
|
{
|
||||||
double scaling_ratio = ext.width() / source->data_.width();
|
double scaling_ratio = ext.width() / source->data_.width();
|
||||||
|
|
|
@ -1434,10 +1434,10 @@ void cairo_renderer_base::process(raster_symbolizer const& sym,
|
||||||
raster target(target_ext, target_data);
|
raster target(target_ext, target_data);
|
||||||
scaling_method_e scaling_method = sym.get_scaling_method();
|
scaling_method_e scaling_method = sym.get_scaling_method();
|
||||||
double filter_radius = sym.calculate_filter_factor();
|
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())
|
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,
|
reproject_and_scale_raster(target, *source, prj_trans,
|
||||||
offset_x, offset_y,
|
offset_x, offset_y,
|
||||||
sym.get_mesh_size(),
|
sym.get_mesh_size(),
|
||||||
|
@ -1446,16 +1446,18 @@ void cairo_renderer_base::process(raster_symbolizer const& sym,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (scaling_method == SCALING_BILINEAR8){
|
if (scaling_method == SCALING_BILINEAR8)
|
||||||
scale_image_bilinear8<image_data_32>(target.data_,source->data_, offset_x, offset_y);
|
{
|
||||||
} else {
|
scale_image_bilinear8<image_data_32>(target.data_,source->data_, 0.0, 0.0);
|
||||||
|
} else
|
||||||
|
{
|
||||||
double scaling_ratio = ext.width() / source->data_.width();
|
double scaling_ratio = ext.width() / source->data_.width();
|
||||||
scale_image_agg<image_data_32>(target.data_,
|
scale_image_agg<image_data_32>(target.data_,
|
||||||
source->data_,
|
source->data_,
|
||||||
scaling_method,
|
scaling_method,
|
||||||
scaling_ratio,
|
scaling_ratio,
|
||||||
offset_x,
|
0.0,
|
||||||
offset_y,
|
0.0,
|
||||||
filter_radius);
|
filter_radius);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue