Controlling y-coordinate values in QwtRasterData's value() method
Hi,
I am currently working on a project where I need to create a spectrogram using QwtPlotSpectrogram. My frequency range is from 9.1 kHz to 19.9 kHz with a bandwidth of 0.2 kHz. I am using QwtRasterData to manage my data.
I am facing an issue where I want to ensure that the y-coordinate passed to the value() method of QwtRasterData only takes valid frequency values within my specified range. Is there any way to control or restrict the y-coordinates that are passed to this method? I am essentially trying to create a color map where each pixel corresponds to a specific frequency and time, and I want to avoid unnecessary computations for invalid frequencies.
I would greatly appreciate any guidance or suggestions on how to achieve this.
Thanks in advance
Re: Controlling y-coordinate values in QwtRasterData's value() method
Guess overloading QwtRasterData::interval is what you are looking for.
You might also want to implement QwtRasterData::pixelHint to reduce the number of calculations.
Note that returning qQNaN is allowed to indicate gaps, where you don't have values.
HTH,
Uwe
Re: Controlling y-coordinate values in QwtRasterData's value() method
Thanks a lot! Your helpful suggestions solved my issue.
Best regards
Hussam