comparison base/FFTCache.h @ 131:69d50575c52a

* Various fft server improvements, including the ability to pick out data from an existing fft cache at a smaller increment or larger fft size rather than recalculating it (if appropriate)
author Chris Cannam
date Thu, 29 Jun 2006 16:16:49 +0000
parents 4e38a29c13fc
children 0aafdda005ce
comparison
equal deleted inserted replaced
130:b290c43f01ec 131:69d50575c52a
45 45
46 // may modify argument arrays 46 // may modify argument arrays
47 virtual void setColumnAt(size_t x, float *reals, float *imags) = 0; 47 virtual void setColumnAt(size_t x, float *reals, float *imags) = 0;
48 48
49 virtual void suspend() { } 49 virtual void suspend() { }
50
51 bool isLocalPeak(size_t x, size_t y) const {
52 float mag = getMagnitudeAt(x, y);
53 if (y > 0 && mag < getMagnitudeAt(x, y - 1)) return false;
54 if (y < getHeight()-1 && mag < getMagnitudeAt(x, y + 1)) return false;
55 return true;
56 }
57 bool isOverThreshold(size_t x, size_t y, float threshold) const {
58 return getMagnitudeAt(x, y) > threshold;
59 }
60 50
61 protected: 51 protected:
62 FFTCache() { } 52 FFTCache() { }
63 }; 53 };
64 54