comparison layer/Colour3DPlotRenderer.cpp @ 1124:b71a0491d287 spectrogram-minor-refactor

Some notes on gain
author Chris Cannam
date Mon, 01 Aug 2016 11:31:53 +0100
parents 343887ac6766
children 50324fca1328
comparison
equal deleted inserted replaced
1123:343887ac6766 1124:b71a0491d287
349 349
350 //!!! this is in common with renderDrawBuffer - pull it out 350 //!!! this is in common with renderDrawBuffer - pull it out
351 351
352 // order: 352 // order:
353 // get column -> scale -> record extents -> 353 // get column -> scale -> record extents ->
354 // normalise -> peak pick -> apply display gain -> 354 // normalise -> peak pick -> apply display gain
355 // distribute/interpolate 355
356
357 ColumnOp::Column fullColumn = model->getColumn(sx); 356 ColumnOp::Column fullColumn = model->getColumn(sx);
358 357
359 ColumnOp::Column column = 358 ColumnOp::Column column =
360 vector<float>(fullColumn.data() + minbin, 359 vector<float>(fullColumn.data() + minbin,
361 fullColumn.data() + maxbin + 1); 360 fullColumn.data() + maxbin + 1);
371 // } 370 // }
372 371
373 if (m_params.binDisplay == BinDisplay::PeakBins) { 372 if (m_params.binDisplay == BinDisplay::PeakBins) {
374 preparedColumn = ColumnOp::peakPick(preparedColumn); 373 preparedColumn = ColumnOp::peakPick(preparedColumn);
375 } 374 }
375
376 // Display gain belongs to the colour scale and is
377 // applied by the colour scale object when mapping it
376 378
377 psx = sx; 379 psx = sx;
378 } 380 }
379 381
380 sv_frame_t fx = sx * modelResolution + modelStart; 382 sv_frame_t fx = sx * modelResolution + modelStart;
772 774
773 if (sx != psx) { 775 if (sx != psx) {
774 776
775 // order: 777 // order:
776 // get column -> scale -> record extents -> 778 // get column -> scale -> record extents ->
777 // normalise -> peak pick -> apply display gain -> 779 // normalise -> peak pick -> distribute/interpolate ->
778 // distribute/interpolate 780 // apply display gain
779 781
780 ColumnOp::Column fullColumn = sourceModel->getColumn(sx); 782 ColumnOp::Column fullColumn = sourceModel->getColumn(sx);
781 783
782 // cerr << "x " << x << ", sx " << sx << ", col height " << fullColumn.size() 784 // cerr << "x " << x << ", sx " << sx << ", col height " << fullColumn.size()
783 // << ", minbin " << minbin << ", maxbin " << maxbin << endl; 785 // << ", minbin " << minbin << ", maxbin " << maxbin << endl;
799 if (m_params.binDisplay == BinDisplay::PeakBins) { 801 if (m_params.binDisplay == BinDisplay::PeakBins) {
800 column = ColumnOp::peakPick(column); 802 column = ColumnOp::peakPick(column);
801 } 803 }
802 804
803 preparedColumn = 805 preparedColumn =
804 ColumnOp::distribute(column, //!!! gain? ColumnOp::applyGain(column, m_gain), 806 ColumnOp::distribute(column,
805 h, 807 h,
806 binfory, 808 binfory,
807 minbin, 809 minbin,
808 m_params.interpolate); 810 m_params.interpolate);
811
812 // Display gain belongs to the colour scale and is
813 // applied by the colour scale object when mapping it
809 814
810 psx = sx; 815 psx = sx;
811 } 816 }
812 817
813 if (sx == sx0) { 818 if (sx == sx0) {
935 //!!! fft scale if (m_colourScale != ColourScaleType::Phase) { 940 //!!! fft scale if (m_colourScale != ColourScaleType::Phase) {
936 // column = ColumnOp::fftScale(column, getFFTSize()); 941 // column = ColumnOp::fftScale(column, getFFTSize());
937 // } 942 // }
938 943
939 //!!! if (m_colourScale != ColourScaleType::Phase) { 944 //!!! if (m_colourScale != ColourScaleType::Phase) {
940 column = ColumnOp::normalize(column, m_params.normalization); 945 preparedColumn = ColumnOp::normalize
946 (column, m_params.normalization);
941 //!!! } 947 //!!! }
942 948
943 preparedColumn = column;
944 //!!! gain? preparedColumn = ColumnOp::applyGain(column, m_params.gain);
945
946 psx = sx; 949 psx = sx;
947 } 950 }
948 951
949 if (sx == sx0) { 952 if (sx == sx0) {
950 pixelPeakColumn = preparedColumn; 953 pixelPeakColumn = preparedColumn;