Add modules arguments - test with binarization

This commit is contained in:
jfmcarreira committed 2015-03-22 04:27:57 +00:00
1 parent 013a5a967c
commit 2072efd2d7
11 files changed
+79 -10

No files matched your search

+32 -1
View File
@@ -87,13 +87,23 @@ Int CommandLineHandle::parseToolsArgs( Int argc, Char *argv[] )
m_uiLogLevel = RESULT;
}
if( Opts()["help"]->count() )
if( Opts()["module"]->count() && Opts()["help"]->count() )
{
listModuleHelp();
iRet = 1;
}
else if( Opts()["help"]->count() )
{
printf( "Usage: %s modules/quality [options] -input=input_file [--output=output_file]\n", argv[0] );
doHelp( std::cout, Opts() );
iRet = 1;
}
if( Opts()["module_list"]->count() || Opts()["module_list_full"]->count() )
{
listModules();
iRet = 1;
}
return iRet;
}
@@ -151,7 +161,28 @@ Void CommandLineHandle::listModules()
}
printf( "\n" );
}
}
Void CommandLineHandle::listModuleHelp()
{
std::string moduleName = m_strModule;
PlaYUVerModuleIf* pcCurrModuleIf = NULL;
PlaYUVerModuleFactoryMap& PlaYUVerModuleFactoryMap = PlaYUVerModuleFactory::Get()->getMap();
PlaYUVerModuleFactoryMap::iterator it = PlaYUVerModuleFactoryMap.begin();
for( UInt i = 0; it != PlaYUVerModuleFactoryMap.end(); ++it, i++ )
{
if( strcmp( it->first, moduleName.c_str() ) == 0 )
{
pcCurrModuleIf = it->second();
break;
}
}
if( pcCurrModuleIf )
{
printf( "Usage: playuverTools --module=%s options:\n", it->first );
doHelp( std::cout, pcCurrModuleIf->m_cModuleOptions );
}
}
} // NAMESPACE
+1
View File
@@ -94,6 +94,7 @@ private:
std::string m_strModule;
Void listModules();
Void listModuleHelp();
};
+3 -1
View File
@@ -180,13 +180,15 @@ Int PlaYUVerTools::Open( Int argc, Char *argv[] )
m_pcCurrModuleIf->create( m_apcInputStreams[0]->getCurrFrame() );
m_pcCurrModuleIf->m_cModuleOptions.allow_unknow = true;
scanArgv( m_pcCurrModuleIf->m_cModuleOptions, argc, ( const Char** )argv );
if( m_pcCurrModuleIf->m_iModuleType == FRAME_PROCESSING_MODULE )
{
// Check outputs
std::vector<std::string> outputFileNames;
if( m_cCmdLineHandler.Opts()["output"]->count() )
outputFileNames.push_back( m_cCmdLineHandler.m_strOutput );
;
if( outputFileNames.size() == 1 )
{