Allow more better define waterfall_palette size and use

pull/4/head
DiSlord 6 years ago
parent d4044808e8
commit fb44b7d2a3

@ -2180,6 +2180,7 @@ redraw_frame(void)
draw_cal_status();
}
//#define _USE_WATERFALL_PALETTE
#ifdef _USE_WATERFALL_PALETTE
#include "waterfall.c"
#endif
@ -2194,11 +2195,12 @@ static void update_waterfall(void){
index_t *index = trace_index[TRACE_ACTUAL];
for (i=0; i< w_width; i++) { // Add new topline
uint16_t color;
uint16_t y = CELL_Y(index[i]); // should be always in range 0 - HEIGHT_SCROLL
#ifdef _USE_WATERFALL_PALETTE
uint16_t y = _PALETTE_ALIGN(CELL_Y(index[i])); // should be always in range 0 - HEIGHT_SCROLL
// y = (uint8_t)i; // for test
color = paltte[y];
color = waterfall_palette[y];
#elif 0
uint16_t y = CELL_Y(index[i]); // should be always in range 0 - HEIGHT_SCROLL
uint16_t ratio = (HEIGHT_SCROLL - y)*2;
// ratio = (i*2); // Uncomment for testing the waterfall colors
int16_t b = 255 - ratio;
@ -2214,6 +2216,7 @@ static void update_waterfall(void){
gamma_correct(b);
color = RGB565(r, g, b);
#else
uint16_t y = CELL_Y(index[i]); // should be always in range 0 - HEIGHT_SCROLL
// Calculate gradient palette for range 0 .. 192
// idx r g b
// 0 - 192 0 0

@ -20,7 +20,8 @@
// Test palette for waterfall
// Possibly better use size = HEIGHT_SCROLL / 2 for more compact and allow use on different displays
// And build table for every display size
static const uint16_t palette[256] = {
#define _PALETTE_ALIGN(idx) ((idx)>>0)
static const uint16_t waterfall_palette[] = {
RGB565(0xBA,0x01,0x00),
RGB565(0xBA,0x01,0x00),
RGB565(0xB9,0x01,0x00),
@ -277,5 +278,5 @@ RGB565(0x01,0x00,0x89),
RGB565(0x01,0x00,0x8A),
RGB565(0x00,0x00,0x87),
RGB565(0x00,0x00,0x83),
RGB565(0x00,0x00,0x84),
};
RGB565(0x00,0x00,0x84)
};

Loading…
Cancel
Save

Powered by TurnKey Linux.