Skip to content
Permalink
Browse files

Keep image aspect in bilinear resampling, apply oversampling for zoom…

… out
  • Loading branch information
mhugent committed Jan 14, 2012
1 parent 662ec12 commit 2883fbc5ba1d5774f379aa2992abcf8033ce57c8
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/raster/qgsbilinearrasterresampler.cpp
  2. +1 −1 src/core/raster/qgsrasterrenderer.cpp
@@ -29,5 +29,5 @@ QgsBilinearRasterResampler::~QgsBilinearRasterResampler()

void QgsBilinearRasterResampler::resample( const QImage& srcImage, QImage& dstImage )
{
dstImage = srcImage.scaled( dstImage.width(), dstImage.height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
dstImage = srcImage.scaled( dstImage.width(), dstImage.height(), Qt::KeepAspectRatio, Qt::SmoothTransformation );
}
@@ -59,7 +59,7 @@ void QgsRasterRenderer::startRasterRead( int bandNumber, QgsRasterViewPort* view
providerExtent = t.transformBoundingBox( providerExtent );
}
double pixelRatio = mapToPixel->mapUnitsPerPixel() / ( providerExtent.width() / mProvider->xSize() );
oversampling = pixelRatio > 1.0 ? 1.0 : pixelRatio;
oversampling = ( pixelRatio > 4.0 ) ? 4.0 : pixelRatio;
}

//split raster into small portions if necessary

0 comments on commit 2883fbc

Please sign in to comment.
You can’t perform that action at this time.