mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-22 00:06:12 -05:00
Revert "Speed up QgsCameraController::sampleDepthBuffer() averaging"
This reverts commit 1c2a0d56283910aa77959b405e3a0cfb3d6e1ef9.
This commit is contained in:
parent
a1daed2917
commit
c1bea4fb30
@ -266,14 +266,11 @@ double QgsCameraController::sampleDepthBuffer( int px, int py )
|
||||
// Returns the average of depth values that are not 1 (void area)
|
||||
depth = 0;
|
||||
int samplesCount = 0;
|
||||
// Make sure we can do the cast
|
||||
Q_ASSERT( mDepthBufferImage.format() == QImage::Format_RGB32 );
|
||||
for ( int y = 0; y < mDepthBufferImage.height(); ++y )
|
||||
{
|
||||
const QRgb *line = reinterpret_cast<const QRgb *>( mDepthBufferImage.constScanLine( y ) );
|
||||
for ( int x = 0; x < mDepthBufferImage.width(); ++x )
|
||||
{
|
||||
double d = Qgs3DUtils::decodeDepth( line[x] );
|
||||
for ( int y = 0; y < mDepthBufferImage.height(); ++y )
|
||||
{
|
||||
double d = Qgs3DUtils::decodeDepth( mDepthBufferImage.pixel( x, y ) );
|
||||
if ( d < 1 )
|
||||
{
|
||||
depth += d;
|
||||
|
Loading…
x
Reference in New Issue
Block a user