comparison layer/SpectrogramLayer.h @ 197:6b023411087b

* Work on harmonising colour and scale ranges between types of layer * Add normalize options to colour 3d plot layer
author Chris Cannam
date Thu, 01 Feb 2007 14:31:28 +0000
parents 22c99c8aa1e0
children 748985c7e2c1
comparison
equal deleted inserted replaced
196:22c99c8aa1e0 197:6b023411087b
168 bool getNormalizeColumns() const; 168 bool getNormalizeColumns() const;
169 169
170 void setNormalizeVisibleArea(bool n); 170 void setNormalizeVisibleArea(bool n);
171 bool getNormalizeVisibleArea() const; 171 bool getNormalizeVisibleArea() const;
172 172
173 void setColourScheme(int scheme); 173 void setColourMap(int map);
174 int getColourScheme() const; 174 int getColourMap() const;
175 175
176 /** 176 /**
177 * Specify the colourmap rotation for the colour scale. 177 * Specify the colourmap rotation for the colour scale.
178 */ 178 */
179 void setColourRotation(int); 179 void setColourRotation(int);
236 int m_colourRotation; 236 int m_colourRotation;
237 size_t m_minFrequency; 237 size_t m_minFrequency;
238 size_t m_maxFrequency; 238 size_t m_maxFrequency;
239 size_t m_initialMaxFrequency; 239 size_t m_initialMaxFrequency;
240 ColourScale m_colourScale; 240 ColourScale m_colourScale;
241 int m_colourScheme; 241 int m_colourMap;
242 QColor m_crosshairColour; 242 QColor m_crosshairColour;
243 FrequencyScale m_frequencyScale; 243 FrequencyScale m_frequencyScale;
244 BinDisplay m_binDisplay; 244 BinDisplay m_binDisplay;
245 bool m_normalizeColumns; 245 bool m_normalizeColumns;
246 bool m_normalizeVisibleArea; 246 bool m_normalizeVisibleArea;
247 int m_lastEmittedZoomStep; 247 int m_lastEmittedZoomStep;
248 248
249 enum { NO_VALUE = 0 }; // colour index for unused pixels 249 enum { NO_VALUE = 0 }; // colour index for unused pixels
250 250
251 class ColourMap 251 class Palette
252 { 252 {
253 public: 253 public:
254 QColor getColour(unsigned char index) const { 254 QColor getColour(unsigned char index) const {
255 return m_colours[index]; 255 return m_colours[index];
256 } 256 }
261 261
262 private: 262 private:
263 QColor m_colours[256]; 263 QColor m_colours[256];
264 }; 264 };
265 265
266 ColourMap m_colourMap; 266 Palette m_palette;
267 267
268 struct PixmapCache 268 struct PixmapCache
269 { 269 {
270 QPixmap pixmap; 270 QPixmap pixmap;
271 QRect validArea; 271 QRect validArea;
281 mutable QTimer *m_updateTimer; 281 mutable QTimer *m_updateTimer;
282 282
283 mutable size_t m_candidateFillStartFrame; 283 mutable size_t m_candidateFillStartFrame;
284 bool m_exiting; 284 bool m_exiting;
285 285
286 void setColourmap(); 286 void initialisePalette();
287 void rotateColourmap(int distance); 287 void rotatePalette(int distance);
288 288
289 static float calculateFrequency(size_t bin, 289 static float calculateFrequency(size_t bin,
290 size_t windowSize, 290 size_t windowSize,
291 size_t windowIncrement, 291 size_t windowIncrement,
292 size_t sampleRate, 292 size_t sampleRate,