Raster data is a grid of pixel values, that can be represented as a QImage. It is used for many types of information like spectrograms, cartograms, geographical maps ...
Often a plot has several types of raster data organized in layers. ( f.e a geographical map, with weather statistics ). Using setAlpha() raster items can be stacked easily.
QwtPlotRasterItem is only implemented for images of the following formats: QImage::Format_Indexed8, QImage::Format_ARGB32.
Definition at line 36 of file qwt_plot_rasteritem.h.
Public Types | |
enum | CachePolicy { NoCache, PaintCache, ScreenCache } |
Public Member Functions | |
QwtPlotRasterItem (const QString &title=QString::null) | |
QwtPlotRasterItem (const QwtText &title) | |
virtual | ~QwtPlotRasterItem () |
void | setAlpha (int alpha) |
int | alpha () const |
void | setCachePolicy (CachePolicy) |
CachePolicy | cachePolicy () const |
void | invalidateCache () |
virtual void | draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &rect) const |
virtual QSize | rasterHint (const QwtDoubleRect &) const |
Protected Member Functions | |
virtual QImage | renderImage (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtDoubleRect &area) const =0 |
|
The default policy is NoCache Definition at line 56 of file qwt_plot_rasteritem.h. |
|
Constructor.
Definition at line 91 of file qwt_plot_rasteritem.cpp. |
|
Constructor.
Definition at line 98 of file qwt_plot_rasteritem.cpp. |
|
Destructor.
Definition at line 105 of file qwt_plot_rasteritem.cpp. |
|
Definition at line 163 of file qwt_plot_rasteritem.cpp. |
|
Definition at line 192 of file qwt_plot_rasteritem.cpp. |
|
Draw the raster data.
Implements QwtPlotItem. Reimplemented in QwtPlotSpectrogram. Definition at line 229 of file qwt_plot_rasteritem.cpp. References QwtPlotItem::boundingRect(), QwtPlotItem::invTransform(), QwtPlotItem::paintRect(), and QwtPlotItem::transform(). Referenced by QwtPlotSpectrogram::draw(). |
|
Invalidate the paint cache
Definition at line 201 of file qwt_plot_rasteritem.cpp. Referenced by setCachePolicy(), QwtPlotSpectrogram::setColorMap(), and QwtPlotSpectrogram::setData(). |
|
Returns the recommended raster for a given rect. F.e the raster hint can be used to limit the resolution of the image that is rendered. The default implementation returns an invalid size (QSize()), what means: no hint. Reimplemented in QwtPlotSpectrogram. Definition at line 217 of file qwt_plot_rasteritem.cpp. |
|
Renders an image for an area The format of the image must be QImage::Format_Indexed8, QImage::Format_RGB32 or QImage::Format_ARGB32
Implemented in QwtPlotSpectrogram. |
|
Set an alpha value for the raster data. Often a plot has several types of raster data organized in layers. ( f.e a geographical map, with weather statistics ). Using setAlpha() raster items can be stacked easily. The alpha value is a value [0, 255] to control the transparency of the image. 0 represents a fully transparent color, while 255 represents a fully opaque color.
The default alpha value is -1.
Definition at line 143 of file qwt_plot_rasteritem.cpp. References QwtPlotItem::itemChanged(). |
|
Change the cache policy The default policy is NoCache
Definition at line 176 of file qwt_plot_rasteritem.cpp. References invalidateCache(), and QwtPlotItem::itemChanged(). |