comparison layer/WaveformLayer.h @ 1367:f5566f7271fe waverevision

Rework waveform renderer to use smooth paths, aiming to get near-pixel-identical results when zoomed out far enough for a single path not to be relevant
author Chris Cannam
date Wed, 31 Oct 2018 15:06:32 +0000
parents fc3c9971a43a
children 694004228ab7
comparison
equal deleted inserted replaced
1366:c2a3ac0a6688 1367:f5566f7271fe
85 * The default is to display means. 85 * The default is to display means.
86 */ 86 */
87 void setShowMeans(bool); 87 void setShowMeans(bool);
88 bool getShowMeans() const { return m_showMeans; } 88 bool getShowMeans() const { return m_showMeans; }
89 89
90 /**
91 * Set whether to use shades of grey (or of the base colour) to
92 * provide additional perceived vertical resolution (i.e. using
93 * half-filled pixels to represent levels that only just meet the
94 * pixel unit boundary). This provides a small improvement in
95 * waveform quality at a small cost in rendering speed.
96 *
97 * The default is to use greyscale.
98 */
99 void setUseGreyscale(bool);
100 bool getUseGreyscale() const { return m_greyscale; }
101
102
103 enum ChannelMode { SeparateChannels, MixChannels, MergeChannels }; 90 enum ChannelMode { SeparateChannels, MixChannels, MergeChannels };
104 91
105 /** 92 /**
106 * Specify whether multi-channel audio data should be displayed 93 * Specify whether multi-channel audio data should be displayed
107 * with a separate axis per channel (SeparateChannels), with a 94 * with a separate axis per channel (SeparateChannels), with a
203 virtual void setVerticalZoomStep(int); 190 virtual void setVerticalZoomStep(int);
204 191
205 virtual bool canExistWithoutModel() const { return true; } 192 virtual bool canExistWithoutModel() const { return true; }
206 193
207 protected: 194 protected:
208 int dBscale(double sample, int m) const; 195 double dBscale(double sample, int m) const;
209 196
210 const RangeSummarisableTimeValueModel *m_model; // I do not own this 197 const RangeSummarisableTimeValueModel *m_model; // I do not own this
211 198
212 typedef std::vector<RangeSummarisableTimeValueModel::RangeBlock> RangeVec; 199 typedef std::vector<RangeSummarisableTimeValueModel::RangeBlock> RangeVec;
213 200
245 virtual void flagBaseColourChanged() { m_cacheValid = false; } 232 virtual void flagBaseColourChanged() { m_cacheValid = false; }
246 233
247 float m_gain; 234 float m_gain;
248 bool m_autoNormalize; 235 bool m_autoNormalize;
249 bool m_showMeans; 236 bool m_showMeans;
250 bool m_greyscale;
251 ChannelMode m_channelMode; 237 ChannelMode m_channelMode;
252 int m_channel; 238 int m_channel;
253 Scale m_scale; 239 Scale m_scale;
254 double m_middleLineHeight; 240 double m_middleLineHeight;
255 bool m_aggressive; 241 bool m_aggressive;