MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / dssStrengthToRgb

Method dssStrengthToRgb

src/gui/SpectrumWidget.cpp:7666–7675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7664}
7665
7666QRgb SpectrumWidget::dssStrengthToRgb(float s) const
7667{
7668 // gamma in [0.25 .. 4]: gain=100 -> 0.25 (colour lifted to the noise floor),
7669 // gain=50 -> 1.0 (linear), gain=0 -> 4 (colour only on the strongest peaks).
7670 const float gamma = std::pow(4.0f, (50.0f - m_dssGain) / 50.0f);
7671 int n = 0;
7672 const auto* stops = wfSchemeStops(m_wfColorScheme, n);
7673 return interpolateGradient(std::pow(std::clamp(s, 0.0f, 1.0f), gamma),
7674 stops, n);
7675}
7676
7677quint64 SpectrumWidget::dssPaletteToken() const
7678{

Callers

nothing calls this directly

Calls 2

wfSchemeStopsFunction · 0.85
interpolateGradientFunction · 0.85

Tested by

no test coverage detected