comparison data/model/FFTModel.h @ 497:b6dc6c7f402c

Various fixes: * Fix handling of HTTP redirects (avoiding crashes... I hope) * Fix failure to delete FFT models when a feature extraction model transformer was abandoned (also a cause of crashes in the past) * Fix deadlock when said transform was abandoned before its source model was ready because the session was being cleared (and so the source model would never be ready)
author Chris Cannam
date Fri, 28 Nov 2008 13:36:13 +0000
parents 1405f4a2caf3
children 55ad231c9db7
comparison
equal deleted inserted replaced
496:05383ee78f3e 497:b6dc6c7f402c
64 bool polar, 64 bool polar,
65 StorageAdviser::Criteria criteria = StorageAdviser::NoCriteria, 65 StorageAdviser::Criteria criteria = StorageAdviser::NoCriteria,
66 size_t fillFromColumn = 0); 66 size_t fillFromColumn = 0);
67 ~FFTModel(); 67 ~FFTModel();
68 68
69 float getMagnitudeAt(size_t x, size_t y) { 69 inline float getMagnitudeAt(size_t x, size_t y) {
70 return m_server->getMagnitudeAt(x << m_xshift, y << m_yshift); 70 return m_server->getMagnitudeAt(x << m_xshift, y << m_yshift);
71 } 71 }
72 float getNormalizedMagnitudeAt(size_t x, size_t y) { 72 inline float getNormalizedMagnitudeAt(size_t x, size_t y) {
73 return m_server->getNormalizedMagnitudeAt(x << m_xshift, y << m_yshift); 73 return m_server->getNormalizedMagnitudeAt(x << m_xshift, y << m_yshift);
74 } 74 }
75 float getMaximumMagnitudeAt(size_t x) { 75 inline float getMaximumMagnitudeAt(size_t x) {
76 return m_server->getMaximumMagnitudeAt(x << m_xshift); 76 return m_server->getMaximumMagnitudeAt(x << m_xshift);
77 } 77 }
78 float getPhaseAt(size_t x, size_t y) { 78 inline float getPhaseAt(size_t x, size_t y) {
79 return m_server->getPhaseAt(x << m_xshift, y << m_yshift); 79 return m_server->getPhaseAt(x << m_xshift, y << m_yshift);
80 } 80 }
81 void getValuesAt(size_t x, size_t y, float &real, float &imaginary) { 81 inline void getValuesAt(size_t x, size_t y, float &real, float &imaginary) {
82 m_server->getValuesAt(x << m_xshift, y << m_yshift, real, imaginary); 82 m_server->getValuesAt(x << m_xshift, y << m_yshift, real, imaginary);
83 } 83 }
84 bool isColumnAvailable(size_t x) const { 84 inline bool isColumnAvailable(size_t x) const {
85 return m_server->isColumnReady(x << m_xshift); 85 return m_server->isColumnReady(x << m_xshift);
86 } 86 }
87 87
88 float getMagnitudesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) { 88 inline float getMagnitudesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) {
89 return m_server->getMagnitudesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio()); 89 return m_server->getMagnitudesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio());
90 } 90 }
91 float getNormalizedMagnitudesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) { 91 inline float getNormalizedMagnitudesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) {
92 return m_server->getNormalizedMagnitudesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio()); 92 return m_server->getNormalizedMagnitudesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio());
93 } 93 }
94 float getPhasesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) { 94 inline float getPhasesAt(size_t x, float *values, size_t minbin = 0, size_t count = 0) {
95 return m_server->getPhasesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio()); 95 return m_server->getPhasesAt(x << m_xshift, values, minbin << m_yshift, count, getYRatio());
96 } 96 }
97 97
98 size_t getFillExtent() const { return m_server->getFillExtent(); } 98 inline size_t getFillExtent() const { return m_server->getFillExtent(); }
99 99
100 // DenseThreeDimensionalModel and Model methods: 100 // DenseThreeDimensionalModel and Model methods:
101 // 101 //
102 virtual size_t getWidth() const { 102 inline virtual size_t getWidth() const {
103 return m_server->getWidth() >> m_xshift; 103 return m_server->getWidth() >> m_xshift;
104 } 104 }
105 virtual size_t getHeight() const { 105 inline virtual size_t getHeight() const {
106 // If there is no y-shift, the server's height (based on its 106 // If there is no y-shift, the server's height (based on its
107 // fftsize/2 + 1) is correct. If there is a shift, then the 107 // fftsize/2 + 1) is correct. If there is a shift, then the
108 // server is using a larger fft size than we want, so we shift 108 // server is using a larger fft size than we want, so we shift
109 // it right as many times as necessary, but then we need to 109 // it right as many times as necessary, but then we need to
110 // re-add the "+1" part (because ((fftsize*2)/2 + 1) / 2 != 110 // re-add the "+1" part (because ((fftsize*2)/2 + 1) / 2 !=