New definition of module list in ModuleFactory
This commit is contained in:
1 parent
f3590dff48
commit
cb77bb5fda
2 files changed
+16
-27
No files matched your search
+15
-9
@@ -12,22 +12,18 @@ set(plaYUver_Mod_SRCS
|
|||||||
|
|
||||||
MACRO(ADD_MODULE name file )
|
MACRO(ADD_MODULE name file )
|
||||||
set(__modulename "Module${name}")
|
set(__modulename "Module${name}")
|
||||||
OPTION(MODULE_${name} "Use module ${name}" ON )
|
OPTION(MODULE_${name} "Use module ${name}" ON )
|
||||||
ADD_FEATURE_INFO(${name} MODULE_${name} "Module ${name}" )
|
ADD_FEATURE_INFO(${name} MODULE_${name} "Module ${name}" )
|
||||||
if( MODULE_${name} )
|
if( MODULE_${name} )
|
||||||
list(APPEND plaYUver_Mod_SRCS ${file} )
|
list(APPEND plaYUver_Mod_SRCS ${file} )
|
||||||
LIST(APPEND MODULES_LIST ${name} )
|
LIST(APPEND MODULES_LIST_NAME ${name} )
|
||||||
|
LIST(APPEND MODULES_LIST_FILES ${file} )
|
||||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#include \"${file}.h\"\n")
|
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#include \"${file}.h\"\n")
|
||||||
endif()
|
endif()
|
||||||
unset(__modulename)
|
unset(__modulename)
|
||||||
ENDMACRO()
|
ENDMACRO()
|
||||||
|
|
||||||
|
|
||||||
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "// This files add the header files of each module\n"
|
|
||||||
|
|
||||||
"#ifndef __MODULESLISTHEADER_H__\n#define __MODULESLISTHEADER_H__\n" )
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Modules List
|
# Modules List
|
||||||
#
|
#
|
||||||
@@ -52,9 +48,19 @@ ENDIF()
|
|||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Finish header
|
# Create header
|
||||||
#
|
#
|
||||||
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#endif // __MODULESLISTHEADER_H__\n" )
|
file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "// This files add the header files of each module\n"
|
||||||
|
|
||||||
|
"#ifndef __MODULESLISTHEADER_H__\n#define __MODULESLISTHEADER_H__\n" )
|
||||||
|
foreach(module ${MODULES_LIST_FILES} )
|
||||||
|
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#include \"${module}.h\"\n")
|
||||||
|
endforeach(module_Name)
|
||||||
|
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "#define REGISTER_ALL_MODULES \\\n" )
|
||||||
|
foreach(module ${MODULES_LIST_NAME} )
|
||||||
|
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "Register( \"${module}\", &(${module}::Create) ); \\\n")
|
||||||
|
endforeach(module_Name)
|
||||||
|
file( APPEND ${CMAKE_CURRENT_BINARY_DIR}/ModulesListHeader.h "\n#endif // __MODULESLISTHEADER_H__\n" )
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES( ${OpenCV_INCLUDE_DIRS} )
|
INCLUDE_DIRECTORIES( ${OpenCV_INCLUDE_DIRS} )
|
||||||
ADD_LIBRARY( PlaYUVerModules ${plaYUver_Mod_SRCS} )
|
ADD_LIBRARY( PlaYUVerModules ${plaYUver_Mod_SRCS} )
|
||||||
|
|||||||
@@ -36,24 +36,7 @@ namespace plaYUVer
|
|||||||
|
|
||||||
PlaYUVerModuleFactory::PlaYUVerModuleFactory()
|
PlaYUVerModuleFactory::PlaYUVerModuleFactory()
|
||||||
{
|
{
|
||||||
Register( "FilterComponentLuma", &FilterComponentLuma::Create );
|
REGISTER_ALL_MODULES
|
||||||
Register( "FilterComponentChromaU", &FilterComponentChromaU::Create );
|
|
||||||
Register( "FilterComponentChromaV", &FilterComponentChromaV::Create );
|
|
||||||
Register( "AbsoluteFrameDifference", &AbsoluteFrameDifference::Create );
|
|
||||||
Register( "FrameDifference", &FrameDifference::Create );
|
|
||||||
Register( "FrameMask", &FrameMask::Create );
|
|
||||||
Register( "SetChromaHalfScale", &SetChromaHalfScale::Create );
|
|
||||||
Register( "FrameCrop", &FrameCrop::Create );
|
|
||||||
Register( "FrameBinarization", &FrameBinarization::Create );
|
|
||||||
Register( "FrameShift", &FrameShift::Create );
|
|
||||||
Register( "EightBitsSampling", &EightBitsSampling::Create );
|
|
||||||
Register( "LumaAverage", &LumaAverage::Create );
|
|
||||||
Register( "WeightedPSNR", &WeightedPSNR::Create );
|
|
||||||
#ifdef USE_OPENCV
|
|
||||||
//Register( "DisparityStereoVar", &DisparityStereoVar::Create );
|
|
||||||
Register( "DisparityStereoBM", &DisparityStereoBM::Create );
|
|
||||||
Register( "DisparityStereoSGBM", &DisparityStereoSGBM::Create );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaYUVerModuleFactory::~PlaYUVerModuleFactory()
|
PlaYUVerModuleFactory::~PlaYUVerModuleFactory()
|
||||||
|
|||||||
Reference in new issue
Block a user