Update all modules to the new description

This commit is contained in:
jfmcarreira committed 2014-12-29 19:43:00 +00:00
1 parent bb9a9970b4
commit 3588884799
9 files changed
+57 -116

No files matched your search

+1 -4
View File
@@ -34,13 +34,10 @@ ModuleHandleDock::ModuleHandleDock( QWidget* parent, PlaYUVerAppModuleIf* module
QWidget( parent ),
m_pcCurrModuleIf( moduleIf )
{
PlaYUVerModuleDefinition ModuleDef = moduleIf->m_pcModule->getModuleDefinition();
// ----------------- Dock definition -----------------
QString labelStr;
labelStr.append( ModuleDef.m_pchModuleName );
labelStr.append( moduleIf->m_pcModule->m_pchModuleName );
labelStr.append( " Result:" );
labelModulueValueLabel = new QLabel( labelStr );
labelModulueValueLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
+17 -17
View File
@@ -95,11 +95,11 @@ QMenu* ModulesHandle::createMenu()
ModuleIfInternalName = QString::fromLocal8Bit( it->first );
currSubMenu = NULL;
if( pcCurrModuleIf->m_cModuleDef.m_pchModuleCategory )
if( pcCurrModuleIf->m_pchModuleCategory )
{
for( Int j = 0; j < m_pcModulesSubMenuList.size(); j++ )
{
if( m_pcModulesSubMenuList.at( j )->title() == QString( pcCurrModuleIf->m_cModuleDef.m_pchModuleCategory ) )
if( m_pcModulesSubMenuList.at( j )->title() == QString( pcCurrModuleIf->m_pchModuleCategory ) )
{
currSubMenu = m_pcModulesSubMenuList.at( j );
break;
@@ -107,13 +107,13 @@ QMenu* ModulesHandle::createMenu()
}
if( !currSubMenu )
{
currSubMenu = m_pcModulesMenu->addMenu( pcCurrModuleIf->m_cModuleDef.m_pchModuleCategory );
currSubMenu = m_pcModulesMenu->addMenu( pcCurrModuleIf->m_pchModuleCategory );
m_pcModulesSubMenuList.append( currSubMenu );
}
}
currAction = new QAction( pcCurrModuleIf->m_cModuleDef.m_pchModuleName, parent() );
currAction->setStatusTip( pcCurrModuleIf->m_cModuleDef.m_pchModuleTooltip );
currAction = new QAction( pcCurrModuleIf->m_pchModuleName, parent() );
currAction->setStatusTip( pcCurrModuleIf->m_pchModuleTooltip );
currAction->setData( ModuleIfInternalName );
currAction->setCheckable( true );
connect( currAction, SIGNAL( triggered() ), this, SLOT( activateModule() ) );
@@ -223,7 +223,7 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
QString windowName;
QVector<VideoSubWindow*> subWindowList;
UInt numberOfFrames = pcCurrModuleIf->m_pcModule->m_cModuleDef.m_uiNumberOfFrames;
UInt numberOfFrames = pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames;
if( numberOfFrames > MODULE_REQUIRES_ONE_FRAME ) // Show dialog to select sub windows
{
DialogSubWindowSelector dialogWindowsSelection( m_pcParent, m_pcMdiArea, numberOfFrames, numberOfFrames );
@@ -269,7 +269,7 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
}
windowName.append( " <" );
windowName.append( pcCurrModuleIf->m_pcModule->m_cModuleDef.m_pchModuleName );
windowName.append( pcCurrModuleIf->m_pcModule->m_pchModuleName );
windowName.append( ">" );
for( Int i = 0; i < subWindowList.size(); i++ )
@@ -280,9 +280,9 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
pcCurrModuleIf->m_pcDisplaySubWindow = NULL;
if( pcCurrModuleIf->m_pcModule->m_cModuleDef.m_iModuleType == FRAME_PROCESSING_MODULE )
if( pcCurrModuleIf->m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
{
if( ( pcCurrModuleIf->m_pcModule->m_cModuleDef.m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow )
if( ( pcCurrModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_NEW_WINDOW ) || bShowModulesNewWindow )
{
VideoSubWindow* interfaceChild = new VideoSubWindow( m_pcParent, true );
interfaceChild->setWindowName( windowName );
@@ -295,13 +295,13 @@ Void ModulesHandle::enableModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
m_pcMdiArea->addSubWindow( interfaceChild );
}
}
else if( pcCurrModuleIf->m_pcModule->m_cModuleDef.m_iModuleType == FRAME_MEASUREMENT_MODULE )
else if( pcCurrModuleIf->m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
{
if( pcCurrModuleIf->m_pcModule->m_cModuleDef.m_uiModuleRequirements & MODULE_REQUIRES_SIDEBAR )
if( pcCurrModuleIf->m_pcModule->m_uiModuleRequirements & MODULE_REQUIRES_SIDEBAR )
{
pcCurrModuleIf->m_pcModuleDock = new ModuleHandleDock( m_pcParent, pcCurrModuleIf );
QString titleDockWidget;
titleDockWidget.append( pcCurrModuleIf->m_pcModule->m_cModuleDef.m_pchModuleName );
titleDockWidget.append( pcCurrModuleIf->m_pcModule->m_pchModuleName );
titleDockWidget.append( " Information" );
pcCurrModuleIf->m_pcDockWidget = new QDockWidget( titleDockWidget, m_pcParent );
pcCurrModuleIf->m_pcDockWidget->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
@@ -376,7 +376,7 @@ Void ModulesHandle::destroyAllModulesIf()
Bool ModulesHandle::applyModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf, Bool isPlaying, Bool disableThreads )
{
Bool bRet = false;
if( !isPlaying || ( isPlaying && pcCurrModuleIf->m_pcModule->m_cModuleDef.m_bApplyWhilePlaying ) )
if( !isPlaying || ( isPlaying && pcCurrModuleIf->m_pcModule->m_bApplyWhilePlaying ) )
{
#ifdef PLAYUVER_THREADED_MODULES
if( !disableThreads )
@@ -385,7 +385,7 @@ Bool ModulesHandle::applyModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf, Bool isP
#endif
pcCurrModuleIf->run();
if( pcCurrModuleIf->m_pcDisplaySubWindow || pcCurrModuleIf->m_pcModule->m_cModuleDef.m_iModuleType == FRAME_MEASUREMENT_MODULE )
if( pcCurrModuleIf->m_pcDisplaySubWindow || pcCurrModuleIf->m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
{
bRet = true;
}
@@ -447,7 +447,7 @@ Void ModulesHandle::applyAllModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
}
if( pcCurrModuleIf->m_pcModuleStream )
{
UInt numberOfWindows = pcCurrModuleIf->m_pcModule->m_cModuleDef.m_uiNumberOfFrames;
UInt numberOfWindows = pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames;
UInt64 currFrames = 0;
UInt64 numberOfFrames = INT_MAX;
for( UInt i = 0; i < numberOfWindows; i++ )
@@ -504,7 +504,7 @@ Bool ModulesHandle::showModuleIf( PlaYUVerAppModuleIf *pcCurrModuleIf, Double mo
Void ModulesHandle::swapModulesWindowsIf( PlaYUVerAppModuleIf *pcCurrModuleIf )
{
if( pcCurrModuleIf->m_pcModule->m_cModuleDef.m_uiNumberOfFrames == MODULE_REQUIRES_TWO_FRAMES )
if( pcCurrModuleIf->m_pcModule->m_uiNumberOfFrames == MODULE_REQUIRES_TWO_FRAMES )
{
VideoSubWindow* auxWindowHandle = pcCurrModuleIf->m_pcSubWindow[0];
pcCurrModuleIf->m_pcSubWindow[0] = pcCurrModuleIf->m_pcSubWindow[1];
@@ -522,7 +522,7 @@ Void ModulesHandle::customEvent( QEvent *event )
PlaYUVerAppModuleIf::EventData *eventData = ( PlaYUVerAppModuleIf::EventData* )event;
if( eventData->m_bSuccess )
{
switch( eventData->m_pcModule->m_pcModule->m_cModuleDef.m_iModuleType )
switch( eventData->m_pcModule->m_pcModule->m_iModuleType )
{
case FRAME_PROCESSING_MODULE:
showModuleIf( eventData->m_pcModule, eventData->m_pcModule->m_pcProcessedFrame );
+4 -4
View File
@@ -50,9 +50,9 @@ void PlaYUVerAppModuleIf::run()
m_pcProcessedFrame = NULL;
m_dMeasurementResult = 0;
if( m_pcModule->m_cModuleDef.m_iModuleType == FRAME_PROCESSING_MODULE )
if( m_pcModule->m_iModuleType == FRAME_PROCESSING_MODULE )
{
switch( m_pcModule->m_cModuleDef.m_uiNumberOfFrames )
switch( m_pcModule->m_uiNumberOfFrames )
{
case MODULE_REQUIRES_ONE_FRAME:
m_pcProcessedFrame = m_pcModule->process( m_pcSubWindow[0]->getCurrFrame() );
@@ -65,9 +65,9 @@ void PlaYUVerAppModuleIf::run()
break;
}
}
else if( m_pcModule->m_cModuleDef.m_iModuleType == FRAME_MEASUREMENT_MODULE )
else if( m_pcModule->m_iModuleType == FRAME_MEASUREMENT_MODULE )
{
switch( m_pcModule->m_cModuleDef.m_uiNumberOfFrames )
switch( m_pcModule->m_uiNumberOfFrames )
{
case MODULE_REQUIRES_ONE_FRAME:
m_dMeasurementResult = m_pcModule->measure( m_pcSubWindow[0]->getCurrFrame() );
-11
View File
@@ -27,16 +27,6 @@
namespace plaYUVer
{
static PlaYUVerModuleDefinition AbsoluteFrameDifferenceDef =
{
FRAME_PROCESSING_MODULE,
"Measurements",
"AbsoluteFrameDifference",
"Measure the absolute difference between two images (Y plane), e. g., abs( Y1 - Y2 )",
MODULE_REQUIRES_TWO_FRAMES,
MODULE_REQUIRES_NEW_WINDOW,
APPLY_WHILE_PLAYING, };
AbsoluteFrameDifference::AbsoluteFrameDifference()
{
/* Module Definition */
@@ -49,7 +39,6 @@ AbsoluteFrameDifference::AbsoluteFrameDifference()
m_bApplyWhilePlaying = APPLY_WHILE_PLAYING;
m_pcFrameDifference = NULL;
setModuleDefinition( AbsoluteFrameDifferenceDef );
}
Void AbsoluteFrameDifference::create( PlaYUVerFrame* Input )
+1 -12
View File
@@ -29,19 +29,9 @@
namespace plaYUVer
{
static PlaYUVerModuleDefinition DisparityStereoVarDef =
{
FRAME_PROCESSING_MODULE,
"Disparity",
"StereoVar",
"Measure the disparity between two images using the Stereo Var method (OpenCV)",
MODULE_REQUIRES_TWO_FRAMES,
MODULE_REQUIRES_NEW_WINDOW,
!APPLY_WHILE_PLAYING,
};
DisparityStereoVar::DisparityStereoVar()
{
/* Module Definition */
m_iModuleType = FRAME_PROCESSING_MODULE;
m_pchModuleCategory = "Disparity";
m_pchModuleName = "StereoVar";
@@ -50,7 +40,6 @@ DisparityStereoVar::DisparityStereoVar()
m_uiModuleRequirements = MODULE_REQUIRES_NEW_WINDOW;
m_bApplyWhilePlaying = !APPLY_WHILE_PLAYING;
setModuleDefinition( DisparityStereoVarDef );
m_pcDisparityFrame = NULL;
m_cStereoVar.levels = 3; // ignored with USE_AUTO_PARAMS
m_cStereoVar.pyrScale = 0.5; // ignored with USE_AUTO_PARAMS
+26 -40
View File
@@ -54,22 +54,18 @@ Void FilterComponent::destroy()
m_pcFilteredFrame = NULL;
}
PlaYUVerModuleDefinition FilterComponentLumaDef = {
FRAME_PROCESSING_MODULE, // Apply module to the frames or to the whole sequence.
// Currently only support for frame
"Filter Component", // Category (sub-menu)
"Luma", // Name
"Filter Y matrix of YUV frame", // Description
MODULE_REQUIRES_ONE_FRAME, // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
MODULE_REQUIRES_NOTHING, // Module requirements (check PlaYUVerModulesIf.h).
// Several requirements should be "or" between each others.
APPLY_WHILE_PLAYING, // Apply module while playing
};
FilterComponentLuma::FilterComponentLuma()
{
setModuleDefinition( FilterComponentLumaDef );
/* Module Definition */
m_iModuleType = FRAME_PROCESSING_MODULE; // Apply module to the frames or to the whole sequence.
// Currently only support for frame
m_pchModuleCategory = "Filter Component"; // Category (sub-menu)
m_pchModuleName = "Luma"; // Name
m_pchModuleTooltip = "Filter Y matrix of YUV frame"; // Description
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME; // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING; // Module requirements (check PlaYUVerModulesIf.h).
// Several requirements should be "or" between each others.
m_bApplyWhilePlaying = APPLY_WHILE_PLAYING; // Apply module while playing
}
Void FilterComponentLuma::create( PlaYUVerFrame* InputFrame )
@@ -82,21 +78,16 @@ PlaYUVerFrame* FilterComponentLuma::process( PlaYUVerFrame* InputFrame )
return filterComponent( InputFrame, LUMA );
}
PlaYUVerModuleDefinition FilterComponentCbDef = {
FRAME_PROCESSING_MODULE, // Apply module to the frames or to the whole sequence.
// Currently only support for frame
"Filter Component", // Category (sub-menu)
"Chroma U", // Name
"Filter Y matrix of YUV frame", // Description
MODULE_REQUIRES_ONE_FRAME, // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
MODULE_REQUIRES_NOTHING, // Module requirements (check PlaYUVerModulesIf.h).
// Several requirements should be "or" between each others.
APPLY_WHILE_PLAYING, // Apply module while playing
};
FilterComponentChromaU::FilterComponentChromaU()
{
setModuleDefinition( FilterComponentCbDef );
/* Module Definition */
m_iModuleType = FRAME_PROCESSING_MODULE;
m_pchModuleCategory = "Filter Component";
m_pchModuleName = "Chroma U";
m_pchModuleTooltip = "Filter U matrix of YUV frame";
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING;
m_bApplyWhilePlaying = !APPLY_WHILE_PLAYING;
}
Void FilterComponentChromaU::create( PlaYUVerFrame* InputFrame )
@@ -109,21 +100,16 @@ PlaYUVerFrame* FilterComponentChromaU::process( PlaYUVerFrame* InputFrame )
return filterComponent( InputFrame, CHROMA_U );
}
PlaYUVerModuleDefinition FilterComponentCrDef = {
FRAME_PROCESSING_MODULE, // Apply module to the frames or to the whole sequence.
// Currently only support for frame
"Filter Component", // Category (sub-menu)
"Chroma R", // Name
"Filter Y matrix of YUV frame", // Description
MODULE_REQUIRES_ONE_FRAME, // Number of Frames required (ONE_FRAME, TWO_FRAMES, THREE_FRAMES)
MODULE_REQUIRES_NOTHING, // Module requirements (check PlaYUVerModulesIf.h).
// Several requirements should be "or" between each others.
APPLY_WHILE_PLAYING, // Apply module while playing
};
FilterComponentChromaV::FilterComponentChromaV()
{
setModuleDefinition( FilterComponentCrDef );
/* Module Definition */
m_iModuleType = FRAME_PROCESSING_MODULE;
m_pchModuleCategory = "Filter Component";
m_pchModuleName = "Chroma V";
m_pchModuleTooltip = "Filter V matrix of YUV frame";
m_uiNumberOfFrames = MODULE_REQUIRES_ONE_FRAME;
m_uiModuleRequirements = MODULE_REQUIRES_NOTHING;
m_bApplyWhilePlaying = !APPLY_WHILE_PLAYING;
}
Void FilterComponentChromaV::create( PlaYUVerFrame* InputFrame )
-12
View File
@@ -28,17 +28,6 @@
namespace plaYUVer
{
static PlaYUVerModuleDefinition FrameDifferenceDef =
{
FRAME_PROCESSING_MODULE,
"Measurements",
"FrameDifference",
"Measure the difference between two images (Y plane), Y1 - Y2, with max absolute diff of 128",
MODULE_REQUIRES_TWO_FRAMES,
MODULE_REQUIRES_NEW_WINDOW,
APPLY_WHILE_PLAYING,
};
FrameDifference::FrameDifference()
{
/* Module Definition */
@@ -51,7 +40,6 @@ FrameDifference::FrameDifference()
m_bApplyWhilePlaying = APPLY_WHILE_PLAYING;
m_pcFrameDifference = NULL;
setModuleDefinition( FrameDifferenceDef );
}
Void FrameDifference::create( PlaYUVerFrame* Input )
+8 -11
View File
@@ -27,19 +27,16 @@
namespace plaYUVer
{
static PlaYUVerModuleDefinition MeasurePSNRDef =
{
FRAME_MEASUREMENT_MODULE,
"Quality",
"PSNR Y",
"Measure the PSNR between two images",
MODULE_REQUIRES_TWO_FRAMES,
MODULE_REQUIRES_SIDEBAR,
APPLY_WHILE_PLAYING, };
MeasurePSNR::MeasurePSNR()
{
setModuleDefinition( MeasurePSNRDef );
/* Module Definition */
m_iModuleType = FRAME_PROCESSING_MODULE;
m_pchModuleCategory = "Quality";
m_pchModuleName = "PSNR Y";
m_pchModuleTooltip = "Measure the PSNR between two images";
m_uiNumberOfFrames = MODULE_REQUIRES_TWO_FRAMES;
m_uiModuleRequirements = MODULE_REQUIRES_SIDEBAR;
m_bApplyWhilePlaying = APPLY_WHILE_PLAYING;
}
Void MeasurePSNR::create( PlaYUVerFrame* Org )
-5
View File
@@ -84,8 +84,6 @@ public:
UInt m_uiModuleRequirements;
Bool m_bApplyWhilePlaying;
PlaYUVerModuleDefinition m_cModuleDef;
PlaYUVerModuleIf() {}
virtual ~PlaYUVerModuleIf() {}
@@ -104,9 +102,6 @@ public:
virtual Void destroy() { }
Void setModuleDefinition( PlaYUVerModuleDefinition def ) { m_cModuleDef = def; }
PlaYUVerModuleDefinition getModuleDefinition() { return m_cModuleDef; }
};
} // NAMESPACE