Mercurial > hg > svgui
comparison layer/Colour3DPlotLayer.cpp @ 471:72a080272a4e
* Change QMutex in Editable DTDM to a read/write lock
author | Chris Cannam |
---|---|
date | Mon, 26 Jan 2009 15:18:32 +0000 |
parents | 26d1ddc0ce96 |
children | 13e8edbffbd7 |
comparison
equal
deleted
inserted
replaced
470:26d1ddc0ce96 | 471:72a080272a4e |
---|---|
720 | 720 |
721 size_t modelStartBin = modelStart / modelResolution; | 721 size_t modelStartBin = modelStart / modelResolution; |
722 size_t modelEndBin = modelEnd / modelResolution; | 722 size_t modelEndBin = modelEnd / modelResolution; |
723 | 723 |
724 size_t cacheWidth = modelEndBin - modelStartBin + 1; | 724 size_t cacheWidth = modelEndBin - modelStartBin + 1; |
725 if (lastBin > modelEndBin) cacheWidth = lastBin - modelStartBin + 1; | |
725 size_t cacheHeight = m_model->getHeight(); | 726 size_t cacheHeight = m_model->getHeight(); |
726 | 727 |
727 if (m_cache && (m_cache->height() != int(cacheHeight))) { | 728 if (m_cache && (m_cache->height() != int(cacheHeight))) { |
728 delete m_cache; | 729 delete m_cache; |
729 delete m_peaksCache; | 730 delete m_peaksCache; |
1094 | 1095 |
1095 int x0 = rect.left(); | 1096 int x0 = rect.left(); |
1096 int x1 = rect.right() + 1; | 1097 int x1 = rect.right() + 1; |
1097 | 1098 |
1098 const int w = x1 - x0; // const so it can be used as array size below | 1099 const int w = x1 - x0; // const so it can be used as array size below |
1099 int h = v->height(); | 1100 int h = v->height(); // we always paint full height |
1100 int sh = m_model->getHeight(); | 1101 int sh = m_model->getHeight(); |
1101 | 1102 |
1102 int symin = m_miny; | 1103 int symin = m_miny; |
1103 int symax = m_maxy; | 1104 int symax = m_maxy; |
1104 if (symax <= symin) { | 1105 if (symax <= symin) { |
1160 | 1161 |
1161 if (sy0i == sy1i && sy0i == psy1i) { // same scan line as just computed | 1162 if (sy0i == sy1i && sy0i == psy1i) { // same scan line as just computed |
1162 goto copy; | 1163 goto copy; |
1163 } | 1164 } |
1164 | 1165 |
1165 memset(peaks, 0, w); | 1166 for (int x = 0; x < w; ++x) { |
1167 peaks[x] = 0; | |
1168 } | |
1166 | 1169 |
1167 for (int sy = sy0i; sy <= sy1i; ++sy) { | 1170 for (int sy = sy0i; sy <= sy1i; ++sy) { |
1168 | 1171 |
1169 if (sy < 0 || sy >= source->height()) continue; | 1172 if (sy < 0 || sy >= source->height()) continue; |
1170 | 1173 |