"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core/raster/qgsrasterinterface.cpp" between
QGIS-final-3_10_5.tar.gz and QGIS-final-3_10_6.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Long-term release (3.10.x series).

qgsrasterinterface.cpp  (QGIS-final-3_10_5):qgsrasterinterface.cpp  (QGIS-final-3_10_6)
skipping to change at line 350 skipping to change at line 350
if ( myBinCount == 0 ) if ( myBinCount == 0 )
{ {
// TODO: this was OK when stats/histogram were calced in provider, // TODO: this was OK when stats/histogram were calced in provider,
// but what TODO in other interfaces? Check for mInput for now. // but what TODO in other interfaces? Check for mInput for now.
if ( !mInput && mySrcDataType == Qgis::Byte ) if ( !mInput && mySrcDataType == Qgis::Byte )
{ {
myBinCount = 256; // Cannot store more values in byte myBinCount = 256; // Cannot store more values in byte
} }
else else
{ {
// There is no best default value, to display something reasonable in hist // There is no best default value, to display something reasonable in hist
ogram chart, binCount should be small, OTOH, to get precise data for cumulative ogram chart,
cut, the number should be big. Because it is easier to define fixed lower value // binCount should be small, OTOH, to get precise data for cumulative cut,
for the chart, we calc optimum binCount for higher resolution (to avoid calculat the number should be big.
ing that where histogram() is used. In any any case, it does not make sense to u // Because it is easier to define fixed lower value for the chart, we calc
se more than width*height; optimum binCount
myBinCount = histogram.width * histogram.height; // for higher resolution (to avoid calculating that where histogram() is u
if ( myBinCount > 1000 ) myBinCount = 1000; sed. In any any case,
// it does not make sense to use more than width*height;
// for Int16/Int32 make sure bin count <= actual range, because there is n o sense in having // for Int16/Int32 make sure bin count <= actual range, because there is n o sense in having
// bins at fractional values // bins at fractional values
if ( !mInput && ( if ( !mInput && (
mySrcDataType == Qgis::Int16 || mySrcDataType == Qgis::Int32 || mySrcDataType == Qgis::Int16 || mySrcDataType == Qgis::Int32 ||
mySrcDataType == Qgis::UInt16 || mySrcDataType == Qgis::UInt32 ) ) mySrcDataType == Qgis::UInt16 || mySrcDataType == Qgis::UInt32 ) )
{ {
if ( myBinCount > histogram.maximum - histogram.minimum + 1 ) myBinCount = std::min( histogram.width * histogram.height, static_cast<i
myBinCount = int( std::ceil( histogram.maximum - histogram.minimum + 1 nt>( std::ceil( histogram.maximum - histogram.minimum + 1 ) ) );
) ); }
else
{
// This is for not integer types:
myBinCount = std::min( 2000, histogram.width * histogram.height );
} }
} }
} }
histogram.binCount = myBinCount; histogram.binCount = myBinCount;
QgsDebugMsgLevel( QStringLiteral( "theHistogram.binCount = %1" ).arg( histogra m.binCount ), 4 ); QgsDebugMsgLevel( QStringLiteral( "theHistogram.binCount = %1" ).arg( histogra m.binCount ), 4 );
} }
bool QgsRasterInterface::hasHistogram( int bandNo, bool QgsRasterInterface::hasHistogram( int bandNo,
int binCount, int binCount,
double minimum, double maximum, double minimum, double maximum,
 End of changes. 2 change blocks. 
11 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)