comparison data/fileio/FFTFuzzyAdapter.h @ 936:0c1d6de8f44b

Merge from branch warnfix_no_size_t
author Chris Cannam
date Wed, 18 Jun 2014 13:51:16 +0100
parents 59e7fe1b1003
children
comparison
equal deleted inserted replaced
917:49618f39ff09 936:0c1d6de8f44b
22 { 22 {
23 public: 23 public:
24 FFTFuzzyAdapter(const DenseTimeValueModel *model, 24 FFTFuzzyAdapter(const DenseTimeValueModel *model,
25 int channel, 25 int channel,
26 WindowType windowType, 26 WindowType windowType,
27 size_t windowSize, 27 int windowSize,
28 size_t windowIncrement, 28 int windowIncrement,
29 size_t fftSize, 29 int fftSize,
30 bool polar, 30 bool polar,
31 size_t fillFromColumn = 0); 31 int fillFromColumn = 0);
32 ~FFTFuzzyAdapter(); 32 ~FFTFuzzyAdapter();
33 33
34 size_t getWidth() const { 34 int getWidth() const {
35 return m_server->getWidth() >> m_xshift; 35 return m_server->getWidth() >> m_xshift;
36 } 36 }
37 size_t getHeight() const { 37 int getHeight() const {
38 return m_server->getHeight() >> m_yshift; 38 return m_server->getHeight() >> m_yshift;
39 } 39 }
40 float getMagnitudeAt(size_t x, size_t y) { 40 float getMagnitudeAt(int x, int y) {
41 return m_server->getMagnitudeAt(x << m_xshift, y << m_yshift); 41 return m_server->getMagnitudeAt(x << m_xshift, y << m_yshift);
42 } 42 }
43 float getNormalizedMagnitudeAt(size_t x, size_t y) { 43 float getNormalizedMagnitudeAt(int x, int y) {
44 return m_server->getNormalizedMagnitudeAt(x << m_xshift, y << m_yshift); 44 return m_server->getNormalizedMagnitudeAt(x << m_xshift, y << m_yshift);
45 } 45 }
46 float getMaximumMagnitudeAt(size_t x) { 46 float getMaximumMagnitudeAt(int x) {
47 return m_server->getMaximumMagnitudeAt(x << m_xshift); 47 return m_server->getMaximumMagnitudeAt(x << m_xshift);
48 } 48 }
49 float getPhaseAt(size_t x, size_t y) { 49 float getPhaseAt(int x, int y) {
50 return m_server->getPhaseAt(x << m_xshift, y << m_yshift); 50 return m_server->getPhaseAt(x << m_xshift, y << m_yshift);
51 } 51 }
52 void getValuesAt(size_t x, size_t y, float &real, float &imaginary) { 52 void getValuesAt(int x, int y, float &real, float &imaginary) {
53 m_server->getValuesAt(x << m_xshift, y << m_yshift, real, imaginary); 53 m_server->getValuesAt(x << m_xshift, y << m_yshift, real, imaginary);
54 } 54 }
55 bool isColumnReady(size_t x) { 55 bool isColumnReady(int x) {
56 return m_server->isColumnReady(x << m_xshift); 56 return m_server->isColumnReady(x << m_xshift);
57 } 57 }
58 bool isLocalPeak(size_t x, size_t y) { 58 bool isLocalPeak(int x, int y) {
59 float mag = getMagnitudeAt(x, y); 59 float mag = getMagnitudeAt(x, y);
60 if (y > 0 && mag < getMagnitudeAt(x, y - 1)) return false; 60 if (y > 0 && mag < getMagnitudeAt(x, y - 1)) return false;
61 if (y < getHeight() - 1 && mag < getMagnitudeAt(x, y + 1)) return false; 61 if (y < getHeight() - 1 && mag < getMagnitudeAt(x, y + 1)) return false;
62 return true; 62 return true;
63 } 63 }
64 bool isOverThreshold(size_t x, size_t y, float threshold) { 64 bool isOverThreshold(int x, int y, float threshold) {
65 return getMagnitudeAt(x, y) > threshold; 65 return getMagnitudeAt(x, y) > threshold;
66 } 66 }
67 67
68 size_t getFillCompletion() const { return m_server->getFillCompletion(); } 68 int getFillCompletion() const { return m_server->getFillCompletion(); }
69 size_t getFillExtent() const { return m_server->getFillExtent(); } 69 int getFillExtent() const { return m_server->getFillExtent(); }
70 70
71 private: 71 private:
72 FFTFuzzyAdapter(const FFTFuzzyAdapter &); // not implemented 72 FFTFuzzyAdapter(const FFTFuzzyAdapter &); // not implemented
73 FFTFuzzyAdapter &operator=(const FFTFuzzyAdapter &); // not implemented 73 FFTFuzzyAdapter &operator=(const FFTFuzzyAdapter &); // not implemented
74 74