Skip to content

Commit

Permalink
Oops, fix 16 bit color ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored and nirvn committed Dec 4, 2020
1 parent e9fd1ac commit 8fc10df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/pointcloud/qgspointcloudrendererregistry.cpp
Expand Up @@ -109,7 +109,7 @@ QgsPointCloudRenderer *QgsPointCloudRendererRegistry::defaultRenderer( const Qgs
const int maxValue = std::max( blueMax.toInt(), std::max( redMax.toInt(), greenMax.toInt() ) );
// try and guess suitable range from input max values -- we don't just take the provider max value directly here, but rather see if it's
// likely to be 8 bit or 16 bit color values
const int rangeGuess = maxValue > 255 ? 65024 : 255;
const int rangeGuess = maxValue > 255 ? 65535 : 255;

if ( rangeGuess > 255 )
{
Expand Down
6 changes: 3 additions & 3 deletions src/gui/pointcloud/qgspointcloudrgbrendererwidget.cpp
Expand Up @@ -221,7 +221,7 @@ void QgsPointCloudRgbRendererWidget::redAttributeChanged()

// try and guess suitable range from input max values -- we don't just take the provider max value directly here, but rather see if it's
// likely to be 8 bit or 16 bit color values
mRedMaxLineEdit->setText( QLocale().toString( maxValue > 255 ? 65024 : 255 ) );
mRedMaxLineEdit->setText( QLocale().toString( maxValue > 255 ? 65535 : 255 ) );
mDisableMinMaxWidgetRefresh--;
emitWidgetChanged();
}
Expand All @@ -241,7 +241,7 @@ void QgsPointCloudRgbRendererWidget::greenAttributeChanged()

// try and guess suitable range from input max values -- we don't just take the provider max value directly here, but rather see if it's
// likely to be 8 bit or 16 bit color values
mGreenMaxLineEdit->setText( QLocale().toString( maxValue > 255 ? 65024 : 255 ) );
mGreenMaxLineEdit->setText( QLocale().toString( maxValue > 255 ? 65535 : 255 ) );
mDisableMinMaxWidgetRefresh--;
emitWidgetChanged();
}
Expand All @@ -261,7 +261,7 @@ void QgsPointCloudRgbRendererWidget::blueAttributeChanged()

// try and guess suitable range from input max values -- we don't just take the provider max value directly here, but rather see if it's
// likely to be 8 bit or 16 bit color values
mBlueMaxLineEdit->setText( QLocale().toString( maxValue > 255 ? 65024 : 255 ) );
mBlueMaxLineEdit->setText( QLocale().toString( maxValue > 255 ? 65535 : 255 ) );
mDisableMinMaxWidgetRefresh--;
emitWidgetChanged();
}
Expand Down

0 comments on commit 8fc10df

Please sign in to comment.