diff --git a/src/agg/process_raster_symbolizer.cpp b/src/agg/process_raster_symbolizer.cpp index 89408f049..217848b6f 100644 --- a/src/agg/process_raster_symbolizer.cpp +++ b/src/agg/process_raster_symbolizer.cpp @@ -117,8 +117,44 @@ static inline void resample_raster(raster &target, raster const& source, img_accessor_type ia(pixf_tile); agg::span_allocator sa; - agg::image_filter_bilinear filter_kernel; - agg::image_filter_lut filter(filter_kernel, false); + agg::image_filter_lut filter; + scaling_method_e scaling_method = get_scaling_method_by_name( + scaling_method_name); + switch(scaling_method) + { + case SCALING_BILINEAR: + filter.calculate(agg::image_filter_bilinear(), true); break; + case SCALING_BICUBIC: + filter.calculate(agg::image_filter_bicubic(), true); break; + case SCALING_SPLINE16: + filter.calculate(agg::image_filter_spline16(), true); break; + case SCALING_SPLINE36: + filter.calculate(agg::image_filter_spline36(), true); break; + case SCALING_HANNING: + filter.calculate(agg::image_filter_hanning(), true); break; + case SCALING_HAMMING: + filter.calculate(agg::image_filter_hamming(), true); break; + case SCALING_HERMITE: + filter.calculate(agg::image_filter_hermite(), true); break; + case SCALING_KAISER: + filter.calculate(agg::image_filter_kaiser(), true); break; + case SCALING_QUADRIC: + filter.calculate(agg::image_filter_quadric(), true); break; + case SCALING_CATROM: + filter.calculate(agg::image_filter_catrom(), true); break; + case SCALING_GAUSSIAN: + filter.calculate(agg::image_filter_gaussian(), true); break; + case SCALING_BESSEL: + filter.calculate(agg::image_filter_bessel(), true); break; + case SCALING_MITCHELL: + filter.calculate(agg::image_filter_mitchell(), true); break; + case SCALING_SINC: + filter.calculate(agg::image_filter_sinc(filter_factor), true); break; + case SCALING_LANCZOS: + filter.calculate(agg::image_filter_lanczos(filter_factor), true); break; + case SCALING_BLACKMAN: + filter.calculate(agg::image_filter_blackman(filter_factor), true); break; + } for(j=0; j + typedef agg::span_interpolator_linear interpolator_type; interpolator_type interpolator(tr); - typedef agg::span_image_filter_rgba_2x2 span_gen_type; + if (scaling_method == SCALING_NEAR) { + typedef agg::span_image_filter_rgba_nn + + span_gen_type; + span_gen_type sg(ia, interpolator); + agg::render_scanlines_aa(rasterizer, scanline, rb_pre, + sa, sg); + } else { + typedef agg::span_image_filter_rgba_2x2 + + span_gen_type; - span_gen_type sg(ia, interpolator, filter); - agg::render_scanlines_aa(rasterizer, scanline, rb_pre, - sa, sg); + span_gen_type sg(ia, interpolator, filter); + agg::render_scanlines_aa(rasterizer, scanline, rb_pre, + sa, sg); + } } }