Semi-transparent multi-layered spectrogram plots
Hello,
I have some two-dimensional arrays filled with data and want to display them using QwtSpectrogramPlot.
It all works fine for one array at a time but now I would like to display several on top of each other, each with its distinct QwtColorMap.
Imagine, maybe, that one array would be there to display the height of a geographical map and another array giving the flow rate of rivers.
(Optionally, a third boolean array could be given as a marker whether a spot has a river or not.)
What could be the best way to achieve this? Especially since I have not really understood how the QwtAlphaColorMap works in combination with a SpectrogramPlot. Can I use a SpectrogramPlot with an AlphaColorMap and a LinearColorMap together or how does it work?
Thanks for your help.
Re: Semi-transparent multi-layered spectrogram plots
spectrogram->setAlpha(...).
HTH,
Uwe
Re: Semi-transparent multi-layered spectrogram plots
Quote:
Originally Posted by
Uwe
spectrogram->setAlpha(...).
Thanks, but doesn’t this set the opacity for the whole plot at once? How can I really exclude areas from being opaque or transparent?
Re: Semi-transparent multi-layered spectrogram plots
Quote:
Thanks, but doesn’t this set the opacity for the whole plot at once?
No, it sets the opacity of a spectrogram ( in your example the elevation ), but it doesn't affect any other plot items ( like your rivers or other spectrograms like population ...). When you lay your elevation item with an alpha value of 100 on top of your river item you can see both.
You could add a slider/wheel to your plot widget, where the user can control the alpha value of the top raster item. I once wrote a GIS application this way
Quote:
How can I really exclude areas from being opaque or transparent?
If you want to have gaps in your spectrogram use a color map, that returns qRgba(0, 0, 0, 0) for values outside the valid range ( or use a special invalid value like an elevation of 20000 ) and return invalid values in your raster data class.
Uwe
Re: Semi-transparent multi-layered spectrogram plots
Ah, now I understand.
I didn’t think of subclassing QwtColorMap in the first place, because I thought there would be some built-in method for accomplishing this. So now, I’ll just subclass the LinearColorMap, implement some more strict checking of the boundaries and return a transparent value if necessary. Think this should work for my needs. :) Thanks