Skip to content
Permalink
Browse files

draw histogram boxes for Int16/Int32 also

  • Loading branch information
etiennesky committed Feb 3, 2014
1 parent 2a2f4ce commit 5f91848e2867b3e43c5316f50a3f9150b0f4fc28
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/gui/raster/qgsrasterhistogramwidget.cpp
@@ -493,7 +493,8 @@ void QgsRasterHistogramWidget::refreshHistogram()
#endif

// calculate first bin x value and bin step size if not Byte data
if ( mRasterLayer->dataProvider()->srcDataType( myIteratorInt ) != QGis::Byte )
QGis::DataType mySrcDataType = mRasterLayer->dataProvider()->srcDataType( myIteratorInt );
if ( mySrcDataType != QGis::Byte )
{
myBinXStep = ( myHistogram.maximum - myHistogram.minimum ) / myHistogram.binCount;
myBinX = myHistogram.minimum + myBinXStep / 2.0;
@@ -502,12 +503,16 @@ void QgsRasterHistogramWidget::refreshHistogram()
{
myBinXStep = 1;
myBinX = 0;
}
#if defined(QWT_VERSION) && QWT_VERSION>=0x060000
// TODO add support for Int16/Int32 types - this requires fixing the sampleSize and/or min/max
if ( ! mHistoDrawLines )
myDrawLines = false;
#endif
if ( ! mHistoDrawLines &&
( mySrcDataType == QGis::Byte ||
mySrcDataType == QGis::Int16 || mySrcDataType == QGis::Int32 ||
mySrcDataType == QGis::UInt16 || mySrcDataType == QGis::UInt32 ) )
{
myDrawLines = false;
}
#endif

for ( int myBin = 0; myBin < myHistogram.binCount; myBin++ )
{

0 comments on commit 5f91848

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