SMSMorph.hxx
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 #ifndef _SMSMorph_
00023 #define _SMSMorph_
00024
00025 #include "SMSMorphConfig.hxx"
00026
00027 #include "Processing.hxx"
00028 #include "Frame.hxx"
00029 #include "InPort.hxx"
00030 #include "OutPort.hxx"
00031 #include "InControl.hxx"
00032 #include "SpectrumInterpolator.hxx"
00033 #include "SpectralPeakArrayInterpolator.hxx"
00034
00035
00036 namespace CLAM{
00037
00042 class SMSMorph: public Processing
00043 {
00044 const char *GetClassName() const {return "SMSMorph";}
00045
00046 InPort<SpectralPeakArray> mInPeaks1;
00047 InPort<Fundamental> mInFund1;
00048 InPort<Spectrum> mInSpectrum1;
00049
00050 InPort<SpectralPeakArray> mInPeaks2;
00051 InPort<Fundamental> mInFund2;
00052 InPort<Spectrum> mInSpectrum2;
00053
00054
00055
00056 OutPort<SpectralPeakArray> mOutPeaks;
00057 OutPort<Fundamental> mOutFund;
00058 OutPort<Spectrum> mOutSpectrum;
00059
00063 FloatInControl mInterpolationFactor;
00064
00065 public:
00066 SMSMorph()
00067 :
00068 mInPeaks1("In SpectralPeaks 1", this),
00069 mInFund1("In Fundamental 1", this),
00070 mInSpectrum1("In Spectrum 1", this),
00071
00072 mInPeaks2("In SpectralPeaks 2", this),
00073 mInFund2("In Fundamental 2", this),
00074 mInSpectrum2("In Spectrum 2", this),
00075
00076 mOutPeaks("Out SpectralPeaks", this),
00077 mOutFund("Out Fundamental", this),
00078 mOutSpectrum("Out Spectrum", this),
00079
00080 mInterpolationFactor("Interpolation Factor", this)
00081 {
00082 Configure( mConfig );
00083 }
00084
00085 ~SMSMorph() {}
00086
00087 bool Do()
00088 {
00089 bool result = Do(mInPeaks1.GetData(),
00090 mInFund1.GetData(),
00091 mInSpectrum1.GetData(),
00092 mInPeaks2.GetData(),
00093 mInFund2.GetData(),
00094 mInSpectrum2.GetData(),
00095 mOutPeaks.GetData(),
00096 mOutFund.GetData(),
00097 mOutSpectrum.GetData()
00098 );
00099
00100 mInPeaks1.Consume();
00101 mInFund1.Consume();
00102 mInSpectrum1.Consume();
00103
00104 mInPeaks2.Consume();
00105 mInFund2.Consume();
00106 mInSpectrum2.Consume();
00107
00108 mOutPeaks.Produce();
00109 mOutFund.Produce();
00110 mOutSpectrum.Produce();
00111
00112 return result;
00113 }
00114
00115 bool Do(const SpectralPeakArray& inPeaks1,
00116 const Fundamental& inFund1,
00117 const Spectrum& inSpectrum1,
00118 const SpectralPeakArray& inPeaks2,
00119 const Fundamental& inFund2,
00120 const Spectrum& inSpectrum2,
00121 SpectralPeakArray& outPeaks,
00122 Fundamental& outFund,
00123 Spectrum& outSpectrum
00124 );
00125
00126
00127 bool Do(const Frame& in1, const Frame& in2, Frame& out);
00128
00129 typedef SMSMorphConfig Config;
00130
00131 const ProcessingConfig& GetConfig() const
00132 {
00133 return mConfig;
00134 }
00135
00136 private:
00137 Config mConfig;
00138
00139 protected:
00140 bool ConcreteConfigure(const ProcessingConfig& c);
00141
00142
00144 SpectrumInterpolator mSpectrumInterpolator;
00145 SpectralPeakArrayInterpolator mPeaksInterpolator;
00146
00147 };
00148 };
00149
00150 #endif // _SMSMorph_
00151