From 738582392d8c14242d023c339a00c6d61b26736b Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 12 Mar 2015 21:48:32 +0000 Subject: [PATCH 01/13] First approach to plot quality --- app/PlotSubWindow.cpp | 100 ++++++++++++++++++++++++++---------------- app/PlotSubWindow.h | 10 ++++- app/QualityHandle.cpp | 80 +++++++++++++++++++++++++++++++-- app/QualityHandle.h | 2 + 4 files changed, 147 insertions(+), 45 deletions(-) diff --git a/app/PlotSubWindow.cpp b/app/PlotSubWindow.cpp index 35b019b..9605711 100644 --- a/app/PlotSubWindow.cpp +++ b/app/PlotSubWindow.cpp @@ -27,6 +27,15 @@ namespace plaYUVer { +Void PlotSubWindow::definePlotColors() +{ + m_arrayColorList.append( Qt::blue ); + m_arrayColorList.append( Qt::red ); + m_arrayColorList.append( Qt::green ); + m_arrayColorList.append( Qt::black ); + m_arrayColorList.append( Qt::cyan ); +} + PlotSubWindow::PlotSubWindow( QWidget * parent ) : SubWindowHandle( parent, SubWindowHandle::PLOT_SUBWINDOW ) { @@ -39,26 +48,6 @@ PlotSubWindow::PlotSubWindow( QWidget * parent ) : m_cPlotArea = new QCustomPlot( this ); setWidget( m_cPlotArea ); - Example(); - -} - -Void PlotSubWindow::Example() -{ - // add two new graphs and set their look: - m_cPlotArea->addGraph(); - m_cPlotArea->graph( 0 )->setPen( QPen( Qt::blue ) ); // line color blue for first graph - m_cPlotArea->graph( 0 )->setBrush( QBrush( QColor( 0, 0, 255, 20 ) ) ); // first graph will be filled with translucent blue - m_cPlotArea->addGraph(); - m_cPlotArea->graph( 1 )->setPen( QPen( Qt::red ) ); // line color red for second graph - // generate some points of data (y0 for first, y1 for second graph): - QVector x( 250 ), y0( 250 ), y1( 250 ); - for( int i = 0; i < 250; ++i ) - { - x[i] = i; - y0[i] = exp( -i / 150.0 ) * cos( i / 10.0 ); // exponentially decaying cosine - y1[i] = exp( -i / 150.0 ); // exponential envelope - } // configure right and top axis to show ticks but no labels: // (see QCPAxisRect::setupFullAxesBox for a quicker method to do this) m_cPlotArea->xAxis2->setVisible( true ); @@ -68,19 +57,30 @@ Void PlotSubWindow::Example() // make left and bottom axes always transfer their ranges to right and top axes: connect( m_cPlotArea->xAxis, SIGNAL( rangeChanged(QCPRange) ), m_cPlotArea->xAxis2, SLOT( setRange(QCPRange) ) ); connect( m_cPlotArea->yAxis, SIGNAL( rangeChanged(QCPRange) ), m_cPlotArea->yAxis2, SLOT( setRange(QCPRange) ) ); - // pass data points to graphs: - m_cPlotArea->graph( 0 )->setData( x, y0 ); - m_cPlotArea->graph( 1 )->setData( x, y1 ); - // let the ranges scale themselves so graph 0 fits perfectly in the visible area: - m_cPlotArea->graph( 0 )->rescaleAxes(); - // same thing for graph 1, but only enlarge ranges (in case graph 1 is smaller than graph 0): - m_cPlotArea->graph( 1 )->rescaleAxes( true ); - // Note: we could have also just called m_cPlotArea->rescaleAxes(); instead - // Allow user to drag axis ranges with mouse, zoom with mouse wheel and select graphs by clicking: + + definePlotColors(); + m_uiNumberPlots = 0; + m_cPlotArea->setInteractions( QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables ); } +Void PlotSubWindow::Example() +{ + // generate some points of data (y0 for first, y1 for second graph): + QVector x( 250 ), y0( 250 ), y1( 250 ); + for( int i = 0; i < 250; ++i ) + { + x[i] = i; + y0[i] = exp( -i / 150.0 ) * cos( i / 10.0 ); // exponentially decaying cosine + y1[i] = exp( -i / 150.0 ); // exponential envelope + } + + addPlot( x, y0 ); + addPlot( x, y1 ); + +} + PlotSubWindow::~PlotSubWindow() { delete m_cPlotArea; @@ -106,15 +106,37 @@ Void PlotSubWindow::scaleView( Double scale, QPoint center ) } -//QSize PlotSubWindow::sizeHint() const -//{ -// -//} -// -// -//QSize PlotSubWindow::sizeHint( const QSize & maxSize ) const -//{ -// -//} +QSize PlotSubWindow::sizeHint() const +{ + QSize maxSize; + QWidget *p = parentWidget(); + if( p ) + { + maxSize = p->size(); + } + else + { + maxSize = QApplication::desktop()->availableGeometry().size(); + } + return sizeHint( maxSize ); +} + +QSize PlotSubWindow::sizeHint( const QSize & maxSize ) const +{ + return maxSize; +} + +Void PlotSubWindow::addPlot( const QVector &key, const QVector &value ) +{ + QCPGraph *newPlot = m_cPlotArea->addGraph(); + newPlot->setPen( QPen( m_arrayColorList.at( m_uiNumberPlots ) ) ); // line color blue for first graph + newPlot->setBrush( QBrush( QColor( 0, 0, 255, 20 ) ) ); // first graph will be filled with translucent blue + // pass data points to graphs: + newPlot->setData( key, value ); + // let the ranges scale themselves so graph 0 fits perfectly in the visible area: + newPlot->rescaleAxes( m_uiNumberPlots > 1 ? true : false ); + + m_uiNumberPlots++; +} } // NAMESPACE diff --git a/app/PlotSubWindow.h b/app/PlotSubWindow.h index 9dfb063..c8da96c 100644 --- a/app/PlotSubWindow.h +++ b/app/PlotSubWindow.h @@ -44,6 +44,8 @@ Q_OBJECT private: QCustomPlot* m_cPlotArea; + QVector m_arrayColorList; + UInt m_uiNumberPlots; Void Example(); @@ -51,6 +53,8 @@ public: PlotSubWindow( QWidget * parent = 0 ); ~PlotSubWindow(); + Void definePlotColors(); + Void setTool( UInt uiTool ) { } @@ -71,8 +75,10 @@ public: /** * Size related functions */ -// QSize sizeHint() const; -// QSize sizeHint( const QSize & ) const; + QSize sizeHint() const; + QSize sizeHint( const QSize & ) const; + + Void addPlot(const QVector &key, const QVector &value); }; } // NAMESPACE diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index 0230970..646c80d 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -28,6 +28,7 @@ #include "VideoSubWindow.h" #include "PlotSubWindow.h" #include "DialogSubWindowSelector.h" +#include "lib/LibMemory.h" namespace plaYUVer { @@ -75,7 +76,7 @@ QMenu* QualityHandle::createMenu() m_pcSubMenuQualityMetrics->addActions( m_actionGroupQualityMetric->actions() ); m_pcMenuQuality->addAction( m_arrayActions[SELECT_REF_ACT] ); m_pcMenuQuality->addSeparator(); - //m_pcMenuQuality->addAction( m_arrayActions[PLOT_QUALITY] ); + m_pcMenuQuality->addAction( m_arrayActions[PLOT_QUALITY] ); return m_pcMenuQuality; } @@ -127,6 +128,62 @@ Void QualityHandle::update( VideoSubWindow* currSubWindow ) m_pcQualityHandleSideBar->updateCurrentWindow( currSubWindow ); } +QVector* QualityHandle::measureQuality( QVector apcWindowList ) +{ + QVector* padQualityValues; + UInt numberOfWindows = apcWindowList.size(); + UInt64 currFrames = 0; + UInt64 numberOfFrames = INT_MAX; + + QApplication::setOverrideCursor( Qt::WaitCursor ); + + //! Check reference window + for( UInt i = 0; i < numberOfWindows; i++ ) + { + if( !apcWindowList.at( i )->getRefSubWindow() ) + { + return NULL; + } + } + VideoSubWindow* pcReferenceWindow = apcWindowList.at( 0 )->getRefSubWindow(); + + for( UInt i = 0; i < numberOfWindows; i++ ) + { + currFrames = apcWindowList.at( i )->getInputStream()->getFrameNum(); + if( currFrames < numberOfFrames ) + numberOfFrames = currFrames; + apcWindowList.at( i )->stop(); + } + pcReferenceWindow->stop(); + + padQualityValues = new QVector [numberOfWindows + 1]; + + PlaYUVerFrame* pcReferenceFrame; + PlaYUVerFrame* pcCurrFrame; + for( UInt f = 1; f < numberOfFrames; f++ ) + { + padQualityValues[0].append( f ); + pcReferenceFrame = pcReferenceWindow->getCurrFrame(); + for( UInt i = 0; i < numberOfWindows; i++ ) + { + pcCurrFrame = apcWindowList.at( 0 )->getCurrFrame(); + padQualityValues[i + 1].append( pcCurrFrame->getQuality( 0, pcReferenceFrame, LUMA ) ); + apcWindowList.at( 0 )->play(); + apcWindowList.at( 0 )->playEvent(); + } + pcReferenceWindow->play(); + pcReferenceWindow->playEvent(); + } + for( UInt i = 0; i < numberOfWindows; i++ ) + { + apcWindowList.at( 0 )->stop(); + } + pcReferenceWindow->stop(); + QApplication::restoreOverrideCursor(); + + return padQualityValues; +} + Void QualityHandle::slotQualityMetricChanged( Int idx ) { m_actionGroupQualityMetric->actions().at( idx )->setChecked( true ); @@ -165,9 +222,24 @@ Void QualityHandle::slotSelectReference() Void QualityHandle::slotCreatePlot() { - PlotSubWindow* pcPlotWindow = new PlotSubWindow( m_pcParet ); - m_pcMainWindowManager->addSubWindow( pcPlotWindow ); - pcPlotWindow->show(); + VideoSubWindow* pcSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); + if( pcSubWindow ) + { + if( pcSubWindow->getRefSubWindow() ) + { + QVector apcWindowList; + apcWindowList.append( pcSubWindow ); + QVector* qualityVector = measureQuality( apcWindowList ); + + PlotSubWindow* pcPlotWindow = new PlotSubWindow( m_pcParet ); + + pcPlotWindow->addPlot( qualityVector[0], qualityVector[1] ); + + m_pcMainWindowManager->addSubWindow( pcPlotWindow ); + pcPlotWindow->show(); + + } + } } diff --git a/app/QualityHandle.h b/app/QualityHandle.h index faa42d5..29d683f 100644 --- a/app/QualityHandle.h +++ b/app/QualityHandle.h @@ -78,6 +78,8 @@ private: QDockWidget* m_pcQualityHandleDock; QualityMeasurementSidebar* m_pcQualityHandleSideBar; + QVector* measureQuality( QVector apcWindowList ); + Q_SIGNALS: void changed(); From bf8ac0e8c7b1535f5c65751e92ebba3b66af7625 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 01:46:57 +0000 Subject: [PATCH 02/13] Add seekRelative function into PlaYUVerStream and minor fix in ModulesHandle --- app/ModulesHandle.cpp | 2 +- app/VideoSubWindow.cpp | 2 +- lib/PlaYUVerStream.cpp | 19 +++++++++++++++++++ lib/PlaYUVerStream.h | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index 86dbf2b..4e19ce7 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -282,7 +282,7 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf ) } else { - windowName.append( pcVideoSubWindow->windowTitle() ); + windowName.append( pcVideoSubWindow->getWindowName() ); videoSubWindowList.append( pcVideoSubWindow ); } diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 5c0f72d..3e27fa2 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -518,7 +518,7 @@ Void VideoSubWindow::seekRelativeEvent( Bool bIsFoward ) { if( m_pCurrStream ) { - if( m_pCurrStream->seekInput( m_pCurrStream->getCurrFrameNum() + ( bIsFoward ? 1 : -1 ) ) ) + if( m_pCurrStream->seekInputRelative( bIsFoward ) ) { refreshFrame(); } diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index b30012b..eb212e6 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -692,6 +692,25 @@ PlaYUVerFrame* PlaYUVerStream::getNextFrame() return m_pcNextFrame; } +Bool PlaYUVerStream::seekInputRelative( Bool bIsFoward ) +{ + if( !m_bInit || !m_bIsInput ) + return false; + + Bool bRet = false; + if( bIsFoward ) + { + readFrame(); + bRet = !setNextFrame(); + } + else + { + UInt64 newFrameNum = m_iCurrFrameNum - 1; + bRet = seekInput( newFrameNum ); + } + return bRet; +} + Bool PlaYUVerStream::seekInput( UInt64 new_frame_num ) { if( !m_bInit || new_frame_num < 0 || new_frame_num >= m_uiTotalFrameNum || ( Int64 )new_frame_num == m_iCurrFrameNum ) diff --git a/lib/PlaYUVerStream.h b/lib/PlaYUVerStream.h index 57906fc..a9429ab 100644 --- a/lib/PlaYUVerStream.h +++ b/lib/PlaYUVerStream.h @@ -77,7 +77,6 @@ private: std::string m_cCodedName; std::string m_cPelFmtName; - FILE* m_pFile; /**< The input file pointer >*/ std::fstream m_fsIOStream; /**< The input file pointer >*/ @@ -146,6 +145,7 @@ public: PlaYUVerFrame* getCurrFrame( PlaYUVerFrame * ); PlaYUVerFrame* getNextFrame(); + Bool seekInputRelative( Bool bIsFoward ); Bool seekInput( UInt64 new_frame_num ); Bool isInit() From 7f6e4dc14f3f26cdf74558c439baa9550df7570d Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 03:44:51 +0000 Subject: [PATCH 03/13] Improvements in PlaYUVerStream and QualityMeasurements --- app/QualityMeasurementSidebar.cpp | 4 ++++ app/SubWindowHandle.cpp | 3 --- app/VideoSubWindow.cpp | 3 +++ lib/PlaYUVerStream.cpp | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/QualityMeasurementSidebar.cpp b/app/QualityMeasurementSidebar.cpp index 3b2cf01..e140dd4 100644 --- a/app/QualityMeasurementSidebar.cpp +++ b/app/QualityMeasurementSidebar.cpp @@ -138,6 +138,10 @@ Void QualityMeasurementSidebar::updateSubWindowList() for( Int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); + if( m_pcCurrentVideoSubWindow == pcVideoSubWindow ) + { + continue; + } if( m_pcCurrentVideoSubWindow ) { if( !m_pcCurrentVideoSubWindow->getCurrFrame()->haveSameFmt( pcVideoSubWindow->getCurrFrame() ) ) diff --git a/app/SubWindowHandle.cpp b/app/SubWindowHandle.cpp index 0a304fb..7830ba9 100644 --- a/app/SubWindowHandle.cpp +++ b/app/SubWindowHandle.cpp @@ -42,9 +42,6 @@ SubWindowHandle::SubWindowHandle( QWidget * parent, UInt category ) : connect( horizontalScrollBar(), SIGNAL( actionTriggered( int ) ), this, SLOT( updateCurScrollValues() ) ); connect( verticalScrollBar(), SIGNAL( actionTriggered( int ) ), this, SLOT( updateCurScrollValues() ) ); - setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - setWidgetResizable( true ); m_uiCategory = category; diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 3e27fa2..f3c049b 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -97,6 +97,9 @@ VideoSubWindow::VideoSubWindow( enum VideoSubWindowCategories category, QWidget connect( m_cViewArea, SIGNAL( selectionChanged( QRect ) ), this, SLOT( updateSelectedArea( QRect ) ) ); connect( m_cViewArea, SIGNAL( positionChanged( const QPoint & ) ), this, SLOT( updatePixelValueStatusBar( const QPoint & ) ) ); + setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + // Define the cViewArea as the widget inside the scroll area m_cViewArea->setMinimumSize( size() ); setWidget( m_cViewArea ); diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index eb212e6..48fafec 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -700,8 +700,8 @@ Bool PlaYUVerStream::seekInputRelative( Bool bIsFoward ) Bool bRet = false; if( bIsFoward ) { - readFrame(); bRet = !setNextFrame(); + readFrame(); } else { From f8061bd4d18239ca8c02cfb4324989d1b6c3f074 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 03:45:13 +0000 Subject: [PATCH 04/13] Support for ploting single and multiple plots --- app/PlotSubWindow.cpp | 116 ++++++++++++++++++++++++++++++++---------- app/PlotSubWindow.h | 30 ++++++++--- app/QualityHandle.cpp | 116 +++++++++++++++++++++++++++++++++--------- app/QualityHandle.h | 9 +++- 4 files changed, 213 insertions(+), 58 deletions(-) diff --git a/app/PlotSubWindow.cpp b/app/PlotSubWindow.cpp index 9605711..1a5d7dd 100644 --- a/app/PlotSubWindow.cpp +++ b/app/PlotSubWindow.cpp @@ -23,6 +23,7 @@ */ #include "PlotSubWindow.h" +#include "qcustomplot.h" namespace plaYUVer { @@ -36,7 +37,7 @@ Void PlotSubWindow::definePlotColors() m_arrayColorList.append( Qt::cyan ); } -PlotSubWindow::PlotSubWindow( QWidget * parent ) : +PlotSubWindow::PlotSubWindow( QWidget * parent, const QString& windowTitle ) : SubWindowHandle( parent, SubWindowHandle::PLOT_SUBWINDOW ) { setParent( parent ); @@ -45,7 +46,19 @@ PlotSubWindow::PlotSubWindow( QWidget * parent ) : setBackgroundRole( QPalette::Light ); setVisible( false ); + definePlotColors(); + m_uiNumberPlots = 0; + m_dScaleFactor = 1; + + setWindowName( windowTitle ); + m_cPlotArea = new QCustomPlot( this ); + + QSizePolicy sizePolicy( QSizePolicy::Preferred, QSizePolicy::MinimumExpanding ); + sizePolicy.setHorizontalStretch( 0 ); + sizePolicy.setVerticalStretch( 0 ); + sizePolicy.setHeightForWidth( m_cPlotArea->sizePolicy().hasHeightForWidth() ); + m_cPlotArea->setSizePolicy( sizePolicy ); setWidget( m_cPlotArea ); // configure right and top axis to show ticks but no labels: @@ -58,26 +71,16 @@ PlotSubWindow::PlotSubWindow( QWidget * parent ) : connect( m_cPlotArea->xAxis, SIGNAL( rangeChanged(QCPRange) ), m_cPlotArea->xAxis2, SLOT( setRange(QCPRange) ) ); connect( m_cPlotArea->yAxis, SIGNAL( rangeChanged(QCPRange) ), m_cPlotArea->yAxis2, SLOT( setRange(QCPRange) ) ); - definePlotColors(); - m_uiNumberPlots = 0; + QFont legendFont = font(); // start out with MainWindow's font.. + legendFont.setPointSize( 9 ); // and make a bit smaller for legend + m_cPlotArea->legend->setFont( legendFont ); + m_cPlotArea->legend->setVisible( false ); - m_cPlotArea->setInteractions( QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables ); + m_cPlotArea->setInteractions( QCP::iRangeZoom | QCP::iRangeDrag ); //QCP::iSelectPlottables -} - -Void PlotSubWindow::Example() -{ - // generate some points of data (y0 for first, y1 for second graph): - QVector x( 250 ), y0( 250 ), y1( 250 ); - for( int i = 0; i < 250; ++i ) - { - x[i] = i; - y0[i] = exp( -i / 150.0 ) * cos( i / 10.0 ); // exponentially decaying cosine - y1[i] = exp( -i / 150.0 ); // exponential envelope - } - - addPlot( x, y0 ); - addPlot( x, y1 ); + m_cPlotPen.setStyle( Qt::SolidLine ); + m_cPlotPen.setColor( Qt::black ); + m_cPlotPen.setWidthF( 2 ); } @@ -88,12 +91,15 @@ PlotSubWindow::~PlotSubWindow() Void PlotSubWindow::normalSize() { - + m_cPlotArea->xAxis->setRange( m_aAxisRange[HORIZONTAL][0], m_aAxisRange[HORIZONTAL][1] ); + m_cPlotArea->yAxis->setRange( m_aAxisRange[VERTICAL][0], m_aAxisRange[VERTICAL][1] ); + m_cPlotArea->replot(); + m_dScaleFactor = 1; } Void PlotSubWindow::zoomToFit() { - + normalSize(); } Void PlotSubWindow::zoomToFactor( Double factor, QPoint center ) @@ -103,7 +109,23 @@ Void PlotSubWindow::zoomToFactor( Double factor, QPoint center ) Void PlotSubWindow::scaleView( Double scale, QPoint center ) { + scale -= 1; + scale /= 10; + scale += 1; + m_dScaleFactor *= scale; +// +// UInt aNewAxisRange[2][2]; +// for( UInt axis = 0; axis < 2; axis++ ) +// for( UInt dim = 0; dim < 2; dim++ ) +// aNewAxisRange[axis][dim] = m_aAxisRange[axis][dim] / m_dScaleFactor; +// +// m_cPlotArea->xAxis->setRange( aNewAxisRange[HORIZONTAL][0], aNewAxisRange[HORIZONTAL][1] ); +// m_cPlotArea->yAxis->setRange( aNewAxisRange[VERTICAL][0], aNewAxisRange[VERTICAL][1] ); + + m_cPlotArea->xAxis->scaleRange( scale, 0 ); + m_cPlotArea->yAxis->scaleRange( scale, 0 ); + m_cPlotArea->replot(); } QSize PlotSubWindow::sizeHint() const @@ -123,19 +145,61 @@ QSize PlotSubWindow::sizeHint() const QSize PlotSubWindow::sizeHint( const QSize & maxSize ) const { - return maxSize; + return maxSize * 2 / 3; } -Void PlotSubWindow::addPlot( const QVector &key, const QVector &value ) +Void PlotSubWindow::setAxisName( const QString& nameAxisX, const QString& nameAxisY ) +{ + m_cPlotArea->xAxis->setLabel( nameAxisX ); + m_cPlotArea->yAxis->setLabel( nameAxisY ); +} + +Void PlotSubWindow::setAxisRange( const QLine& axisLimits ) +{ + setAxisRange( HORIZONTAL, axisLimits.x1(), axisLimits.x2() ); + setAxisRange( VERTICAL, axisLimits.y1(), axisLimits.y2() ); +} + +Void PlotSubWindow::setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStart, const Int& axisEnd ) +{ + if( eAxis == HORIZONTAL ) + { + m_cPlotArea->xAxis->setRange( axisStart, axisEnd ); + horizontalScrollBar()->setRange( axisStart * 100, axisEnd * 100 ); + m_aAxisRange[HORIZONTAL][0] = axisStart; + m_aAxisRange[HORIZONTAL][1] = axisEnd; + } + if( eAxis == VERTICAL ) + { + m_cPlotArea->yAxis->setRange( axisStart, axisEnd ); + verticalScrollBar()->setRange( axisStart * 100, axisEnd * 100 ); + m_aAxisRange[VERTICAL][0] = axisStart; + m_aAxisRange[VERTICAL][1] = axisEnd; + } + m_cPlotArea->replot(); +} + +Void PlotSubWindow::addPlot( const QVector &arrayX, const QVector &arrayY, const QString& key ) { QCPGraph *newPlot = m_cPlotArea->addGraph(); - newPlot->setPen( QPen( m_arrayColorList.at( m_uiNumberPlots ) ) ); // line color blue for first graph - newPlot->setBrush( QBrush( QColor( 0, 0, 255, 20 ) ) ); // first graph will be filled with translucent blue + m_cPlotPen.setColor( m_arrayColorList.at( m_uiNumberPlots ) ); + newPlot->setPen( m_cPlotPen ); // line style // pass data points to graphs: - newPlot->setData( key, value ); + newPlot->setData( arrayX, arrayY ); // let the ranges scale themselves so graph 0 fits perfectly in the visible area: newPlot->rescaleAxes( m_uiNumberPlots > 1 ? true : false ); + if( !key.isEmpty() ) + { + m_cPlotArea->legend->setVisible( true ); + newPlot->setName( key ); + } + + m_aAxisRange[HORIZONTAL][0] = m_cPlotArea->xAxis->range().lower; + m_aAxisRange[HORIZONTAL][1] = m_cPlotArea->xAxis->range().upper; + m_aAxisRange[VERTICAL][0] = m_cPlotArea->yAxis->range().lower; + m_aAxisRange[VERTICAL][1] = m_cPlotArea->yAxis->range().upper; + m_uiNumberPlots++; } diff --git a/app/PlotSubWindow.h b/app/PlotSubWindow.h index c8da96c..090b50b 100644 --- a/app/PlotSubWindow.h +++ b/app/PlotSubWindow.h @@ -33,7 +33,8 @@ #include #endif #include "SubWindowHandle.h" -#include "qcustomplot.h" + +class QCustomPlot; namespace plaYUVer { @@ -44,13 +45,22 @@ Q_OBJECT private: QCustomPlot* m_cPlotArea; + QVector m_arrayColorList; + QPen m_cPlotPen; + + enum Axis + { + HORIZONTAL, + VERTICAL, + }; + Double m_aAxisRange[2][2]; + Double m_dScaleFactor; UInt m_uiNumberPlots; - Void Example(); - public: - PlotSubWindow( QWidget * parent = 0 ); + + PlotSubWindow( QWidget * parent, const QString& windowTitle ); ~PlotSubWindow(); Void definePlotColors(); @@ -69,7 +79,7 @@ public: Double getScaleFactor() { - return 0; + return m_dScaleFactor; } /** @@ -78,7 +88,15 @@ public: QSize sizeHint() const; QSize sizeHint( const QSize & ) const; - Void addPlot(const QVector &key, const QVector &value); + Void setAxisName( const QString& nameAxisX, const QString& nameAxisY ); + + Void setAxisRange( const QLine& axisLimits ); + Void setAxisRange( PlotSubWindow::Axis eAxis, const Int& axisStart, const Int& axisEnd ); + + Void setKey( const QString& key ); + + Void addPlot( const QVector &arrayX, const QVector &arrayY, const QString& key = QString() ); + }; } // NAMESPACE diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index 646c80d..6ce37e9 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -29,6 +29,9 @@ #include "PlotSubWindow.h" #include "DialogSubWindowSelector.h" #include "lib/LibMemory.h" +#if( QT_VERSION_PLAYUVER == 5 ) +#include "QtConcurrent/qtconcurrentrun.h" +#endif namespace plaYUVer { @@ -65,8 +68,11 @@ Void QualityHandle::createActions() m_arrayActions.resize( TOTAL_ACT ); m_arrayActions[SELECT_REF_ACT] = new QAction( "Select Reference", this ); connect( m_arrayActions[SELECT_REF_ACT], SIGNAL( triggered() ), this, SLOT( slotSelectReference() ) ); - m_arrayActions[PLOT_QUALITY] = new QAction( "CREATE_PLOT", this ); - connect( m_arrayActions[PLOT_QUALITY], SIGNAL( triggered() ), this, SLOT( slotCreatePlot() ) ); + + m_arrayActions[PLOT_QUALITY] = new QAction( "Plot Window's Quality", this ); + connect( m_arrayActions[PLOT_QUALITY], SIGNAL( triggered() ), this, SLOT( slotPlotQualitySingle() ) ); + m_arrayActions[PLOT_SEVERAL_QUALITY] = new QAction( "Plot Several Quality", this ); + connect( m_arrayActions[PLOT_SEVERAL_QUALITY], SIGNAL( triggered() ), this, SLOT( slotPlotQualitySeveral() ) ); } QMenu* QualityHandle::createMenu() @@ -77,6 +83,7 @@ QMenu* QualityHandle::createMenu() m_pcMenuQuality->addAction( m_arrayActions[SELECT_REF_ACT] ); m_pcMenuQuality->addSeparator(); m_pcMenuQuality->addAction( m_arrayActions[PLOT_QUALITY] ); + m_pcMenuQuality->addAction( m_arrayActions[PLOT_SEVERAL_QUALITY] ); return m_pcMenuQuality; } @@ -102,7 +109,9 @@ Void QualityHandle::updateMenus() m_pcSubMenuQualityMetrics->setEnabled( hasSubWindow ); m_arrayActions[SELECT_REF_ACT]->setEnabled( hasSubWindow ); + m_arrayActions[PLOT_QUALITY]->setEnabled( hasSubWindow ); + m_arrayActions[PLOT_SEVERAL_QUALITY]->setEnabled( hasSubWindow ); m_pcQualityHandleSideBar->updateSideBar( hasSubWindow ); } @@ -128,25 +137,24 @@ Void QualityHandle::update( VideoSubWindow* currSubWindow ) m_pcQualityHandleSideBar->updateCurrentWindow( currSubWindow ); } -QVector* QualityHandle::measureQuality( QVector apcWindowList ) +Void QualityHandle::measureQuality( QVector apcWindowList ) { QVector* padQualityValues; UInt numberOfWindows = apcWindowList.size(); UInt64 currFrames = 0; UInt64 numberOfFrames = INT_MAX; - QApplication::setOverrideCursor( Qt::WaitCursor ); - //! Check reference window for( UInt i = 0; i < numberOfWindows; i++ ) { if( !apcWindowList.at( i )->getRefSubWindow() ) { - return NULL; + return; } } VideoSubWindow* pcReferenceWindow = apcWindowList.at( 0 )->getRefSubWindow(); + numberOfFrames = pcReferenceWindow->getInputStream()->getFrameNum(); for( UInt i = 0; i < numberOfWindows; i++ ) { currFrames = apcWindowList.at( i )->getInputStream()->getFrameNum(); @@ -160,28 +168,49 @@ QVector* QualityHandle::measureQuality( QVector apcWind PlaYUVerFrame* pcReferenceFrame; PlaYUVerFrame* pcCurrFrame; - for( UInt f = 1; f < numberOfFrames; f++ ) + for( UInt f = 0; f < numberOfFrames; f++ ) { padQualityValues[0].append( f ); pcReferenceFrame = pcReferenceWindow->getCurrFrame(); for( UInt i = 0; i < numberOfWindows; i++ ) { - pcCurrFrame = apcWindowList.at( 0 )->getCurrFrame(); - padQualityValues[i + 1].append( pcCurrFrame->getQuality( 0, pcReferenceFrame, LUMA ) ); - apcWindowList.at( 0 )->play(); - apcWindowList.at( 0 )->playEvent(); + pcCurrFrame = apcWindowList.at( i )->getCurrFrame(); + padQualityValues[i + 1].append( pcCurrFrame->getQuality( m_iQualityMetricIdx, pcReferenceFrame, LUMA ) ); + apcWindowList.at( i )->seekRelativeEvent( true ); } - pcReferenceWindow->play(); - pcReferenceWindow->playEvent(); + pcReferenceWindow->seekRelativeEvent( true ); } for( UInt i = 0; i < numberOfWindows; i++ ) { - apcWindowList.at( 0 )->stop(); + apcWindowList.at( i )->stop(); } pcReferenceWindow->stop(); - QApplication::restoreOverrideCursor(); - return padQualityValues; + QString plotWindowTitle( QStringLiteral( "Quality - " ) ); + if( apcWindowList.size() == 1 ) + { + plotWindowTitle += apcWindowList.at( 0 )->getWindowName(); + } + PlotSubWindow* pcPlotWindow = new PlotSubWindow( m_pcParet, plotWindowTitle ); + pcPlotWindow->setAxisName( "Frame Number", QString::fromStdString( PlaYUVerFrame::supportedQualityMetricsList()[m_iQualityMetricIdx] ) ); + + if( apcWindowList.size() > 1 ) + { + QString key; + for( UInt i = 0; i < numberOfWindows; i++ ) + { + key = apcWindowList.at( i )->getWindowName(); + pcPlotWindow->addPlot( padQualityValues[0], padQualityValues[i + 1], key ); + } + } + else + { + pcPlotWindow->addPlot( padQualityValues[0], padQualityValues[1] ); + } + + m_pcMainWindowManager->addSubWindow( pcPlotWindow ); + pcPlotWindow->show(); + } Void QualityHandle::slotQualityMetricChanged( Int idx ) @@ -220,7 +249,7 @@ Void QualityHandle::slotSelectReference() } } -Void QualityHandle::slotCreatePlot() +Void QualityHandle::slotPlotQualitySingle() { VideoSubWindow* pcSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); if( pcSubWindow ) @@ -229,18 +258,57 @@ Void QualityHandle::slotCreatePlot() { QVector apcWindowList; apcWindowList.append( pcSubWindow ); - QVector* qualityVector = measureQuality( apcWindowList ); - PlotSubWindow* pcPlotWindow = new PlotSubWindow( m_pcParet ); - - pcPlotWindow->addPlot( qualityVector[0], qualityVector[1] ); - - m_pcMainWindowManager->addSubWindow( pcPlotWindow ); - pcPlotWindow->show(); +//#ifndef QT_NO_CONCURRENT +// m_cMeasurementResult.waitForFinished(); +// m_cMeasurementResult = QtConcurrent::run( this, &QualityHandle::measureQuality, apcWindowList ); +//#else + QApplication::setOverrideCursor( Qt::WaitCursor ); + measureQuality( apcWindowList ); + QApplication::restoreOverrideCursor(); +//#endif } } +} +Void QualityHandle::slotPlotQualitySeveral() +{ + VideoSubWindow* pcSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); + if( pcSubWindow ) + { + QVector apcWindowList; + + VideoSubWindow* pcRefSubWindow = pcSubWindow->getRefSubWindow(); + if( !pcRefSubWindow ) + { + pcRefSubWindow = pcSubWindow; + } + + VideoSubWindow* pcVideoSubWindow; + QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_STREAM_SUBWINDOW ); + for( Int i = 0; i < subWindowList.size(); i++ ) + { + pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); + if( pcVideoSubWindow->getRefSubWindow() == pcRefSubWindow ) + { + apcWindowList.append( pcVideoSubWindow ); + } + } + + if( apcWindowList.size() > 0 ) + { +//#ifndef QT_NO_CONCURRENT +// m_cMeasurementResult.waitForFinished(); +// m_cMeasurementResult = QtConcurrent::run( this, &QualityHandle::measureQuality, apcWindowList ); +//#else + QApplication::setOverrideCursor( Qt::WaitCursor ); + measureQuality( apcWindowList ); + QApplication::restoreOverrideCursor(); +//#endif + + } + } } } // NAMESPACE diff --git a/app/QualityHandle.h b/app/QualityHandle.h index 29d683f..df01a2e 100644 --- a/app/QualityHandle.h +++ b/app/QualityHandle.h @@ -33,6 +33,7 @@ #elif( QT_VERSION_PLAYUVER == 4 ) #include #endif +#include "QFuture" #include "QualityMeasurementSidebar.h" namespace plaYUVer @@ -61,10 +62,12 @@ public: private: QWidget* m_pcParet; PlaYUVerSubWindowHandle* m_pcMainWindowManager; + enum { SELECT_REF_ACT, PLOT_QUALITY, + PLOT_SEVERAL_QUALITY, TOTAL_ACT, }; QVector m_arrayActions; @@ -78,7 +81,8 @@ private: QDockWidget* m_pcQualityHandleDock; QualityMeasurementSidebar* m_pcQualityHandleSideBar; - QVector* measureQuality( QVector apcWindowList ); + QFuture m_cMeasurementResult; + Void measureQuality( QVector apcWindowList ); Q_SIGNALS: void changed(); @@ -86,7 +90,8 @@ Q_SIGNALS: private Q_SLOTS: void slotQualityMetricChanged( int ); void slotSelectReference(); - void slotCreatePlot(); + void slotPlotQualitySingle(); + void slotPlotQualitySeveral(); }; } // NAMESPACE From d3a83bde04fd4799105f93c756382be7a4b20bc3 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 15:01:30 +0000 Subject: [PATCH 05/13] Fix quality plot window when using multiple plots --- app/QualityHandle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index 6ce37e9..bce8b29 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -186,10 +186,10 @@ Void QualityHandle::measureQuality( QVector apcWindowList ) } pcReferenceWindow->stop(); - QString plotWindowTitle( QStringLiteral( "Quality - " ) ); + QString plotWindowTitle( QStringLiteral( "Quality" ) ); if( apcWindowList.size() == 1 ) { - plotWindowTitle += apcWindowList.at( 0 )->getWindowName(); + plotWindowTitle += " - " + apcWindowList.at( 0 )->getWindowName(); } PlotSubWindow* pcPlotWindow = new PlotSubWindow( m_pcParet, plotWindowTitle ); pcPlotWindow->setAxisName( "Frame Number", QString::fromStdString( PlaYUVerFrame::supportedQualityMetricsList()[m_iQualityMetricIdx] ) ); From 59f744c7255ed51f6c97065b539f42357ac63b6d Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 15:40:29 +0000 Subject: [PATCH 06/13] Two improvements related with PlotSubWindow Fix ModulesHandle to filter PlotSubWinodws Generalize reload to be applied to all kinds of subwindows --- app/ModulesHandle.cpp | 2 +- app/PlotSubWindow.h | 5 +++++ app/SubWindowHandle.h | 5 +++++ app/VideoSubWindow.cpp | 19 +++++++++++++++---- app/VideoSubWindow.h | 3 ++- app/plaYUVerApp.cpp | 24 ++++++++++++++---------- 6 files changed, 42 insertions(+), 16 deletions(-) diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index 4e19ce7..7a5be64 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -256,7 +256,7 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf ) { QStringList selectedWindows = dialogWindowsSelection.getSelectedWindows(); VideoSubWindow *videoSubWindow; - QList subWindowList = m_pcMainWindowManager->findSubWindow(); + QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); for( Int j = 0; j < selectedWindows.size(); j++ ) { for( Int i = 0; i < subWindowList.size(); i++ ) diff --git a/app/PlotSubWindow.h b/app/PlotSubWindow.h index 090b50b..5be3302 100644 --- a/app/PlotSubWindow.h +++ b/app/PlotSubWindow.h @@ -65,6 +65,11 @@ public: Void definePlotColors(); + Void refreshSubWindow() + { + + } + Void setTool( UInt uiTool ) { } diff --git a/app/SubWindowHandle.h b/app/SubWindowHandle.h index 8b77dc1..f7e01f3 100644 --- a/app/SubWindowHandle.h +++ b/app/SubWindowHandle.h @@ -76,6 +76,11 @@ public: SubWindowHandle( QWidget *, UInt ); ~SubWindowHandle(); + /** + * Show the image at its original size + */ + virtual Void refreshSubWindow() = 0; + /** * Show the image at its original size */ diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index f3c049b..8f27eec 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -122,11 +122,22 @@ Void VideoSubWindow::loadAll() refreshFrame(); } -Void VideoSubWindow::reloadFile() +Void VideoSubWindow::refreshSubWindow() { - Int currFrameNum = m_pCurrStream->getCurrFrameNum(); - loadFile( m_cFilename, false ); - seekAbsoluteEvent( currFrameNum ); + if( getCategory() == SubWindowHandle::VIDEO_STREAM_SUBWINDOW ) + { + Int currFrameNum = m_pCurrStream->getCurrFrameNum(); + if( !loadFile( m_cFilename, false ) ) + { + close(); + return; + } + seekAbsoluteEvent( currFrameNum ); + } + else + { + refreshFrame(); + } } Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog ) diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 2208f15..c5ac156 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -117,9 +117,10 @@ public: Bool loadFile( QString cFilename, Bool bForceDialog = false ); Bool loadFile( PlaYUVerStreamInfo* streamInfo ); Void loadAll(); - Void reloadFile(); Bool save( QString filename ); + Void refreshSubWindow(); + Bool play(); Void pause(); Bool playEvent(); diff --git a/app/plaYUVerApp.cpp b/app/plaYUVerApp.cpp index 4119ced..b58189c 100644 --- a/app/plaYUVerApp.cpp +++ b/app/plaYUVerApp.cpp @@ -328,9 +328,9 @@ Void plaYUVerApp::format() Void plaYUVerApp::reload() { - if( m_pcCurrentVideoSubWindow ) + if( m_pcCurrentSubWindow ) { - m_pcCurrentVideoSubWindow->reloadFile(); + m_pcCurrentSubWindow->refreshSubWindow(); m_pcCurrentSubWindow = NULL; update(); } @@ -338,14 +338,18 @@ Void plaYUVerApp::reload() Void plaYUVerApp::reloadAll() { - VideoSubWindow *videoSubWindow; - QList subWindowList = m_pcWindowHandle->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); - for( Int i = 0; i < subWindowList.size(); i++ ) + UInt windowCategoryOrder[] = { - videoSubWindow = qobject_cast( subWindowList.at( i ) ); - if( !videoSubWindow->getIsModule() ) + SubWindowHandle::VIDEO_STREAM_SUBWINDOW, + SubWindowHandle::MODULE_SUBWINDOW, + SubWindowHandle::MODULE_SUBWINDOW }; + + for( UInt c = 0; c < 3; c++ ) + { + QList subWindowList = m_pcWindowHandle->findSubWindow( windowCategoryOrder[c] ); + for( Int i = 0; i < subWindowList.size(); i++ ) { - videoSubWindow->reloadFile(); + subWindowList.at( i )->refreshSubWindow(); } } m_pcCurrentSubWindow = NULL; @@ -533,10 +537,10 @@ Void plaYUVerApp::updateMenus() m_arrayActions[SAVE_ACT]->setEnabled( hasSubWindow ); m_arrayActions[CLOSE_ACT]->setEnabled( hasSubWindow ); m_arrayActions[CLOSEALL_ACT]->setEnabled( hasSubWindow ); + m_arrayActions[RELOAD_ACT]->setEnabled( hasSubWindow ); + m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasSubWindow ); m_arrayActions[FORMAT_ACT]->setEnabled( hasVideoStreamSubWindow ); - m_arrayActions[RELOAD_ACT]->setEnabled( hasVideoStreamSubWindow ); - m_arrayActions[RELOAD_ALL_ACT]->setEnabled( hasVideoStreamSubWindow ); m_arrayActions[LOAD_ALL_ACT]->setEnabled( hasVideoStreamSubWindow ); m_arrayActions[ZOOM_IN_ACT]->setEnabled( hasSubWindow ); From ce114a80c0f23eb68678ae635731b419610f3790 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 15:54:04 +0000 Subject: [PATCH 07/13] Fix quality measurement for several plots and add new opt to quality menu --- app/QualityHandle.cpp | 26 +++++++++++++++++++++++++- app/QualityHandle.h | 2 ++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index bce8b29..61b071b 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -66,6 +66,9 @@ Void QualityHandle::createActions() } m_arrayActions.resize( TOTAL_ACT ); + + m_arrayActions[SELECT_CURR_REF_ACT] = new QAction( "Select Current as Reference", this ); + connect( m_arrayActions[SELECT_CURR_REF_ACT], SIGNAL( triggered() ), this, SLOT( slotSelectCurrentAsReference() ) ); m_arrayActions[SELECT_REF_ACT] = new QAction( "Select Reference", this ); connect( m_arrayActions[SELECT_REF_ACT], SIGNAL( triggered() ), this, SLOT( slotSelectReference() ) ); @@ -80,6 +83,7 @@ QMenu* QualityHandle::createMenu() m_pcMenuQuality = new QMenu( "Quality", this ); m_pcSubMenuQualityMetrics = m_pcMenuQuality->addMenu( "Quality Metrics" ); m_pcSubMenuQualityMetrics->addActions( m_actionGroupQualityMetric->actions() ); + m_pcMenuQuality->addAction( m_arrayActions[SELECT_CURR_REF_ACT] ); m_pcMenuQuality->addAction( m_arrayActions[SELECT_REF_ACT] ); m_pcMenuQuality->addSeparator(); m_pcMenuQuality->addAction( m_arrayActions[PLOT_QUALITY] ); @@ -108,6 +112,7 @@ Void QualityHandle::updateMenus() Bool hasSubWindow = pcSubWindow ? true : false; m_pcSubMenuQualityMetrics->setEnabled( hasSubWindow ); + m_arrayActions[SELECT_CURR_REF_ACT]->setEnabled( hasSubWindow ); m_arrayActions[SELECT_REF_ACT]->setEnabled( hasSubWindow ); m_arrayActions[PLOT_QUALITY]->setEnabled( hasSubWindow ); @@ -221,6 +226,24 @@ Void QualityHandle::slotQualityMetricChanged( Int idx ) m_iQualityMetricIdx = idx; } +Void QualityHandle::slotSelectCurrentAsReference() +{ + VideoSubWindow* pcRefSubWindow = qobject_cast( m_pcMainWindowManager->activeSubWindow() ); + if( pcRefSubWindow ) + { + VideoSubWindow* pcVideoSubWindow; + QList subWindowList = m_pcMainWindowManager->findSubWindow( SubWindowHandle::VIDEO_SUBWINDOW ); + for( Int i = 0; i < subWindowList.size(); i++ ) + { + pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); + if( pcVideoSubWindow != pcRefSubWindow ) + pcVideoSubWindow->setRefSubWindow( pcRefSubWindow ); + } + m_pcQualityHandleSideBar->updateSidebarData(); + m_pcQualityHandleDock->show(); + } +} + Void QualityHandle::slotSelectReference() { DialogSubWindowSelector dialogWindowSelection( this, m_pcMainWindowManager, SubWindowHandle::VIDEO_SUBWINDOW, 1, 1 ); @@ -242,7 +265,8 @@ Void QualityHandle::slotSelectReference() for( Int i = 0; i < subWindowList.size(); i++ ) { pcVideoSubWindow = qobject_cast( subWindowList.at( i ) ); - pcVideoSubWindow->setRefSubWindow( pcRefSubWindow ); + if( pcVideoSubWindow != pcRefSubWindow ) + pcVideoSubWindow->setRefSubWindow( pcRefSubWindow ); } m_pcQualityHandleSideBar->updateSidebarData(); m_pcQualityHandleDock->show(); diff --git a/app/QualityHandle.h b/app/QualityHandle.h index df01a2e..663c59e 100644 --- a/app/QualityHandle.h +++ b/app/QualityHandle.h @@ -65,6 +65,7 @@ private: enum { + SELECT_CURR_REF_ACT, SELECT_REF_ACT, PLOT_QUALITY, PLOT_SEVERAL_QUALITY, @@ -89,6 +90,7 @@ Q_SIGNALS: private Q_SLOTS: void slotQualityMetricChanged( int ); + void slotSelectCurrentAsReference(); void slotSelectReference(); void slotPlotQualitySingle(); void slotPlotQualitySeveral(); From df84dfcc706d695797faf13f20c450bd33c683c1 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 18:37:20 +0000 Subject: [PATCH 08/13] change plot color to follow system theme --- app/PlotSubWindow.cpp | 28 ++++++++++++++++++++++------ app/SubWindowHandle.cpp | 1 + app/VideoSubWindow.cpp | 1 - 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/PlotSubWindow.cpp b/app/PlotSubWindow.cpp index 1a5d7dd..cb49969 100644 --- a/app/PlotSubWindow.cpp +++ b/app/PlotSubWindow.cpp @@ -40,11 +40,6 @@ Void PlotSubWindow::definePlotColors() PlotSubWindow::PlotSubWindow( QWidget * parent, const QString& windowTitle ) : SubWindowHandle( parent, SubWindowHandle::PLOT_SUBWINDOW ) { - setParent( parent ); - - setAttribute( Qt::WA_DeleteOnClose ); - setBackgroundRole( QPalette::Light ); - setVisible( false ); definePlotColors(); m_uiNumberPlots = 0; @@ -59,10 +54,27 @@ PlotSubWindow::PlotSubWindow( QWidget * parent, const QString& windowTitle ) : sizePolicy.setVerticalStretch( 0 ); sizePolicy.setHeightForWidth( m_cPlotArea->sizePolicy().hasHeightForWidth() ); m_cPlotArea->setSizePolicy( sizePolicy ); - setWidget( m_cPlotArea ); + + m_cPlotArea->setBackgroundRole( backgroundRole() ); + + m_cPlotArea->setBackground( palette().brush( backgroundRole() ) ); + + m_cPlotArea->xAxis->setLabelColor( palette().text().color() ); + m_cPlotArea->yAxis->setLabelColor( palette().text().color() ); + m_cPlotArea->xAxis->setTickLabelColor( palette().text().color() ); + m_cPlotArea->yAxis->setTickLabelColor( palette().text().color() ); + m_cPlotArea->xAxis->setBasePen( QPen( palette().brush( foregroundRole() ), 1 ) ); + m_cPlotArea->yAxis->setBasePen( QPen( palette().brush( foregroundRole() ), 1 ) ); + m_cPlotArea->xAxis->setTickPen( QPen( palette().brush( foregroundRole() ), 1 ) ); + m_cPlotArea->yAxis->setTickPen( QPen( palette().brush( foregroundRole() ), 1 ) ); + m_cPlotArea->xAxis2->setBasePen( QPen( palette().brush( foregroundRole() ), 1 ) ); + m_cPlotArea->yAxis2->setBasePen( QPen( palette().brush( foregroundRole() ), 1 ) ); + m_cPlotArea->xAxis2->setTickPen( QPen( palette().brush( foregroundRole() ), 1 ) ); + m_cPlotArea->yAxis2->setTickPen( QPen( palette().brush( foregroundRole() ), 1 ) ); // configure right and top axis to show ticks but no labels: // (see QCPAxisRect::setupFullAxesBox for a quicker method to do this) + m_cPlotArea->axisRect( 0 )->setupFullAxesBox( true ); m_cPlotArea->xAxis2->setVisible( true ); m_cPlotArea->xAxis2->setTickLabels( false ); m_cPlotArea->yAxis2->setVisible( true ); @@ -74,6 +86,9 @@ PlotSubWindow::PlotSubWindow( QWidget * parent, const QString& windowTitle ) : QFont legendFont = font(); // start out with MainWindow's font.. legendFont.setPointSize( 9 ); // and make a bit smaller for legend m_cPlotArea->legend->setFont( legendFont ); + m_cPlotArea->legend->setBrush( palette().brush( backgroundRole() ) ); + m_cPlotArea->legend->setTextColor( palette().text().color() ); + m_cPlotArea->legend->setBorderPen( QPen( palette().brush( QPalette::Active, QPalette::Shadow ), 1 ) ); m_cPlotArea->legend->setVisible( false ); m_cPlotArea->setInteractions( QCP::iRangeZoom | QCP::iRangeDrag ); //QCP::iSelectPlottables @@ -82,6 +97,7 @@ PlotSubWindow::PlotSubWindow( QWidget * parent, const QString& windowTitle ) : m_cPlotPen.setColor( Qt::black ); m_cPlotPen.setWidthF( 2 ); + setWidget( m_cPlotArea ); } PlotSubWindow::~PlotSubWindow() diff --git a/app/SubWindowHandle.cpp b/app/SubWindowHandle.cpp index 7830ba9..2ad5f1f 100644 --- a/app/SubWindowHandle.cpp +++ b/app/SubWindowHandle.cpp @@ -32,6 +32,7 @@ SubWindowHandle::SubWindowHandle( QWidget * parent, UInt category ) : m_cSubWindow( NULL ) { setParent( parent ); + setVisible( false ); setFocusPolicy( Qt::WheelFocus ); setAttribute( Qt::WA_DeleteOnClose ); setBackgroundRole( QPalette::Background ); diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 8f27eec..dbc08ae 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -84,7 +84,6 @@ VideoSubWindow::VideoSubWindow( enum VideoSubWindowCategories category, QWidget m_bIsPlaying( false ), m_bIsModule( category == MODULE_SUBWINDOW ) { - setVisible( false ); // Create a new interface to show images m_cViewArea = new ViewArea( this ); From c22a33b16257191906dab67616f09be2d88008ef Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 19:05:17 +0000 Subject: [PATCH 09/13] finish color definition of qcustomplot --- app/PlotSubWindow.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/app/PlotSubWindow.cpp b/app/PlotSubWindow.cpp index cb49969..de4f604 100644 --- a/app/PlotSubWindow.cpp +++ b/app/PlotSubWindow.cpp @@ -57,20 +57,27 @@ PlotSubWindow::PlotSubWindow( QWidget * parent, const QString& windowTitle ) : m_cPlotArea->setBackgroundRole( backgroundRole() ); - m_cPlotArea->setBackground( palette().brush( backgroundRole() ) ); + QBrush backgroundBrush = palette().brush( backgroundRole() ); + QBrush foregroundBrush = palette().brush( foregroundRole() ); + + m_cPlotArea->setBackground( backgroundBrush ); m_cPlotArea->xAxis->setLabelColor( palette().text().color() ); m_cPlotArea->yAxis->setLabelColor( palette().text().color() ); m_cPlotArea->xAxis->setTickLabelColor( palette().text().color() ); m_cPlotArea->yAxis->setTickLabelColor( palette().text().color() ); - m_cPlotArea->xAxis->setBasePen( QPen( palette().brush( foregroundRole() ), 1 ) ); - m_cPlotArea->yAxis->setBasePen( QPen( palette().brush( foregroundRole() ), 1 ) ); - m_cPlotArea->xAxis->setTickPen( QPen( palette().brush( foregroundRole() ), 1 ) ); - m_cPlotArea->yAxis->setTickPen( QPen( palette().brush( foregroundRole() ), 1 ) ); - m_cPlotArea->xAxis2->setBasePen( QPen( palette().brush( foregroundRole() ), 1 ) ); - m_cPlotArea->yAxis2->setBasePen( QPen( palette().brush( foregroundRole() ), 1 ) ); - m_cPlotArea->xAxis2->setTickPen( QPen( palette().brush( foregroundRole() ), 1 ) ); - m_cPlotArea->yAxis2->setTickPen( QPen( palette().brush( foregroundRole() ), 1 ) ); + m_cPlotArea->xAxis->setBasePen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->yAxis->setBasePen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->xAxis->setTickPen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->yAxis->setTickPen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->xAxis->setSubTickPen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->yAxis->setSubTickPen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->xAxis2->setSubTickPen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->yAxis2->setSubTickPen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->xAxis2->setBasePen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->yAxis2->setBasePen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->xAxis2->setTickPen( QPen( foregroundBrush, 1 ) ); + m_cPlotArea->yAxis2->setTickPen( QPen( foregroundBrush, 1 ) ); // configure right and top axis to show ticks but no labels: // (see QCPAxisRect::setupFullAxesBox for a quicker method to do this) @@ -86,7 +93,7 @@ PlotSubWindow::PlotSubWindow( QWidget * parent, const QString& windowTitle ) : QFont legendFont = font(); // start out with MainWindow's font.. legendFont.setPointSize( 9 ); // and make a bit smaller for legend m_cPlotArea->legend->setFont( legendFont ); - m_cPlotArea->legend->setBrush( palette().brush( backgroundRole() ) ); + m_cPlotArea->legend->setBrush( backgroundBrush ); m_cPlotArea->legend->setTextColor( palette().text().color() ); m_cPlotArea->legend->setBorderPen( QPen( palette().brush( QPalette::Active, QPalette::Shadow ), 1 ) ); m_cPlotArea->legend->setVisible( false ); From 78279015d46d3acedd9a9d22e5175b65109f86d8 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 13 Mar 2015 19:48:17 +0000 Subject: [PATCH 10/13] Add progress bar to quality plots --- app/CMakeLists.txt | 1 + app/ConfigureFormatDialog.h | 4 --- app/ProgressBar.cpp | 60 +++++++++++++++++++++++++++++++++++++ app/ProgressBar.h | 53 ++++++++++++++++++++++++++++++++ app/QualityHandle.cpp | 8 ++++- 5 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 app/ProgressBar.cpp create mode 100644 app/ProgressBar.h diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 53c9f25..7494733 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -69,6 +69,7 @@ set(plaYUVer_App_SRCS AboutDialog.cpp ConfigureFormatDialog.cpp DialogSubWindowSelector.cpp + ProgressBar.cpp # Widgets HistogramWidget.cpp WidgetFrameNumber.cpp diff --git a/app/ConfigureFormatDialog.h b/app/ConfigureFormatDialog.h index cb10ab4..7a745fd 100644 --- a/app/ConfigureFormatDialog.h +++ b/app/ConfigureFormatDialog.h @@ -42,10 +42,6 @@ class QColor; namespace plaYUVer { -#define ADD_STANDARD_RESOLUTION( name, width, height) \ - standardResolutionNames.push_back( QString( name ) ); \ - standardResolutionSizesList.push_back( QSize( width, height ) ) - /** * */ diff --git a/app/ProgressBar.cpp b/app/ProgressBar.cpp new file mode 100644 index 0000000..c264599 --- /dev/null +++ b/app/ProgressBar.cpp @@ -0,0 +1,60 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014-2015 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file ProgressBar.cpp + * \brief Progress bar code + */ + +#include "ProgressBar.h" +#include +#include +#include +#include +#include + +namespace plaYUVer +{ + +ProgressBar::ProgressBar( QWidget *parent, UInt maxValue ) : + QWidget( parent ), + m_uiTotalProgress( maxValue ), + m_uiProgress( 0 ) +{ + QVBoxLayout* mainLayout = new QVBoxLayout( this ); + m_pcProgressBar = new QProgressBar; + m_pcProgressBar->setMaximum( m_uiTotalProgress ); + m_pcProgressBar->setAlignment( Qt::AlignCenter ); + mainLayout->addWidget( m_pcProgressBar ); + setLayout( mainLayout ); + setWindowTitle( QStringLiteral( "Progress" ) ); + + QSize screenSize = QApplication::desktop()->availableGeometry().size(); + QPoint screenCenter = QApplication::desktop()->availableGeometry().center(); + resize( screenSize.width() / 4, screenSize.height() / 10 ); + move( screenCenter.x() - screenSize.width() / 8, screenCenter.y() - screenSize.height() / 10 ); + show(); +} + +Void ProgressBar::incrementProgress( UInt increment ) +{ + m_uiProgress += increment; + m_pcProgressBar->setValue( m_uiProgress ); +} +} // NAMESPACE diff --git a/app/ProgressBar.h b/app/ProgressBar.h new file mode 100644 index 0000000..fffa430 --- /dev/null +++ b/app/ProgressBar.h @@ -0,0 +1,53 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014-2015 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file ProgressBar.h + * \brief Progress bar code + */ + +#ifndef __PROGRESSBAR_H__ +#define __PROGRESSBAR_H__ + +#include "PlaYUVerAppDefs.h" +#include + +class QProgressBar; + +namespace plaYUVer +{ + +class ProgressBar: public QWidget +{ +Q_OBJECT + +public: + ProgressBar( QWidget *parent, UInt maxValue ); + + Void incrementProgress( UInt ); + +private: + UInt m_uiTotalProgress; + UInt m_uiProgress; + QProgressBar* m_pcProgressBar; +}; + +} // NAMESPACE + +#endif // __PROGRESSBAR_H__ diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index 61b071b..a83d7bc 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -23,12 +23,13 @@ */ #include +#include "lib/LibMemory.h" #include "PlaYUVerSubWindowHandle.h" #include "QualityHandle.h" #include "VideoSubWindow.h" #include "PlotSubWindow.h" #include "DialogSubWindowSelector.h" -#include "lib/LibMemory.h" +#include "ProgressBar.h" #if( QT_VERSION_PLAYUVER == 5 ) #include "QtConcurrent/qtconcurrentrun.h" #endif @@ -169,6 +170,8 @@ Void QualityHandle::measureQuality( QVector apcWindowList ) } pcReferenceWindow->stop(); + ProgressBar* pcProgressBar = new ProgressBar( m_pcParet, numberOfFrames ); + padQualityValues = new QVector [numberOfWindows + 1]; PlaYUVerFrame* pcReferenceFrame; @@ -184,6 +187,7 @@ Void QualityHandle::measureQuality( QVector apcWindowList ) apcWindowList.at( i )->seekRelativeEvent( true ); } pcReferenceWindow->seekRelativeEvent( true ); + pcProgressBar->incrementProgress( 1 ); } for( UInt i = 0; i < numberOfWindows; i++ ) { @@ -216,6 +220,8 @@ Void QualityHandle::measureQuality( QVector apcWindowList ) m_pcMainWindowManager->addSubWindow( pcPlotWindow ); pcPlotWindow->show(); + pcProgressBar->close(); + } Void QualityHandle::slotQualityMetricChanged( Int idx ) From 1481582314071e5cfedd2685428aca4fda467846 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 17 Mar 2015 16:27:40 +0000 Subject: [PATCH 11/13] Fix PlaYUVerFrame conversion to cv::mat --- lib/PlaYUVerFrame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PlaYUVerFrame.cpp b/lib/PlaYUVerFrame.cpp index bacb270..386875e 100644 --- a/lib/PlaYUVerFrame.cpp +++ b/lib/PlaYUVerFrame.cpp @@ -438,7 +438,7 @@ Void PlaYUVerFrame::getCvMat( Void** ppCvFrame ) switch( m_pcPelFormat->numberChannels ) { case 3: - cvType = CV_8UC3; + cvType = CV_8UC4; break; case 1: cvType = CV_8UC1; From 4aeedb0c15502649c7b1d06dd7ec1e722c075ec7 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 17 Mar 2015 16:27:55 +0000 Subject: [PATCH 12/13] Fix gui configurations in quality menu --- app/ModulesHandle.cpp | 2 ++ app/QualityHandle.cpp | 4 ++-- app/VideoSubWindow.cpp | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/ModulesHandle.cpp b/app/ModulesHandle.cpp index 7a5be64..6eee962 100644 --- a/app/ModulesHandle.cpp +++ b/app/ModulesHandle.cpp @@ -426,6 +426,7 @@ Void ModulesHandle::destroyAllModulesIf() Bool ModulesHandle::applyModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf, Bool isPlaying, Bool disableThreads ) { Bool bRet = false; + QApplication::setOverrideCursor( Qt::WaitCursor ); if( !isPlaying || ( isPlaying && pcCurrModuleIf->m_pcModule->m_bApplyWhilePlaying ) ) { #ifdef PLAYUVER_THREADED_MODULES @@ -444,6 +445,7 @@ Bool ModulesHandle::applyModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf, Bool isP { bRet = true; } + QApplication::restoreOverrideCursor(); return bRet; } diff --git a/app/QualityHandle.cpp b/app/QualityHandle.cpp index a83d7bc..550f622 100644 --- a/app/QualityHandle.cpp +++ b/app/QualityHandle.cpp @@ -68,7 +68,7 @@ Void QualityHandle::createActions() m_arrayActions.resize( TOTAL_ACT ); - m_arrayActions[SELECT_CURR_REF_ACT] = new QAction( "Select Current as Reference", this ); + m_arrayActions[SELECT_CURR_REF_ACT] = new QAction( "Mark as Reference", this ); connect( m_arrayActions[SELECT_CURR_REF_ACT], SIGNAL( triggered() ), this, SLOT( slotSelectCurrentAsReference() ) ); m_arrayActions[SELECT_REF_ACT] = new QAction( "Select Reference", this ); connect( m_arrayActions[SELECT_REF_ACT], SIGNAL( triggered() ), this, SLOT( slotSelectReference() ) ); @@ -85,7 +85,7 @@ QMenu* QualityHandle::createMenu() m_pcSubMenuQualityMetrics = m_pcMenuQuality->addMenu( "Quality Metrics" ); m_pcSubMenuQualityMetrics->addActions( m_actionGroupQualityMetric->actions() ); m_pcMenuQuality->addAction( m_arrayActions[SELECT_CURR_REF_ACT] ); - m_pcMenuQuality->addAction( m_arrayActions[SELECT_REF_ACT] ); + //m_pcMenuQuality->addAction( m_arrayActions[SELECT_REF_ACT] ); m_pcMenuQuality->addSeparator(); m_pcMenuQuality->addAction( m_arrayActions[PLOT_QUALITY] ); m_pcMenuQuality->addAction( m_arrayActions[PLOT_SEVERAL_QUALITY] ); diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index dbc08ae..8f960c3 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -155,8 +155,6 @@ Bool VideoSubWindow::loadFile( QString cFilename, Bool bForceDialog ) return false; } } - QApplication::setOverrideCursor( Qt::WaitCursor ); - QApplication::restoreOverrideCursor(); if( !m_pCurrStream ) { From ff6b3e7213f7b1832afe92ee87fbdf82173ff7b3 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 19 Mar 2015 15:22:37 +0000 Subject: [PATCH 13/13] Fix refresh subiwndow --- app/SubWindowHandle.h | 17 +++++++++++++++++ app/VideoSubWindow.cpp | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/SubWindowHandle.h b/app/SubWindowHandle.h index f7e01f3..62fb936 100644 --- a/app/SubWindowHandle.h +++ b/app/SubWindowHandle.h @@ -122,11 +122,28 @@ public: virtual Bool mayClose(); + /** + * Get category of the SubWindow + * @return category value based on enum SubWindowCategories + * @note This function should be used with enum SubWindowCategories + * with an & operation and it may belong to several categories + */ UInt getCategory() { return m_uiCategory; } + /** + * Check category of the SubWindow + * @param checkCateory SubWindow category to check against; + * it should be enum SubWindowCategories type + * @return true when SubWindow belong to checkCateory + */ + Bool checkCategory( UInt checkCateory ) + { + return m_uiCategory & checkCateory; + } + Void setSubWindow( PlaYUVerMdiSubWindow* subWindow ) { m_cSubWindow = subWindow; diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 8f960c3..4247a98 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -123,7 +123,7 @@ Void VideoSubWindow::loadAll() Void VideoSubWindow::refreshSubWindow() { - if( getCategory() == SubWindowHandle::VIDEO_STREAM_SUBWINDOW ) + if( getCategory() & SubWindowHandle::VIDEO_STREAM_SUBWINDOW ) { Int currFrameNum = m_pCurrStream->getCurrFrameNum(); if( !loadFile( m_cFilename, false ) )