Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 1141:f19dcb288123 spectrogram-minor-refactor
Minor tidy, + go back to opaque-only spectrogram as intended
author | Chris Cannam |
---|---|
date | Fri, 05 Aug 2016 13:48:14 +0100 |
parents | ca910d8070c8 |
children | 8f4634b82e36 |
comparison
equal
deleted
inserted
replaced
1140:ca910d8070c8 | 1141:f19dcb288123 |
---|---|
851 if (r < 0) r = 0; | 851 if (r < 0) r = 0; |
852 if (r > 256) r = 256; | 852 if (r > 256) r = 256; |
853 int distance = r - m_colourRotation; | 853 int distance = r - m_colourRotation; |
854 | 854 |
855 if (distance != 0) { | 855 if (distance != 0) { |
856 //!!! rotatePalette(-distance); | |
857 m_colourRotation = r; | 856 m_colourRotation = r; |
858 } | 857 } |
859 | 858 |
860 invalidateRenderers(); //!!! in theory we shouldn't have to do this... but... | 859 // Initially the idea with colour rotation was that we would just |
860 // rotate the palette of an already-generated cache. That's not | |
861 // really practical now that cacheing is handled in a separate | |
862 // class in which the main cache no longer has a palette. | |
863 invalidateRenderers(); | |
861 | 864 |
862 emit layerParametersChanged(); | 865 emit layerParametersChanged(); |
863 } | 866 } |
864 | 867 |
865 void | 868 void |
1001 } | 1004 } |
1002 | 1005 |
1003 Layer::setLayerDormant(v, true); | 1006 Layer::setLayerDormant(v, true); |
1004 | 1007 |
1005 invalidateRenderers(); | 1008 invalidateRenderers(); |
1006 | |
1007 //!!! in theory we should call invalidateFFTModel() if and | |
1008 //!!! only if there are no remaining views in which we are not | |
1009 //!!! dormant | |
1010 | 1009 |
1011 } else { | 1010 } else { |
1012 | 1011 |
1013 Layer::setLayerDormant(v, false); | 1012 Layer::setLayerDormant(v, false); |
1014 } | 1013 } |
1036 { | 1035 { |
1037 #ifdef DEBUG_SPECTROGRAM_REPAINT | 1036 #ifdef DEBUG_SPECTROGRAM_REPAINT |
1038 cerr << "SpectrogramLayer::cacheInvalid(" << from << ", " << to << ")" << endl; | 1037 cerr << "SpectrogramLayer::cacheInvalid(" << from << ", " << to << ")" << endl; |
1039 #endif | 1038 #endif |
1040 | 1039 |
1041 //!!! now in common with Colour3DPlotLayer: | |
1042 // We used to call invalidateMagnitudes(from, to) to invalidate | 1040 // We used to call invalidateMagnitudes(from, to) to invalidate |
1043 // only those caches whose views contained some of the (from, to) | 1041 // only those caches whose views contained some of the (from, to) |
1044 // range. That's the right thing to do; it has been lost in | 1042 // range. That's the right thing to do; it has been lost in |
1045 // pulling out the image cache code, but it might not matter very | 1043 // pulling out the image cache code, but it might not matter very |
1046 // much, since the underlying models for spectrogram layers don't | 1044 // much, since the underlying models for spectrogram layers don't |
1463 Colour3DPlotRenderer::Parameters params; | 1461 Colour3DPlotRenderer::Parameters params; |
1464 params.colourScale = ColourScale(cparams); | 1462 params.colourScale = ColourScale(cparams); |
1465 params.normalization = m_normalization; | 1463 params.normalization = m_normalization; |
1466 params.binDisplay = m_binDisplay; | 1464 params.binDisplay = m_binDisplay; |
1467 params.binScale = m_binScale; | 1465 params.binScale = m_binScale; |
1468 params.alwaysOpaque = false; //!!! should be true though | 1466 params.alwaysOpaque = true; |
1469 params.invertVertical = false; | 1467 params.invertVertical = false; |
1470 params.scaleFactor = 1.0; | 1468 params.scaleFactor = 1.0; |
1471 params.colourRotation = m_colourRotation; | 1469 params.colourRotation = m_colourRotation; |
1472 | 1470 |
1473 if (m_colourScale != ColourScaleType::Phase) { | 1471 if (m_colourScale != ColourScaleType::Phase) { |