Custom waterfall colors (#2617)

* Custom waterfall gradient
* Installing a custom waterfall gradient via fileman
* default file for user friendly swap
Co-authored-by: gullradriel <gullradriel@no-mail.com>
This commit is contained in:
Oleg Belousov 2025-04-11 13:46:04 +03:00 committed by GitHub
parent eff214cc79
commit f941ae871a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 250 additions and 269 deletions

View file

@ -21,8 +21,6 @@
#include "ui_spectrum.hpp"
#include "spectrum_color_lut.hpp"
#include "portapack.hpp"
using namespace portapack;
@ -271,12 +269,12 @@ void WaterfallWidget::on_channel_spectrum(
std::array<Color, 240> pixel_row;
for (size_t i = 0; i < 120; i++) {
const auto pixel_color = spectrum_rgb3_lut[spectrum.db[256 - 120 + i]];
const auto pixel_color = gradient.lut[spectrum.db[256 - 120 + i]];
pixel_row[i] = pixel_color;
}
for (size_t i = 120; i < 240; i++) {
const auto pixel_color = spectrum_rgb3_lut[spectrum.db[i - 120]];
const auto pixel_color = gradient.lut[spectrum.db[i - 120]];
pixel_row[i] = pixel_color;
}
@ -305,6 +303,10 @@ WaterfallView::WaterfallView(const bool cursor) {
frequency_scale.on_select = [this](int32_t offset) {
if (on_select) on_select(offset);
};
if (!waterfall_widget.gradient.load_file(default_gradient_file)) {
waterfall_widget.gradient.set_default();
}
}
void WaterfallView::on_show() {