From 6b8847f6e417d9dfc77b2078239034dbd74f841d Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 9 Apr 2015 01:15:21 +0100 Subject: [PATCH] fix quality for less than 3 components formats --- app/QualityMeasurementSidebar.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/QualityMeasurementSidebar.cpp b/app/QualityMeasurementSidebar.cpp index 0d86888..04d6770 100644 --- a/app/QualityMeasurementSidebar.cpp +++ b/app/QualityMeasurementSidebar.cpp @@ -187,7 +187,7 @@ Void QualityMeasurementSidebar::updateCurrentWindow( VideoSubWindow *subWindow ) Void QualityMeasurementSidebar::updateSidebarData() { - QString value( "0.0000" ); + QString zeroValue( "0.0000" ); if( m_pcCurrentVideoSubWindow ) { VideoSubWindow* refSubWindow = m_pcCurrentVideoSubWindow->getRefSubWindow(); @@ -196,12 +196,18 @@ Void QualityMeasurementSidebar::updateSidebarData() PlaYUVerFrame* currFrame = m_pcCurrentVideoSubWindow->getCurrFrame(); PlaYUVerFrame* refFrame = refSubWindow->getCurrFrame(); Double quality; - - for( Int component = 0; component < 3; component++ ) + QString value; + UInt component = 0; + for( ; component < currFrame->getNumberChannels(); component++ ) { quality = currFrame->getQuality( m_comboBoxMetric->currentIndex(), refFrame, component ); m_ppcLabelQualityValue[component]->setText( value.setNum( quality, 'f', 4 ) ); } + for( ; component < 3; component++ ) + { + quality = currFrame->getQuality( m_comboBoxMetric->currentIndex(), refFrame, component ); + m_ppcLabelQualityValue[component]->setText( zeroValue ); + } return; } else @@ -211,7 +217,7 @@ Void QualityMeasurementSidebar::updateSidebarData() } for( Int component = 0; component < 3; component++ ) { - m_ppcLabelQualityValue[component]->setText( value ); + m_ppcLabelQualityValue[component]->setText( zeroValue ); } }