raster scaling: a bit of optimization

This commit is contained in:
Jiri Drbalek 2016-03-04 15:14:01 +00:00 committed by artemp
parent 93a34cc68d
commit 9b72dd868f

View file

@ -79,16 +79,19 @@ public:
{ {
base_type::interpolator().coordinates(&x, &y); base_type::interpolator().coordinates(&x, &y);
int src_x = x >> agg::image_subpixel_shift; if (nodata_value_)
int src_y = y >> agg::image_subpixel_shift;
const value_type* pix = reinterpret_cast<const value_type*>(base_type::source().span(src_x, src_y, 1));
if (nodata_value_ && *nodata_value_ == *pix)
{ {
span->v = *nodata_value_; int src_x = x >> agg::image_subpixel_shift;
span->a = base_mask; int src_y = y >> agg::image_subpixel_shift;
++span; const value_type* pix = reinterpret_cast<const value_type*>(base_type::source().span(src_x, src_y, 1));
++base_type::interpolator(); if (*nodata_value_ == *pix)
continue; {
span->v = *nodata_value_;
span->a = base_mask;
++span;
++base_type::interpolator();
continue;
}
} }
x += base_type::filter_dx_int() - radius_x; x += base_type::filter_dx_int() - radius_x;