comparison layer/SpectrogramLayer.h @ 1104:46cc4644206d spectrogram-minor-refactor

Convert ColumnNormalization to an enum class, and separate out normalize-visible
author Chris Cannam
date Thu, 14 Jul 2016 16:12:05 +0100
parents d84a0033b305
children ea5ae9dd10ba
comparison
equal deleted inserted replaced
1103:d84a0033b305 1104:46cc4644206d
157 */ 157 */
158 void setBinDisplay(BinDisplay); 158 void setBinDisplay(BinDisplay);
159 BinDisplay getBinDisplay() const; 159 BinDisplay getBinDisplay() const;
160 160
161 /** 161 /**
162 * Specify the normalization mode for bin values. 162 * Specify the normalization mode for individual columns.
163 */ 163 */
164 void setNormalization(ColumnOp::Normalization); 164 void setNormalization(ColumnNormalization);
165 ColumnOp::Normalization getNormalization() const; 165 ColumnNormalization getNormalization() const;
166
167 /**
168 * Specify whether to normalize the visible area.
169 */
170 void setNormalizeVisibleArea(bool);
171 bool getNormalizeVisibleArea() const;
166 172
167 /** 173 /**
168 * Specify the colour map. See ColourMapper for the colour map 174 * Specify the colour map. See ColourMapper for the colour map
169 * values. 175 * values.
170 */ 176 */
245 int m_maxFrequency; 251 int m_maxFrequency;
246 int m_initialMaxFrequency; 252 int m_initialMaxFrequency;
247 ColourScale::Scale m_colourScale; 253 ColourScale::Scale m_colourScale;
248 int m_colourMap; 254 int m_colourMap;
249 QColor m_crosshairColour; 255 QColor m_crosshairColour;
250 BinScale m_binScale; 256 BinScale m_binScale;
251 BinDisplay m_binDisplay; 257 BinDisplay m_binDisplay;
252 ColumnOp::Normalization m_normalization; 258 ColumnNormalization m_normalization; // of individual columns
259 bool m_normalizeVisibleArea;
253 int m_lastEmittedZoomStep; 260 int m_lastEmittedZoomStep;
254 bool m_synchronous; 261 bool m_synchronous;
255 262
256 mutable bool m_haveDetailedScale; 263 mutable bool m_haveDetailedScale;
264
265 static ColourScale::Scale convertToColourScale(int value);
266 static int convertFromColourScale(ColourScale::Scale);
267 static std::pair<ColumnNormalization, bool> convertToColumnNorm(int value);
268 static int convertFromColumnNorm(ColumnNormalization norm, bool visible);
257 269
258 enum { NO_VALUE = 0 }; // colour index for unused pixels 270 enum { NO_VALUE = 0 }; // colour index for unused pixels
259 271
260 class Palette 272 class Palette
261 { 273 {