Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
1211:7a19738b9762 | 1212:a1ee3108d1d3 |
---|---|
46 | 46 |
47 class Colour3DPlotRenderer | 47 class Colour3DPlotRenderer |
48 { | 48 { |
49 public: | 49 public: |
50 struct Sources { | 50 struct Sources { |
51 Sources() : verticalBinLayer(0), source(0), peakCache(0), fft(0) { } | 51 Sources() : verticalBinLayer(0), source(0), fft(0) { } |
52 | 52 |
53 // These must all outlive this class | 53 // These must all outlive this class |
54 const VerticalBinLayer *verticalBinLayer; // always | 54 const VerticalBinLayer *verticalBinLayer; // always |
55 const DenseThreeDimensionalModel *source; // always | 55 const DenseThreeDimensionalModel *source; // always |
56 const Dense3DModelPeakCache *peakCache; // optionally | |
57 const FFTModel *fft; // optionally | 56 const FFTModel *fft; // optionally |
57 std::vector<Dense3DModelPeakCache *> peakCaches; // zero or more | |
58 }; | 58 }; |
59 | 59 |
60 struct Parameters { | 60 struct Parameters { |
61 Parameters() : | 61 Parameters() : |
62 colourScale(ColourScale::Parameters()), | 62 colourScale(ColourScale::Parameters()), |
278 int repaintWidth); | 278 int repaintWidth); |
279 | 279 |
280 int renderDrawBuffer(int w, int h, | 280 int renderDrawBuffer(int w, int h, |
281 const std::vector<int> &binforx, | 281 const std::vector<int> &binforx, |
282 const std::vector<double> &binfory, | 282 const std::vector<double> &binfory, |
283 bool usePeakCache, | 283 int peakCacheIndex, // -1 => don't use a peak cache |
284 bool rightToLeft, | 284 bool rightToLeft, |
285 bool timeConstrained); | 285 bool timeConstrained); |
286 | 286 |
287 int renderDrawBufferPeakFrequencies(const LayerGeometryProvider *v, | 287 int renderDrawBufferPeakFrequencies(const LayerGeometryProvider *v, |
288 int w, int h, | 288 int w, int h, |
304 | 304 |
305 QImage scaleDrawBufferImage(QImage source, int targetWidth, int targetHeight) | 305 QImage scaleDrawBufferImage(QImage source, int targetWidth, int targetHeight) |
306 const; | 306 const; |
307 | 307 |
308 ColumnOp::Column getColumn(int sx, int minbin, int nbins, | 308 ColumnOp::Column getColumn(int sx, int minbin, int nbins, |
309 bool usePeakCache) const; | 309 int peakCacheIndex) const; // -1 => don't use cache |
310 }; | 310 }; |
311 | 311 |
312 #endif | 312 #endif |
313 | 313 |