Chris@1071
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@1071
|
2
|
Chris@1071
|
3 /*
|
Chris@1071
|
4 Sonic Visualiser
|
Chris@1071
|
5 An audio file viewer and annotation editor.
|
Chris@1071
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@1071
|
7 This file copyright 2006-2016 Chris Cannam and QMUL.
|
Chris@1071
|
8
|
Chris@1071
|
9 This program is free software; you can redistribute it and/or
|
Chris@1071
|
10 modify it under the terms of the GNU General Public License as
|
Chris@1071
|
11 published by the Free Software Foundation; either version 2 of the
|
Chris@1071
|
12 License, or (at your option) any later version. See the file
|
Chris@1071
|
13 COPYING included with this distribution for more information.
|
Chris@1071
|
14 */
|
Chris@1071
|
15
|
Chris@1071
|
16 #ifndef COLOUR_3D_PLOT_RENDERER_H
|
Chris@1071
|
17 #define COLOUR_3D_PLOT_RENDERER_H
|
Chris@1071
|
18
|
Chris@1071
|
19 #include "ColourScale.h"
|
Chris@1071
|
20
|
Chris@1071
|
21 #include "base/ColumnOp.h"
|
Chris@1071
|
22
|
Chris@1071
|
23 class DenseThreeDimensionalModel;
|
Chris@1071
|
24 class Dense3DModelPeakCache;
|
Chris@1071
|
25 class FFTModel;
|
Chris@1071
|
26
|
Chris@1072
|
27 // We will have one of these per view, for each layer
|
Chris@1072
|
28
|
Chris@1071
|
29 class Colour3DPlotRenderer
|
Chris@1071
|
30 {
|
Chris@1071
|
31 public:
|
Chris@1071
|
32 enum BinDisplay {
|
Chris@1071
|
33 AllBins,
|
Chris@1071
|
34 PeakBins,
|
Chris@1071
|
35 PeakFrequencies
|
Chris@1071
|
36 };
|
Chris@1071
|
37
|
Chris@1071
|
38 enum BinScale {
|
Chris@1071
|
39 LinearBinScale,
|
Chris@1071
|
40 LogBinScale
|
Chris@1071
|
41 };
|
Chris@1071
|
42
|
Chris@1071
|
43 struct Parameters {
|
Chris@1071
|
44
|
Chris@1071
|
45 Parameters() :
|
Chris@1071
|
46 source(0), peaks(0), fft(0),
|
Chris@1071
|
47 colourScale(ColourScale::Parameters()),
|
Chris@1071
|
48 normalization(ColumnOp::NoNormalization),
|
Chris@1071
|
49 binDisplay(AllBins), binScale(LinearBinScale),
|
Chris@1071
|
50 alwaysOpaque(false), interpolate(false), invertVertical(false) { }
|
Chris@1071
|
51
|
Chris@1071
|
52 DenseThreeDimensionalModel *source; // always
|
Chris@1071
|
53 Dense3DModelPeakCache *peaks; // optionally
|
Chris@1071
|
54 FFTModel *fft; // optionally
|
Chris@1071
|
55
|
Chris@1071
|
56 ColourScale colourScale; // complete ColourScale object by value
|
Chris@1071
|
57 ColumnOp::Normalization normalization;
|
Chris@1071
|
58 BinDisplay binDisplay;
|
Chris@1071
|
59 BinScale binScale;
|
Chris@1071
|
60 bool alwaysOpaque;
|
Chris@1071
|
61 bool interpolate;
|
Chris@1071
|
62 bool invertVertical;
|
Chris@1071
|
63 };
|
Chris@1071
|
64
|
Chris@1071
|
65 Colour3DPlotRenderer(Parameters parameters) :
|
Chris@1071
|
66 m_params(parameters)
|
Chris@1071
|
67 { }
|
Chris@1071
|
68
|
Chris@1071
|
69 private:
|
Chris@1071
|
70 Parameters m_params;
|
Chris@1072
|
71
|
Chris@1072
|
72 //!!! we do not have the ScrollableImageCache here; in
|
Chris@1072
|
73 //!!! SpectrogramLayer terms we render onto the draw buffer
|
Chris@1072
|
74
|
Chris@1072
|
75 //!!! fft model scaling?
|
Chris@1072
|
76
|
Chris@1072
|
77 //!!! should we own the Dense3DModelPeakCache here? or should it persist
|
Chris@1071
|
78 };
|
Chris@1071
|
79
|
Chris@1071
|
80 #endif
|
Chris@1071
|
81
|