Mercurial > hg > svgui
diff layer/Colour3DPlotRenderer.cpp @ 1364:7d28e7522dbd
Add show-derivative option but, like inverting the colour scale, I don't think it's as useful as I'd hoped
author | Chris Cannam |
---|---|
date | Tue, 30 Oct 2018 15:32:01 +0000 |
parents | d79e21855aef |
children | 79032214f79d |
line wrap: on
line diff
--- a/layer/Colour3DPlotRenderer.cpp Tue Oct 30 14:00:20 2018 +0000 +++ b/layer/Colour3DPlotRenderer.cpp Tue Oct 30 15:32:01 2018 +0000 @@ -353,8 +353,6 @@ Colour3DPlotRenderer::getColumn(int sx, int minbin, int nbins, int peakCacheIndex) const { - Profiler profiler("Colour3DPlotRenderer::getColumn"); - // order: // get column -> scale -> normalise -> record extents -> // peak pick -> distribute/interpolate -> apply display gain @@ -363,7 +361,38 @@ // get column -> scale -> normalise ColumnOp::Column column; - + + if (m_params.showDerivative && sx > 0) { + + auto prev = getColumnRaw(sx - 1, minbin, nbins, peakCacheIndex); + column = getColumnRaw(sx, minbin, nbins, peakCacheIndex); + + for (int i = 0; i < nbins; ++i) { + column[i] -= prev[i]; + } + + } else { + column = getColumnRaw(sx, minbin, nbins, peakCacheIndex); + } + + if (m_params.colourScale.getScale() == ColourScaleType::Phase && + m_sources.fft) { + return column; + } else { + column = ColumnOp::applyGain(column, m_params.scaleFactor); + column = ColumnOp::normalize(column, m_params.normalization); + return column; + } +} + +ColumnOp::Column +Colour3DPlotRenderer::getColumnRaw(int sx, int minbin, int nbins, + int peakCacheIndex) const +{ + Profiler profiler("Colour3DPlotRenderer::getColumn"); + + ColumnOp::Column column; + if (m_params.colourScale.getScale() == ColourScaleType::Phase && m_sources.fft) { @@ -382,10 +411,6 @@ column = vector<float>(fullColumn.data() + minbin, fullColumn.data() + minbin + nbins); - - column = ColumnOp::applyGain(column, m_params.scaleFactor); - - column = ColumnOp::normalize(column, m_params.normalization); } return column;