1
.TH "QwtPlotRasterItem" 3 "22 Mar 2009" "Version 5.1.2" "Qwt User's Guide" \" -*- nroff -*-
9
Inherits \fBQwtPlotItem\fP.
11
Inherited by \fBQwtPlotSpectrogram\fP.
13
.SH "Detailed Description"
15
A class, which displays raster data.
17
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 ...
19
Often a plot has several types of raster data organized in layers. ( f.e a geographical map, with weather statistics ). Using \fBsetAlpha()\fP raster items can be stacked easily.
21
\fBQwtPlotRasterItem\fP is only implemented for images of the following formats: QImage::Format_Indexed8, QImage::Format_ARGB32.
25
\fBQwtPlotSpectrogram\fP
30
Definition at line 36 of file qwt_plot_rasteritem.h.
35
.RI "enum \fBCachePolicy\fP { \fBNoCache\fP, \fBPaintCache\fP, \fBScreenCache\fP }"
38
.SS "Public Member Functions"
42
.RI "\fBQwtPlotRasterItem\fP (const QString &title=QString::null)"
45
.RI "\fBQwtPlotRasterItem\fP (const \fBQwtText\fP &title)"
48
.RI "virtual \fB~QwtPlotRasterItem\fP ()"
51
.RI "void \fBsetAlpha\fP (int alpha)"
54
.RI "int \fBalpha\fP () const"
57
.RI "void \fBsetCachePolicy\fP (\fBCachePolicy\fP)"
60
.RI "\fBCachePolicy\fP \fBcachePolicy\fP () const"
63
.RI "void \fBinvalidateCache\fP ()"
66
.RI "virtual void \fBdraw\fP (QPainter *p, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRect &rect) const"
69
.RI "virtual QSize \fBrasterHint\fP (const \fBQwtDoubleRect\fP &) const"
72
.SS "Protected Member Functions"
76
.RI "virtual QImage \fBrenderImage\fP (const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const \fBQwtDoubleRect\fP &area) const=0"
79
.SH "Member Enumeration Documentation"
81
.SS "enum \fBQwtPlotRasterItem::CachePolicy\fP"
86
\fBrenderImage()\fP is called, whenever the item has to be repainted
90
\fBrenderImage()\fP is called, whenever the image cache is not valid, or the scales, or the size of the canvas has changed. This type of cache is only useful for improving the performance of hide/show operations. All other situations are already handled by the plot canvas cache.
94
The screen cache is an image in size of the screen. As long as the scales don't change the target image is scaled from the cache. This might improve the performance when resizing the plot widget, but suffers from scaling effects.
97
The default policy is NoCache
99
Definition at line 56 of file qwt_plot_rasteritem.h.
100
.SH "Constructor & Destructor Documentation"
102
.SS "QwtPlotRasterItem::QwtPlotRasterItem (const QString & title = \fCQString::null\fP)\fC [explicit]\fP"
106
Definition at line 91 of file qwt_plot_rasteritem.cpp.
107
.SS "QwtPlotRasterItem::QwtPlotRasterItem (const \fBQwtText\fP & title)\fC [explicit]\fP"
111
Definition at line 98 of file qwt_plot_rasteritem.cpp.
112
.SS "QwtPlotRasterItem::~QwtPlotRasterItem ()\fC [virtual]\fP"
116
Definition at line 105 of file qwt_plot_rasteritem.cpp.
117
.SH "Member Function Documentation"
119
.SS "void QwtPlotRasterItem::setAlpha (int alpha)"
121
Set an alpha value for the raster data.
123
Often a plot has several types of raster data organized in layers. ( f.e a geographical map, with weather statistics ). Using \fBsetAlpha()\fP raster items can be stacked easily.
125
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.
129
\fIalpha\fP Alpha value
135
All alpha values of the pixels returned by \fBrenderImage()\fP will be set to alpha, beside those with an alpha value of 0 (invalid pixels).
137
alpha < 0 The alpha values returned by \fBrenderImage()\fP are not changed.
140
The default alpha value is -1.
149
Definition at line 143 of file qwt_plot_rasteritem.cpp.
151
References QwtPlotItem::itemChanged().
152
.SS "int QwtPlotRasterItem::alpha () const"
156
Alpha value of the raster item
166
Definition at line 163 of file qwt_plot_rasteritem.cpp.
167
.SS "void QwtPlotRasterItem::setCachePolicy (\fBQwtPlotRasterItem::CachePolicy\fP policy)"
169
Change the cache policy
171
The default policy is NoCache
175
\fIpolicy\fP Cache policy
180
\fBCachePolicy\fP, \fBcachePolicy()\fP
185
Definition at line 176 of file qwt_plot_rasteritem.cpp.
187
References invalidateCache(), and QwtPlotItem::itemChanged().
188
.SS "\fBQwtPlotRasterItem::CachePolicy\fP QwtPlotRasterItem::cachePolicy () const"
197
\fBCachePolicy\fP, \fBsetCachePolicy()\fP
202
Definition at line 192 of file qwt_plot_rasteritem.cpp.
203
.SS "void QwtPlotRasterItem::invalidateCache ()"
205
Invalidate the paint cache
214
Definition at line 201 of file qwt_plot_rasteritem.cpp.
216
Referenced by setCachePolicy(), QwtPlotSpectrogram::setColorMap(), and QwtPlotSpectrogram::setData().
217
.SS "void QwtPlotRasterItem::draw (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRect & canvasRect) const\fC [virtual]\fP"
219
Draw the raster data.
223
\fIpainter\fP Painter
225
\fIxMap\fP X-Scale Map
227
\fIyMap\fP Y-Scale Map
229
\fIcanvasRect\fP Contents rect of the plot canvas
234
Implements \fBQwtPlotItem\fP.
236
Reimplemented in \fBQwtPlotSpectrogram\fP.
238
Definition at line 229 of file qwt_plot_rasteritem.cpp.
240
References QwtPlotItem::boundingRect(), QwtPlotItem::invTransform(), QwtPlotItem::paintRect(), renderImage(), QwtScaleMap::setPaintInterval(), and QwtPlotItem::transform().
242
Referenced by QwtPlotSpectrogram::draw().
243
.SS "QSize QwtPlotRasterItem::rasterHint (const \fBQwtDoubleRect\fP &) const\fC [virtual]\fP"
245
Returns the recommended raster for a given rect.
247
F.e the raster hint can be used to limit the resolution of the image that is rendered.
249
The default implementation returns an invalid size (QSize()), what means: no hint.
251
Reimplemented in \fBQwtPlotSpectrogram\fP.
253
Definition at line 217 of file qwt_plot_rasteritem.cpp.
254
.SS "virtual QImage QwtPlotRasterItem::renderImage (const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const \fBQwtDoubleRect\fP & area) const\fC [protected, pure virtual]\fP"
256
Renders an image for an area
258
The format of the image must be QImage::Format_Indexed8, QImage::Format_RGB32 or QImage::Format_ARGB32
262
\fIxMap\fP Maps x-values into pixel coordinates.
264
\fIyMap\fP Maps y-values into pixel coordinates.
266
\fIarea\fP Requested area for the image in scale coordinates
271
Implemented in \fBQwtPlotSpectrogram\fP.
273
Referenced by draw().
277
Generated automatically by Doxygen for Qwt User's Guide from the source code.