spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit bea26c6e249e53137e095210633b74dac9a57fe4
parent c9ac49a5d5c6696c14061eb935dc2442cd877ed4
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Tue, 25 Sep 2012 20:55:40 -0700

Fix palette mapping

Diffstat:
Msrc/spek-spectrogram.cc | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/spek-spectrogram.cc b/src/spek-spectrogram.cc @@ -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,