diff --git a/src/agg/process_raster_symbolizer.cpp b/src/agg/process_raster_symbolizer.cpp index e2756eaa5..37ec3eff8 100644 --- a/src/agg/process_raster_symbolizer.cpp +++ b/src/agg/process_raster_symbolizer.cpp @@ -72,10 +72,8 @@ static inline void resample_raster(raster &target, raster const& source, CoordTransform tt(target.data_.width(), target.data_.height(), target.ext_, offset_x, offset_y); unsigned i, j, mesh_size=16; - unsigned mesh_nx = ceil(target.data_.width()/double(mesh_size)+1); - unsigned mesh_ny = ceil(target.data_.height()/double(mesh_size)+1); - double source_dx = source.data_.width()/double(mesh_nx-1); - double source_dy = source.data_.height()/double(mesh_ny-1); + unsigned mesh_nx = ceil(source.data_.width()/double(mesh_size)+1); + unsigned mesh_ny = ceil(source.data_.height()/double(mesh_size)+1); ImageData xs(mesh_nx, mesh_ny); ImageData ys(mesh_nx, mesh_ny); @@ -85,33 +83,11 @@ static inline void resample_raster(raster &target, raster const& source, for (i=0; i win(xs(i,j), ys(i,j), xs(i+1,j+1), ys(i+1,j+1)); - win = ts.forward(win); - CoordTransform tw(mesh_size, mesh_size, win); - unsigned x, y; - for (y=0; y=0 && x2=0 && y2 win(xs(i,j), ys(i,j), xs(i+1,j+1), ys(i+1,j+1)); - win = ts.forward(win); + win = tt.forward(win); double polygon[8] = {win.minx(), win.miny(), win.maxx(), win.miny(), win.maxx(), win.maxy(), @@ -159,10 +135,10 @@ static inline void resample_raster(raster &target, raster const& source, typedef agg::image_accessor_clone img_accessor_type; img_accessor_type ia(pixf_tile); - unsigned x0 = i * source_dx; - unsigned y0 = j * source_dy; - unsigned x1 = (i+1) * source_dx; - unsigned y1 = (j+1) * source_dy; + unsigned x0 = i * mesh_size; + unsigned y0 = j * mesh_size; + unsigned x1 = (i+1) * mesh_size; + unsigned y1 = (j+1) * mesh_size; agg::trans_bilinear tr(polygon, x0, y0, x1, y1); @@ -182,7 +158,6 @@ static inline void resample_raster(raster &target, raster const& source, } } - */ } }