Mercurial > hg > svgui
diff layer/Colour3DPlotRenderer.h @ 1212:a1ee3108d1d3 3.0-integration
Make the colour 3d plot renderer able to support more than one level of peak cache; introduce a second "peak" cache for the spectrogram layer that actually has a 1-1 column relationship with the underlying FFT model, and use it in addition to the existing peak cache if memory is plentiful. Makes spectrograms appear much faster in many common situations.
author | Chris Cannam |
---|---|
date | Thu, 05 Jan 2017 14:02:54 +0000 |
parents | 236ecb2c0758 |
children | 34df6ff25472 |
line wrap: on
line diff
--- a/layer/Colour3DPlotRenderer.h Thu Jan 05 11:10:57 2017 +0000 +++ b/layer/Colour3DPlotRenderer.h Thu Jan 05 14:02:54 2017 +0000 @@ -48,13 +48,13 @@ { public: struct Sources { - Sources() : verticalBinLayer(0), source(0), peakCache(0), fft(0) { } + Sources() : verticalBinLayer(0), source(0), fft(0) { } // These must all outlive this class const VerticalBinLayer *verticalBinLayer; // always const DenseThreeDimensionalModel *source; // always - const Dense3DModelPeakCache *peakCache; // optionally const FFTModel *fft; // optionally + std::vector<Dense3DModelPeakCache *> peakCaches; // zero or more }; struct Parameters { @@ -280,7 +280,7 @@ int renderDrawBuffer(int w, int h, const std::vector<int> &binforx, const std::vector<double> &binfory, - bool usePeakCache, + int peakCacheIndex, // -1 => don't use a peak cache bool rightToLeft, bool timeConstrained); @@ -306,7 +306,7 @@ const; ColumnOp::Column getColumn(int sx, int minbin, int nbins, - bool usePeakCache) const; + int peakCacheIndex) const; // -1 => don't use cache }; #endif