No, you don't need to know the number of pixels.
Your rasterdata object needs to calculate a value for any coordinate it is requested ( + return a valid bounding rectangle to avoid requests for values, where you can't return something useful ). When the resolution of the plot is higher than your value matrix, next neighbor will return each value several times, if it is lower you will have undisplayed values. ( more advanced resampling strategies can avoid this effect, but slow down the rendering process).
Sometimes it is helpful to know the pixel raster to resample in advance. ( F.e. when you have a huge amount of values on disk you can't have in memory at once ). That's what QwtRasterData::initRaster()/discardRaster() are good for.
QwtRasterData::rasterHint() returns the raster of your matrix. It is used to find the best resolution for the image of the spectrogram.
Uwe





Reply With Quote
Bookmarks