diff layer/SpectrogramLayer.h @ 1137:4e7ed3252d80 spectrogram-minor-refactor

Re-implement dB^2 (log-power) spectrogram setting
author Chris Cannam
date Thu, 04 Aug 2016 11:26:11 +0100
parents 9ff838a64461
children 8f4634b82e36
line wrap: on
line diff
--- a/layer/SpectrogramLayer.h	Wed Aug 03 16:16:23 2016 +0100
+++ b/layer/SpectrogramLayer.h	Thu Aug 04 11:26:11 2016 +0100
@@ -145,6 +145,13 @@
     ColourScaleType getColourScale() const;
 
     /**
+     * Specify multiple factor for colour scale. This is 2.0 for
+     * log-power spectrogram and 1.0 otherwise.
+     */
+    void setColourScaleMultiple(double);
+    double getColourScaleMultiple() const;
+    
+    /**
      * Specify the scale for the y axis.
      */
     void setBinScale(BinScale);
@@ -249,6 +256,7 @@
     int                 m_maxFrequency;
     int                 m_initialMaxFrequency;
     ColourScaleType     m_colourScale;
+    double              m_colourScaleMultiple;
     int                 m_colourMap;
     QColor              m_crosshairColour;
     BinScale            m_binScale;
@@ -260,8 +268,8 @@
 
     mutable bool        m_haveDetailedScale;
 
-    static ColourScaleType convertToColourScale(int value);
-    static int convertFromColourScale(ColourScaleType);
+    static std::pair<ColourScaleType, double> convertToColourScale(int value);
+    static int convertFromColourScale(ColourScaleType type, double multiple);
     static std::pair<ColumnNormalization, bool> convertToColumnNorm(int value);
     static int convertFromColumnNorm(ColumnNormalization norm, bool visible);