mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-11-26 14:46:23 -05:00
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:
parent
eff214cc79
commit
f941ae871a
20 changed files with 250 additions and 269 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue