mirror of
https://github.com/alexkay/spek.git
synced 2025-04-22 03:10:29 +03:00
Fix palette mapping
This commit is contained in:
parent
c9ac49a5d5
commit
bea26c6e24
@ -164,10 +164,10 @@ void SpekSpectrogram::on_have_sample(SpekHaveSampleEvent& event)
|
||||
}
|
||||
|
||||
// TODO: check image size, quit if wrong.
|
||||
double range = log(1.0 + this->urange - this->lrange);
|
||||
double range = this->urange - this->lrange;
|
||||
for (int y = 0; y < bands; y++) {
|
||||
double value = fmin(this->urange, fmax(this->lrange, values[y]));
|
||||
double level = log(1.0 + value - this->lrange) / range;
|
||||
double level = (value - this->lrange) / range;
|
||||
uint32_t color = spek_palette_spectrum(level);
|
||||
this->image.SetRGB(
|
||||
sample,
|
||||
|
Loading…
x
Reference in New Issue
Block a user