comparison data/model/Dense3DModelPeakCache.cpp @ 1190:f6998e304b36 spectrogram-minor-refactor

Comments and naming
author Chris Cannam
date Thu, 23 Jun 2016 14:43:00 +0100
parents 2dc27f0f97ad
children 6d09ad2ab21f
comparison
equal deleted inserted replaced
1189:63b73a21bccd 1190:f6998e304b36
18 #include "base/Profiler.h" 18 #include "base/Profiler.h"
19 19
20 Dense3DModelPeakCache::Dense3DModelPeakCache(DenseThreeDimensionalModel *source, 20 Dense3DModelPeakCache::Dense3DModelPeakCache(DenseThreeDimensionalModel *source,
21 int columnsPerPeak) : 21 int columnsPerPeak) :
22 m_source(source), 22 m_source(source),
23 m_resolution(columnsPerPeak) 23 m_columnsPerPeak(columnsPerPeak)
24 { 24 {
25 m_cache = new EditableDenseThreeDimensionalModel 25 m_cache = new EditableDenseThreeDimensionalModel
26 (source->getSampleRate(), 26 (source->getSampleRate(),
27 getResolution(), 27 getResolution(),
28 source->getHeight(), 28 source->getHeight(),
93 m_coverage.resize(column + 1, false); 93 m_coverage.resize(column + 1, false);
94 } 94 }
95 95
96 Column peak; 96 Column peak;
97 int n = 0; 97 int n = 0;
98 for (int i = 0; i < m_resolution; ++i) { 98 for (int i = 0; i < m_columnsPerPeak; ++i) {
99 Column here = m_source->getColumn(column * m_resolution + i); 99 Column here = m_source->getColumn(column * m_columnsPerPeak + i);
100 if (i == 0) { 100 if (i == 0) {
101 peak = here; 101 peak = here;
102 n = int(peak.size()); 102 n = int(peak.size());
103 } else { 103 } else {
104 int m = std::min(n, int(here.size())); 104 int m = std::min(n, int(here.size()));