| 7646 | // ─── Colour map ─────────────────────────────────────────────────────────────── |
| 7647 | |
| 7648 | QRgb 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 | |
| 7666 | QRgb SpectrumWidget::dssStrengthToRgb(float s) const |
| 7667 | { |
nothing calls this directly
no test coverage detected