Mercurial > hg > svgui
comparison layer/ColourScale.cpp @ 1143:c53ed1a6fcbd spectrogram-minor-refactor
Fixes to phase display and colour scale for it; tidy up some debug output
author | Chris Cannam |
---|---|
date | Fri, 05 Aug 2016 14:31:16 +0100 |
parents | 998e31e92dbe |
children | 822edd9bb665 |
comparison
equal
deleted
inserted
replaced
1142:8f4634b82e36 | 1143:c53ed1a6fcbd |
---|---|
87 double maxPixF = m_maxPixel; | 87 double maxPixF = m_maxPixel; |
88 | 88 |
89 if (m_params.scaleType == ColourScaleType::Phase) { | 89 if (m_params.scaleType == ColourScaleType::Phase) { |
90 double half = (maxPixF - 1.f) / 2.f; | 90 double half = (maxPixF - 1.f) / 2.f; |
91 int pixel = 1 + int((value * half) / M_PI + half); | 91 int pixel = 1 + int((value * half) / M_PI + half); |
92 // cerr << "phase = " << value << " pixel = " << pixel << endl; | |
92 return pixel; | 93 return pixel; |
93 } | 94 } |
94 | 95 |
95 value *= m_params.gain; | 96 value *= m_params.gain; |
96 | |
97 // value = pow(value, m_params.multiple); | |
98 | 97 |
99 if (value < m_params.threshold) return 0; | 98 if (value < m_params.threshold) return 0; |
100 | 99 |
101 double mapped = value; | 100 double mapped = value; |
102 | 101 |