comparison layer/Colour3DPlotLayer.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
108 */ 108 */
109 void setBinScale(BinScale); 109 void setBinScale(BinScale);
110 BinScale getBinScale() const; 110 BinScale getBinScale() const;
111 111
112 /** 112 /**
113 * Specify the normalization mode for bin values. 113 * Specify the normalization mode for individual columns.
114 */ 114 */
115 void setNormalization(ColumnOp::Normalization); 115 void setNormalization(ColumnNormalization);
116 ColumnOp::Normalization getNormalization() const; 116 ColumnNormalization getNormalization() const;
117
118 /**
119 * Specify whether to normalize the visible area.
120 */
121 void setNormalizeVisibleArea(bool);
122 bool getNormalizeVisibleArea() const;
117 123
118 void setInvertVertical(bool i); 124 void setInvertVertical(bool i);
119 bool getInvertVertical() const; 125 bool getInvertVertical() const;
120 126
121 void setOpaque(bool i); 127 void setOpaque(bool i);
156 mutable QImage *m_peaksCache; 162 mutable QImage *m_peaksCache;
157 mutable int m_cacheValidStart; 163 mutable int m_cacheValidStart;
158 mutable int m_cacheValidEnd; 164 mutable int m_cacheValidEnd;
159 165
160 ColourScale::Scale m_colourScale; 166 ColourScale::Scale m_colourScale;
161 bool m_colourScaleSet; 167 bool m_colourScaleSet;
162 int m_colourMap; 168 int m_colourMap;
163 float m_gain; 169 float m_gain;
164 BinScale m_binScale; 170 BinScale m_binScale;
165 ColumnOp::Normalization m_normalization; 171 ColumnNormalization m_normalization; // of individual columns
166 bool m_invertVertical; 172 bool m_normalizeVisibleArea;
167 bool m_opaque; 173 bool m_invertVertical;
168 bool m_smooth; 174 bool m_opaque;
169 int m_peakResolution; 175 bool m_smooth;
176 int m_peakResolution;
170 177
171 // Minimum and maximum bin numbers visible within the view. We 178 // Minimum and maximum bin numbers visible within the view. We
172 // always snap to whole bins at view edges. 179 // always snap to whole bins at view edges.
173 int m_miny; 180 int m_miny;
174 int m_maxy; 181 int m_maxy;
175 182
176 bool m_synchronous; 183 bool m_synchronous;
184
185 static ColourScale::Scale convertToColourScale(int value);
186 static int convertFromColourScale(ColourScale::Scale);
187 static std::pair<ColumnNormalization, bool> convertToColumnNorm(int value);
188 static int convertFromColumnNorm(ColumnNormalization norm, bool visible);
177 189
178 mutable Dense3DModelPeakCache *m_peakCache; 190 mutable Dense3DModelPeakCache *m_peakCache;
179 const int m_peakCacheDivisor; 191 const int m_peakCacheDivisor;
180 Dense3DModelPeakCache *getPeakCache() const; 192 Dense3DModelPeakCache *getPeakCache() const;
181 193