00001 /** 00002 * @file ColorTableModSelector.h 00003 * 00004 * Definition of class ColorTableModSelector 00005 * 00006 * @author <A href=mailto:walter.nistico@uni-dortmund.de>Walter Nistico</A> 00007 */ 00008 00009 #ifndef __ColorTableModSelector_h_ 00010 #define __ColorTableModSelector_h_ 00011 00012 #include "Tools/Module/ModuleSelector.h" 00013 00014 #include "ColorTable64Mod.h" 00015 #include "ColorTable32KMod.h" 00016 00017 /** 00018 * A selector for color table modules. 00019 */ 00020 class ColorTableModSelector : public ModuleSelector, public ColorTableModInterfaces 00021 { 00022 public: 00023 /** 00024 * Constructor. 00025 * @param handler The module handler of the process. 00026 * @param interfaces The parameters of the ImageProcessor module. 00027 */ 00028 ColorTableModSelector(ModuleHandler &handler, const ColorTableModInterfaces& interfaces) 00029 : ModuleSelector(SolutionRequest::colorTableMod), ColorTableModInterfaces(interfaces) 00030 { 00031 handler.setModuleSelector(SolutionRequest::colorTableMod, this); 00032 } 00033 00034 /** 00035 * Is called on start and when the selected solution changes 00036 * to create a specific solution. 00037 * @param id The id of the solution to create 00038 * @return The created solution or 0 00039 */ 00040 virtual Module* createSolution(SolutionRequest::ModuleSolutionID id) 00041 { 00042 switch(id) 00043 { 00044 case SolutionRequest::colorTable64Mod: 00045 { 00046 ColorTable64Mod* _colorTable64Mod = new ColorTable64Mod(*this); 00047 _colorTable64Mod->setup(); 00048 return _colorTable64Mod; 00049 } 00050 case SolutionRequest::colorTable32KMod: 00051 { 00052 ColorTable32KMod* _colorTable32KMod = new ColorTable32KMod(*this); 00053 _colorTable32KMod->setup(); 00054 return _colorTable32KMod; 00055 } 00056 default: 00057 { 00058 ColorTable* dummy = new ColorTable(); 00059 memcpy(colorTable, dummy, sizeof(ColorTable)); 00060 delete(dummy); 00061 return 0; 00062 } 00063 } 00064 } 00065 00066 }; 00067 00068 #endif // __ColorTableModSelector_h_
1.3.6