feat(waterfall): палитры Inferno/Turbo + gamma, разрешение до 4096, HiDPI

- SPECTRUM_PIXELS 1024→4096 + настройка display_pixels (лимит точек
  анализатора, SetDisplayResLimit); web-зеркало остаётся 1024 —
  max-децимация в SnapshotPixels
- палитры водопада Classic/Inferno/Turbo + регулятор gamma (в LUT),
  настройки wf_palette/wf_gamma, страница Waterfall → группа Rendering
- GL-водопад переведён на общий LUT/AGC-уровни базового класса
  (убраны дубли ColorForDB/UpdateLevels)
- явные glViewport в GL-вьюхах умножаются на PixelScale (HiDPI),
  текстура водопада — в физической ширине

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 16:11:58 +03:00
co-authored by Claude Fable 5
parent 4733ddab58
commit 092a202f5f
10 changed files with 397 additions and 263 deletions
+15 -5
View File
@@ -100,7 +100,7 @@ type
FBeaconDecFreq: Double;
FBeaconDecHalf: Double; // полуширина фильтра, Гц
// ── Spectrum buffer ───────────────────────────────────────────────────────
FSpectrumBuf: array[0..1023] of Single;
FSpectrumBuf: array[0..WF_MAX_PIXELS-1] of Single;
FSpectrumBufCount: Integer;
FSpectrumDirty: Boolean;
// ── Sub-views ─────────────────────────────────────────────────────────────
@@ -172,6 +172,10 @@ type
procedure SetWfAGCOffset(V: Double);
function GetWfFrameInterval: Integer;
procedure SetWfFrameInterval(V: Integer);
function GetWfPalette: Integer;
procedure SetWfPalette(V: Integer);
function GetWfGamma: Double;
procedure SetWfGamma(V: Double);
procedure SetPbWaterfall(V: TControl);
// SMeter sub-view delegating accessors
function GetLastSMeter: Double;
@@ -254,6 +258,8 @@ type
property FillSpectrum: Boolean read FFillSpectrum write SetFillSpectrum;
property WaterfallDirty: Boolean read GetWaterfallDirty write SetWaterfallDirty;
property WfFrameInterval: Integer read GetWfFrameInterval write SetWfFrameInterval;
property WfPalette: Integer read GetWfPalette write SetWfPalette;
property WfGamma: Double read GetWfGamma write SetWfGamma;
// ── Ссылки на PaintBox ────────────────────────────────────────────────────
property PbWaterfall: TControl write SetPbWaterfall;
@@ -528,6 +534,10 @@ function TSpectrumView.GetWfAGCOffset: Double; begin Result := FWaterfall.
procedure TSpectrumView.SetWfAGCOffset(V: Double); begin FWaterfall.WfAGCOffset := V; end;
function TSpectrumView.GetWfFrameInterval: Integer; begin Result := FWaterfall.WfFrameInterval; end;
procedure TSpectrumView.SetWfFrameInterval(V: Integer); begin FWaterfall.WfFrameInterval := V; end;
function TSpectrumView.GetWfPalette: Integer; begin Result := FWaterfall.WfPalette; end;
procedure TSpectrumView.SetWfPalette(V: Integer); begin FWaterfall.WfPalette := V; end;
function TSpectrumView.GetWfGamma: Double; begin Result := FWaterfall.WfGamma; end;
procedure TSpectrumView.SetWfGamma(V: Double); begin FWaterfall.WfGamma := V; end;
procedure TSpectrumView.SetPbWaterfall(V: TControl); begin FWaterfall.PbWaterfall := V; end;
function TSpectrumView.GetLastSMeter: Double; begin Result := FSMeter.LastSMeter; end;
@@ -1148,7 +1158,7 @@ end;
procedure TSpectrumView.SetSpectrumData(const Pixels: array of Single; Count: Integer);
var i, N: Integer;
begin
N := Min(Count, 1024);
N := Min(Count, WF_MAX_PIXELS);
for i := 0 to N - 1 do FSpectrumBuf[i] := Pixels[i];
FSpectrumBufCount := N;
FSpectrumDirty := True;
@@ -1228,7 +1238,7 @@ end;
procedure TSpectrumView.ResetSpectrumBuf;
var i: Integer;
begin
for i := 0 to 1023 do FSpectrumBuf[i] := -130.0;
for i := 0 to High(FSpectrumBuf) do FSpectrumBuf[i] := -130.0;
FWaterfall.ResetWfBuf;
end;
@@ -1249,7 +1259,7 @@ begin
Noise := -110 + (Random - 0.5) * 6;
if Abs(FreqOff) < 2000 then Sig := -50 - Abs(FreqOff) / 200
else Sig := -999;
FSpectrumBuf[i mod 1024] := Max(Noise, Sig);
FSpectrumBuf[i mod WF_MAX_PIXELS] := Max(Noise, Sig);
end;
end;
@@ -1394,7 +1404,7 @@ begin
// Точки кривой спектра
if FSpPtsLen <> W + 2 then
begin SetLength(FSpPts, W + 2); FSpPtsLen := W + 2; end;
SrcCount := EnsureRange(FSpectrumBufCount, 2, 1024);
SrcCount := EnsureRange(FSpectrumBufCount, 2, WF_MAX_PIXELS);
if FTXMode and (FTXSpanHz > 0) and (FSpanHz > 0) then
begin
for i := 0 to W - 1 do