IntegerMathEngine.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef CHANNELS_INTEGERMATHENGINE_C_DEFINED
00039 #define CHANNELS_INTEGERMATHENGINE_C_DEFINED
00040
00041 #include "Channels/IntegerMathEngine.H"
00042
00043 #include "Channels/ChannelOpts.H"
00044 #include "Component/ModelOptionDef.H"
00045 #include "Image/c_integer_math_ops.h"
00046
00047 IntegerMathEngine::IntegerMathEngine(OptionManager& mgr)
00048 :
00049 ModelComponent(mgr, "Integer Math Engine", "IntegerMathEngine"),
00050 itsScaleBits(&OPT_IntChannelScaleBits, this),
00051 itsLowPass5(&OPT_IntMathLowPass5, this),
00052 itsLowPass9(&OPT_IntMathLowPass9, this),
00053 itsImath()
00054 {
00055
00056 itsImath.nbits = 30;
00057 itsImath.low_pass_5_x_dec_x_manybits = &c_intg_low_pass_5_x_dec_x_manybits;
00058 itsImath.low_pass_5_y_dec_y_manybits = &c_intg_low_pass_5_y_dec_y_manybits;
00059 itsImath.low_pass_5_x_dec_x_fewbits = &c_intg_low_pass_5_x_dec_x_fewbits;
00060 itsImath.low_pass_5_y_dec_y_fewbits = &c_intg_low_pass_5_y_dec_y_fewbits;
00061 itsImath.low_pass_9_x_manybits = &c_intg_low_pass_9_x_manybits;
00062 itsImath.low_pass_9_y_manybits = &c_intg_low_pass_9_y_manybits;
00063 itsImath.low_pass_9_x_fewbits = &c_intg_low_pass_9_x_fewbits;
00064 itsImath.low_pass_9_y_fewbits = &c_intg_low_pass_9_y_fewbits;
00065 itsImath.x_filter_clean_manybits = &c_intg_x_filter_clean_manybits;
00066 itsImath.x_filter_clean_fewbits = &c_intg_x_filter_clean_fewbits;
00067 itsImath.x_filter_clean_small_manybits = &c_intg_x_filter_clean_small_manybits;
00068 itsImath.x_filter_clean_small_fewbits = &c_intg_x_filter_clean_small_fewbits;
00069 itsImath.y_filter_clean_manybits = &c_intg_y_filter_clean_manybits;
00070 itsImath.y_filter_clean_fewbits = &c_intg_y_filter_clean_fewbits;
00071 itsImath.y_filter_clean_small_manybits = &c_intg_y_filter_clean_small_manybits;
00072 itsImath.y_filter_clean_small_fewbits = &c_intg_y_filter_clean_small_fewbits;
00073
00074 }
00075
00076 void IntegerMathEngine::paramChanged(ModelParamBase* const param,
00077 const bool valueChanged,
00078 ParamClient::ChangeStatus* status)
00079 {
00080 ModelComponent::paramChanged(param, valueChanged, status);
00081
00082 if (param == &itsScaleBits)
00083 itsImath.nbits = itsScaleBits.getVal();
00084
00085 else if (param == &itsLowPass5)
00086 {
00087 if (itsLowPass5.getVal().compare("lp5std") == 0)
00088 {
00089 itsImath.low_pass_5_x_dec_x_manybits = &c_intg_low_pass_5_x_dec_x_manybits;
00090 itsImath.low_pass_5_y_dec_y_manybits = &c_intg_low_pass_5_y_dec_y_manybits;
00091 itsImath.low_pass_5_x_dec_x_fewbits = &c_intg_low_pass_5_x_dec_x_fewbits;
00092 itsImath.low_pass_5_y_dec_y_fewbits = &c_intg_low_pass_5_y_dec_y_fewbits;
00093 }
00094 else if (itsLowPass5.getVal().compare("lp5optim") == 0)
00095 {
00096 itsImath.low_pass_5_x_dec_x_manybits = &c_intg_low_pass_5_x_dec_x_manybits;
00097 itsImath.low_pass_5_y_dec_y_manybits = &c_intg_low_pass_5_y_dec_y_manybits;
00098 itsImath.low_pass_5_x_dec_x_fewbits = &c_intg_low_pass_5_x_dec_x_fewbits_optim;
00099 itsImath.low_pass_5_y_dec_y_fewbits = &c_intg_low_pass_5_y_dec_y_fewbits_optim;
00100 }
00101 else
00102 {
00103 LFATAL("Invalid value for --%s; "
00104 "valid values are lp5std, lp5optim",
00105 itsLowPass5.getOptionDef()->longoptname);
00106 }
00107
00108 LINFO("Using lowpass5 algorithm '%s'",
00109 itsLowPass5.getVal().c_str());
00110 }
00111
00112 else if (param == &itsLowPass9)
00113 {
00114 if (itsLowPass9.getVal().compare("lp9std") == 0)
00115 {
00116 itsImath.low_pass_9_x_manybits = &c_intg_low_pass_9_x_manybits;
00117 itsImath.low_pass_9_y_manybits = &c_intg_low_pass_9_y_manybits;
00118 itsImath.low_pass_9_x_fewbits = &c_intg_low_pass_9_x_fewbits;
00119 itsImath.low_pass_9_y_fewbits = &c_intg_low_pass_9_y_fewbits;
00120 }
00121 else if (itsLowPass9.getVal().compare("lp9optim") == 0)
00122 {
00123 itsImath.low_pass_9_x_manybits = &c_intg_low_pass_9_x_manybits;
00124 itsImath.low_pass_9_y_manybits = &c_intg_low_pass_9_y_manybits;
00125 itsImath.low_pass_9_x_fewbits = &c_intg_low_pass_9_x_fewbits_optim;
00126 itsImath.low_pass_9_y_fewbits = &c_intg_low_pass_9_y_fewbits_optim;
00127 }
00128 else
00129 {
00130 LFATAL("Invalid value for --%s; "
00131 "valid values are lp9std, lp9optim",
00132 itsLowPass9.getOptionDef()->longoptname);
00133 }
00134
00135 LINFO("Using lowpass9 algorithm '%s'",
00136 itsLowPass9.getVal().c_str());
00137 }
00138
00139 }
00140
00141
00142
00143
00144
00145
00146
00147 #endif // CHANNELS_INTEGERMATHENGINE_C_DEFINED