Mercurial > hg > svgui
comparison layer/Colour3DPlotRenderer.cpp @ 1217:51b6381fc413
Make getPreferredPeakCache check the render mode itself
author | Chris Cannam |
---|---|
date | Fri, 13 Jan 2017 15:37:07 +0000 |
parents | be42a33a3db6 |
children | 4f1f3e1a4f63 |
comparison
equal
deleted
inserted
replaced
1216:dc2af6616c83 | 1217:51b6381fc413 |
---|---|
502 peakCacheIndex = -1; | 502 peakCacheIndex = -1; |
503 binsPerPeak = -1; | 503 binsPerPeak = -1; |
504 | 504 |
505 const DenseThreeDimensionalModel *model = m_sources.source; | 505 const DenseThreeDimensionalModel *model = m_sources.source; |
506 if (!model) return; | 506 if (!model) return; |
507 if (m_params.binDisplay == BinDisplay::PeakFrequencies) return; | |
508 if (m_params.colourScale.getScale() == ColourScaleType::Phase) return; | |
507 | 509 |
508 int zoomLevel = v->getZoomLevel(); | 510 int zoomLevel = v->getZoomLevel(); |
509 int binResolution = model->getResolution(); | 511 int binResolution = model->getResolution(); |
510 | 512 |
511 for (int ix = 0; in_range_for(m_sources.peakCaches, ix); ++ix) { | 513 for (int ix = 0; in_range_for(m_sources.peakCaches, ix); ++ix) { |
567 } | 569 } |
568 | 570 |
569 int peakCacheIndex = -1; | 571 int peakCacheIndex = -1; |
570 int binsPerPeak = -1; | 572 int binsPerPeak = -1; |
571 | 573 |
572 if (m_params.colourScale.getScale() != ColourScaleType::Phase) { | 574 getPreferredPeakCache(v, peakCacheIndex, binsPerPeak); |
573 getPreferredPeakCache(v, peakCacheIndex, binsPerPeak); | |
574 } | |
575 | 575 |
576 for (int y = 0; y < h; ++y) { | 576 for (int y = 0; y < h; ++y) { |
577 binfory[y] = m_sources.verticalBinLayer->getBinForY(v, h - y - 1); | 577 binfory[y] = m_sources.verticalBinLayer->getBinForY(v, h - y - 1); |
578 } | 578 } |
579 | 579 |
1044 (double(minbin) * fft->getSampleRate()) / fft->getFFTSize(); | 1044 (double(minbin) * fft->getSampleRate()) / fft->getFFTSize(); |
1045 double maxFreq = | 1045 double maxFreq = |
1046 (double(minbin + nbins - 1) * fft->getSampleRate()) / fft->getFFTSize(); | 1046 (double(minbin + nbins - 1) * fft->getSampleRate()) / fft->getFFTSize(); |
1047 | 1047 |
1048 bool logarithmic = (m_params.binScale == BinScale::Log); | 1048 bool logarithmic = (m_params.binScale == BinScale::Log); |
1049 | 1049 |
1050 for (int x = start; x != finish; x += step) { | 1050 for (int x = start; x != finish; x += step) { |
1051 | 1051 |
1052 // x is the on-canvas pixel coord; sx (later) will be the | 1052 // x is the on-canvas pixel coord; sx (later) will be the |
1053 // source column index | 1053 // source column index |
1054 | 1054 |