Copiste  0.1
 All Classes Functions Variables Enumerations Friends Pages
filter.h
1 /*
2  * This file is part of Copiste.
3  *
4  * Copiste is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Copiste is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Copiste. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 
19 #ifndef INCLUDED_FILTERH
20 #define INCLUDED_FILTERH
21 
22 #include "features/extractor.h"
23 #include <vector>
24 
25 using namespace std;
26 
28 class Filter : public FeatureExtractor
29 {
30  public:
32  Filter() : mExtr(0) { ; }
33 
35  virtual ~Filter() { ; }
36 
39 
45  bool extract(std::deque<uint16_t> data, int size = 0);
46 
48  virtual void transform(vector<float> data) = 0;
49 
51  virtual float min()
52  {
53  return (mExtr ? mExtr->min() : 0);
54  }
55 
57  virtual float max()
58  {
59  return (mExtr ? mExtr->max() : 1);
60  }
61 
62  protected:
64  virtual void parentChanged() { ; }
65 
68 };
69 
70 #endif
71