Navigation Menu

Skip to content

Commit

Permalink
Keep image aspect in bilinear resampling, apply oversampling for zoom…
Browse files Browse the repository at this point in the history
… out
  • Loading branch information
mhugent committed Jan 14, 2012
1 parent 662ec12 commit 2883fbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/raster/qgsbilinearrasterresampler.cpp
Expand Up @@ -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 );
}
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterrenderer.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 2883fbc

Please sign in to comment.