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

Method dbmToRgb

src/gui/SpectrumWidget.cpp:7648–7664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7646// ─── Colour map ───────────────────────────────────────────────────────────────
7647
7648QRgb SpectrumWidget::dbmToRgb(float dbm) const
7649{
7650 // Black level shifts the floor: higher black_level = more of the noise is black.
7651 // Color gain controls the visible range: higher gain = narrower range = more contrast.
7652 // black_level 0-125: higher = floor moves closer to signals (more black)
7653 // color_gain 0-100: higher = narrower visible range = more contrast
7654 const float floorShift = (125 - m_wfBlackLevel) * 0.4f; // inverted: 0=max shift, 125=no shift
7655 const float visRange = 80.0f - m_wfColorGain * 0.7f; // 80 dB down to 10 dB
7656 const float effectiveMin = m_wfMinDbm + floorShift;
7657 const float effectiveMax = effectiveMin + visRange;
7658
7659 const float t = qBound(0.0f, (dbm - effectiveMin) / (effectiveMax - effectiveMin), 1.0f);
7660
7661 int n = 0;
7662 const auto* stops = wfSchemeStops(m_wfColorScheme, n);
7663 return interpolateGradient(t, stops, n);
7664}
7665
7666QRgb SpectrumWidget::dssStrengthToRgb(float s) const
7667{

Callers

nothing calls this directly

Calls 2

wfSchemeStopsFunction · 0.85
interpolateGradientFunction · 0.85

Tested by

no test coverage detected