Mercurial > hg > svcore
comparison data/fft/FFTDataServer.cpp @ 556:53e5dc8439e7
* get whole columns at a time from fft model when running transform
author | Chris Cannam |
---|---|
date | Mon, 09 Feb 2009 11:53:29 +0000 |
parents | 107d3f3705c9 |
children | dfc4dd561bb6 |
comparison
equal
deleted
inserted
replaced
555:8accc7969c1c | 556:53e5dc8439e7 |
---|---|
1081 | 1081 |
1082 cache->getValuesAt(col, y, real, imaginary); | 1082 cache->getValuesAt(col, y, real, imaginary); |
1083 } | 1083 } |
1084 | 1084 |
1085 bool | 1085 bool |
1086 FFTDataServer::getValuesAt(size_t x, float *reals, float *imaginaries, size_t minbin, size_t count, size_t step) | |
1087 { | |
1088 Profiler profiler("FFTDataServer::getValuesAt", false); | |
1089 | |
1090 if (x >= m_width) return false; | |
1091 | |
1092 if (minbin >= m_height) minbin = m_height - 1; | |
1093 if (count == 0) count = (m_height - minbin) / step; | |
1094 else if (minbin + count * step > m_height) { | |
1095 count = (m_height - minbin) / step; | |
1096 } | |
1097 | |
1098 size_t col; | |
1099 FFTCacheReader *cache = getCacheReader(x, col); | |
1100 if (!cache) return false; | |
1101 | |
1102 //!!! n.b. can throw | |
1103 if (!cache->haveSetColumnAt(col)) { | |
1104 Profiler profiler("FFTDataServer::getValuesAt: filling"); | |
1105 fillColumn(x); | |
1106 } | |
1107 | |
1108 for (size_t i = 0; i < count; ++i) { | |
1109 cache->getValuesAt(col, i * step + minbin, reals[i], imaginaries[i]); | |
1110 } | |
1111 | |
1112 return true; | |
1113 } | |
1114 | |
1115 bool | |
1086 FFTDataServer::isColumnReady(size_t x) | 1116 FFTDataServer::isColumnReady(size_t x) |
1087 { | 1117 { |
1088 Profiler profiler("FFTDataServer::isColumnReady", false); | 1118 Profiler profiler("FFTDataServer::isColumnReady", false); |
1089 | 1119 |
1090 if (x >= m_width) return true; | 1120 if (x >= m_width) return true; |