Initial definition of a module to measure PSNR and to display results on a dock

This commit is contained in:
jfmcarreira committed 2014-06-27 02:20:34 +01:00
1 parent 3a09163a38
commit 4fc7218c79
6 files changed
+54 -30

No files matched your search

+20 -9
View File
@@ -106,7 +106,7 @@ SubWindowHandle* ModulesHandle::enableModuleIf( PlaYUVerModuleIf *pcCurrModuleIf
QString windowName;
UInt numberOfFrames = pcCurrModuleIf->m_cModuleDef.m_uiNumberOfFrames;
if( numberOfFrames > MODULE_REQUIRES_ONE_FRAME )
if( numberOfFrames > MODULE_REQUIRES_ONE_FRAME ) // Show dialog to select sub windows
{
DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMdiArea, numberOfFrames );
if( dialogWindowsSelection.exec() == QDialog::Accepted )
@@ -141,18 +141,30 @@ SubWindowHandle* ModulesHandle::enableModuleIf( PlaYUVerModuleIf *pcCurrModuleIf
windowName.append( ">" );
pcCurrModuleIf->m_pcDisplaySubWindow = NULL;
if( ( pcCurrModuleIf->m_cModuleDef.m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow )
if( pcCurrModuleIf->m_cModuleDef.m_iModuleType == FRAME_PROCESSING_MODULE )
{
interfaceChild = new SubWindowHandle( m_pcParent, true );
interfaceChild->setWindowName( windowName );
connect( interfaceChild->getViewArea(), SIGNAL( positionChanged(const QPoint &, PlaYUVerFrame *) ), m_pcParent,
SLOT( updatePixelValueStatusBar(const QPoint &, PlaYUVerFrame *) ) );
pcCurrModuleIf->m_pcDisplaySubWindow = interfaceChild;
pcCurrModuleIf->m_pcDisplaySubWindow->setModule( pcCurrModuleIf );
if( ( pcCurrModuleIf->m_cModuleDef.m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow )
{
interfaceChild = new SubWindowHandle( m_pcParent, true );
interfaceChild->setWindowName( windowName );
connect( interfaceChild->getViewArea(), SIGNAL( positionChanged(const QPoint &, PlaYUVerFrame *) ), m_pcParent,
SLOT( updatePixelValueStatusBar(const QPoint &, PlaYUVerFrame *) ) );
pcCurrModuleIf->m_pcDisplaySubWindow = interfaceChild;
pcCurrModuleIf->m_pcDisplaySubWindow->setModule( pcCurrModuleIf );
}
}
if( pcCurrModuleIf->m_cModuleDef.m_iModuleType == FRAME_MEASUREMENT_MODULE )
{
if( pcCurrModuleIf->m_cModuleDef.m_uiModuleRequirements & MODULE_REQUIRES_SIDEBAR )
{
pcCurrModuleIf->m_pcModuleDock = new ModuleHandleDock( m_pcParent );
}
}
// Create Module
pcCurrModuleIf->create( pcCurrModuleIf->m_pcSubWindow[0]->getCurrFrame() );
// Associate module with subwindows
for( UInt i = 0; i < numberOfFrames; i++ )
{
pcCurrModuleIf->m_pcSubWindow[i]->enableModule( pcCurrModuleIf );
@@ -251,7 +263,6 @@ Void ModulesHandle::openModuleIfStream( PlaYUVerModuleIf *pcCurrModuleIf )
UInt Width = 0, Height = 0, FrameRate = 30;
Int InputFormat = -1;
QString supported = tr( "Supported Files (" );
QStringList formatsList;
QStringList formatsExt = PlaYUVerStream::supportedWriteFormatsExt();
+1
View File
@@ -31,6 +31,7 @@ namespace plaYUVer
PlaYUVerModuleIf::PlaYUVerModuleIf() :
m_pcAction( NULL ),
m_pcDisplaySubWindow( NULL ),
m_pcModuleDock( NULL ),
m_pcModuleStream( NULL ),
m_pcProcessedFrame( NULL )
{
+8 -2
View File
@@ -31,6 +31,7 @@
#include <cstdio>
#include "PlaYUVerFrame.h"
#include "PlaYUVerStream.h"
#include "ModuleHandleDock.h"
class QAction;
@@ -40,7 +41,6 @@ namespace plaYUVer
enum // Module type
{
FRAME_PROCESSING_MODULE,
VIDEO_PROCESSING_MODULE,
FRAME_MEASUREMENT_MODULE,
};
@@ -96,7 +96,10 @@ class PlaYUVerModuleIf
private:
QAction* m_pcAction;
SubWindowHandle* m_pcSubWindow[MAX_NUMBER_FRAMES];
SubWindowHandle* m_pcDisplaySubWindow;
ModuleHandleDock* m_pcModuleDock;
PlaYUVerModuleDefinition m_cModuleDef;
PlaYUVerStream* m_pcModuleStream;
@@ -126,11 +129,14 @@ public:
virtual Void create() {}
virtual Void create( PlaYUVerFrame* ) {}
virtual Void process() {}
virtual PlaYUVerFrame* process( PlaYUVerFrame* ) { return NULL; }
virtual PlaYUVerFrame* process( PlaYUVerFrame*, PlaYUVerFrame* ) { return NULL; }
virtual PlaYUVerFrame* process( PlaYUVerFrame*, PlaYUVerFrame*, PlaYUVerFrame* ) { return NULL; }
virtual Double measure( PlaYUVerFrame* ) { return 0; }
virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame* ) { return 0; }
virtual Double measure( PlaYUVerFrame*, PlaYUVerFrame*, PlaYUVerFrame* ) { return 0; }
virtual Void destroy() { }
Void setModuleDefinition( PlaYUVerModuleDefinition def ) { m_cModuleDef = def; }