comparison layer/Colour3DPlotRenderer.cpp @ 1131:ee98d587cd1a spectrogram-minor-refactor

Sensible vertical scale and hybrid normalisation range in colour 3d plot
author Chris Cannam
date Tue, 02 Aug 2016 09:58:41 +0100
parents dc4b8fd3fcb7
children b4b155cfd8b4
comparison
equal deleted inserted replaced
1130:dc4b8fd3fcb7 1131:ee98d587cd1a
28 28
29 #include "view/ViewManager.h" // for main model sample rate. Pity 29 #include "view/ViewManager.h" // for main model sample rate. Pity
30 30
31 #include <vector> 31 #include <vector>
32 32
33 #define DEBUG_COLOUR_PLOT_REPAINT 1 33 //#define DEBUG_COLOUR_PLOT_REPAINT 1
34 34
35 using namespace std; 35 using namespace std;
36 36
37 Colour3DPlotRenderer::RenderResult 37 Colour3DPlotRenderer::RenderResult
38 Colour3DPlotRenderer::render(const LayerGeometryProvider *v, QPainter &paint, QRect rect) 38 Colour3DPlotRenderer::render(const LayerGeometryProvider *v, QPainter &paint, QRect rect)
358 ColumnOp::Column column = 358 ColumnOp::Column column =
359 vector<float>(fullColumn.data() + minbin, 359 vector<float>(fullColumn.data() + minbin,
360 fullColumn.data() + maxbin + 1); 360 fullColumn.data() + maxbin + 1);
361 361
362 column = ColumnOp::applyGain(column, m_params.scaleFactor); 362 column = ColumnOp::applyGain(column, m_params.scaleFactor);
363
364 magRange.sample(column);
365 363
366 // if (m_colourScale != ColourScaleType::Phase) { 364 // if (m_colourScale != ColourScaleType::Phase) {
367 preparedColumn = ColumnOp::normalize(column, m_params.normalization); 365 preparedColumn = ColumnOp::normalize(column, m_params.normalization);
368 // } 366 // }
367
368 magRange.sample(preparedColumn);
369 369
370 if (m_params.binDisplay == BinDisplay::PeakBins) { 370 if (m_params.binDisplay == BinDisplay::PeakBins) {
371 preparedColumn = ColumnOp::peakPick(preparedColumn); 371 preparedColumn = ColumnOp::peakPick(preparedColumn);
372 } 372 }
373 373
786 vector<float>(fullColumn.data() + minbin, 786 vector<float>(fullColumn.data() + minbin,
787 fullColumn.data() + maxbin + 1); 787 fullColumn.data() + maxbin + 1);
788 788
789 column = ColumnOp::applyGain(column, m_params.scaleFactor); 789 column = ColumnOp::applyGain(column, m_params.scaleFactor);
790 790
791 magRange.sample(column);
792
793 // if (m_colourScale != ColourScaleType::Phase) { 791 // if (m_colourScale != ColourScaleType::Phase) {
794 column = ColumnOp::normalize(column, m_params.normalization); 792 column = ColumnOp::normalize(column, m_params.normalization);
795 // } 793 // }
794
795 magRange.sample(column);
796 796
797 if (m_params.binDisplay == BinDisplay::PeakBins) { 797 if (m_params.binDisplay == BinDisplay::PeakBins) {
798 column = ColumnOp::peakPick(column); 798 column = ColumnOp::peakPick(column);
799 } 799 }
800 800
930 ColumnOp::Column column = 930 ColumnOp::Column column =
931 vector<float>(fullColumn.data() + minbin, 931 vector<float>(fullColumn.data() + minbin,
932 fullColumn.data() + maxbin + 1); 932 fullColumn.data() + maxbin + 1);
933 933
934 column = ColumnOp::applyGain(column, m_params.scaleFactor); 934 column = ColumnOp::applyGain(column, m_params.scaleFactor);
935
936 magRange.sample(column);
937 935
938 //!!! if (m_colourScale != ColourScaleType::Phase) { 936 //!!! if (m_colourScale != ColourScaleType::Phase) {
939 preparedColumn = ColumnOp::normalize 937 preparedColumn = ColumnOp::normalize
940 (column, m_params.normalization); 938 (column, m_params.normalization);
941 //!!! } 939 //!!! }
940
941 magRange.sample(preparedColumn);
942 942
943 psx = sx; 943 psx = sx;
944 } 944 }
945 945
946 if (sx == sx0) { 946 if (sx == sx0) {