# HG changeset patch # User Chris Cannam # Date 1453469985 0 # Node ID 25ec2390fad33089796e599a87de25f97e5997ce # Parent 072f0db59081e069e5d9bb65692d94989201b6cf Convert 3d model column type from QVector to std::vector; replace another user of ResizeableBitset diff -r 072f0db59081 -r 25ec2390fad3 layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Thu Jan 21 09:28:57 2016 +0000 +++ b/layer/Colour3DPlotLayer.cpp Fri Jan 22 13:39:45 2016 +0000 @@ -938,22 +938,24 @@ Profiler profiler("Colour3DPlotLayer::getColumn"); DenseThreeDimensionalModel::Column values = m_model->getColumn(col); - while (values.size() < m_model->getHeight()) values.push_back(0.f); + values.resize(m_model->getHeight(), 0.f); if (!m_normalizeColumns && !m_normalizeHybrid) return values; double colMax = 0.f, colMin = 0.f; double min = 0.f, max = 0.f; + int nv = int(values.size()); + min = m_model->getMinimumLevel(); max = m_model->getMaximumLevel(); - for (int y = 0; y < values.size(); ++y) { + for (int y = 0; y < nv; ++y) { if (y == 0 || values.at(y) > colMax) colMax = values.at(y); if (y == 0 || values.at(y) < colMin) colMin = values.at(y); } if (colMin == colMax) colMax = colMin + 1; - for (int y = 0; y < values.size(); ++y) { + for (int y = 0; y < nv; ++y) { double value = values.at(y); double norm = (value - colMin) / (colMax - colMin); @@ -964,7 +966,7 @@ if (m_normalizeHybrid && (colMax > 0.0)) { double logmax = log10(colMax); - for (int y = 0; y < values.size(); ++y) { + for (int y = 0; y < nv; ++y) { values[y] = float(values[y] * logmax); } } @@ -1136,7 +1138,7 @@ double colMax = 0.f, colMin = 0.f; for (int y = 0; y < cacheHeight; ++y) { - if (y >= values.size()) break; + if (!in_range_for(values, y)) break; if (y == 0 || values[y] > colMax) colMax = values[y]; if (y == 0 || values[y] < colMin) colMin = values[y]; } @@ -1186,7 +1188,7 @@ for (int y = 0; y < cacheHeight; ++y) { double value = min; - if (y < values.size()) { + if (in_range_for(values, y)) { value = values.at(y); } diff -r 072f0db59081 -r 25ec2390fad3 layer/SpectrogramLayer.cpp --- a/layer/SpectrogramLayer.cpp Thu Jan 21 09:28:57 2016 +0000 +++ b/layer/SpectrogramLayer.cpp Fri Jan 22 13:39:45 2016 +0000 @@ -2602,7 +2602,7 @@ if (c[y] > columnMax) columnMax = c[y]; } } - values = c.constData() + minbin; + values = c.data() + minbin; } psx = sx; }