1
.TH "QwtPlotRasterItem" 3 "26 Feb 2007" "Version 5.0.1" "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 QwtDoubleRect &) const "
72
.SS "Protected Member Functions"
76
.RI "virtual QImage \fBrenderImage\fP (const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QwtDoubleRect &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 "int QwtPlotRasterItem::alpha () const"
123
Alpha value of the raster item
133
Definition at line 163 of file qwt_plot_rasteritem.cpp.
134
.SS "\fBQwtPlotRasterItem::CachePolicy\fP QwtPlotRasterItem::cachePolicy () const"
143
\fBCachePolicy\fP, \fBsetCachePolicy()\fP
148
Definition at line 192 of file qwt_plot_rasteritem.cpp.
149
.SS "void QwtPlotRasterItem::draw (QPainter * painter, const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QRect & canvasRect) const\fC [virtual]\fP"
151
Draw the raster data.
155
\fIpainter\fP Painter
157
\fIxMap\fP X-Scale Map
159
\fIyMap\fP Y-Scale Map
161
\fIcanvasRect\fP Contents rect of the plot canvas
166
Implements \fBQwtPlotItem\fP.
168
Reimplemented in \fBQwtPlotSpectrogram\fP.
170
Definition at line 229 of file qwt_plot_rasteritem.cpp.
172
References QwtPlotItem::boundingRect(), QwtPlotItem::invTransform(), QwtPlotItem::paintRect(), and QwtPlotItem::transform().
174
Referenced by QwtPlotSpectrogram::draw().
175
.SS "void QwtPlotRasterItem::invalidateCache ()"
177
Invalidate the paint cache
186
Definition at line 201 of file qwt_plot_rasteritem.cpp.
188
Referenced by setCachePolicy(), QwtPlotSpectrogram::setColorMap(), and QwtPlotSpectrogram::setData().
189
.SS "QSize QwtPlotRasterItem::rasterHint (const QwtDoubleRect &) const\fC [virtual]\fP"
191
Returns the recommended raster for a given rect.
193
F.e the raster hint can be used to limit the resolution of the image that is rendered.
195
The default implementation returns an invalid size (QSize()), what means: no hint.
197
Reimplemented in \fBQwtPlotSpectrogram\fP.
199
Definition at line 217 of file qwt_plot_rasteritem.cpp.
200
.SS "virtual QImage QwtPlotRasterItem::renderImage (const \fBQwtScaleMap\fP & xMap, const \fBQwtScaleMap\fP & yMap, const QwtDoubleRect & area) const\fC [protected, pure virtual]\fP"
202
Renders an image for an area
204
The format of the image must be QImage::Format_Indexed8, QImage::Format_RGB32 or QImage::Format_ARGB32
208
\fIxMap\fP Maps x-values into pixel coordinates.
210
\fIyMap\fP Maps y-values into pixel coordinates.
212
\fIarea\fP Requested area for the image in scale coordinates
217
Implemented in \fBQwtPlotSpectrogram\fP.
218
.SS "void QwtPlotRasterItem::setAlpha (int alpha)"
220
Set an alpha value for the raster data.
222
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.
224
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.
228
\fIalpha\fP Alpha value
234
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).
236
alpha < 0 The alpha values returned by \fBrenderImage()\fP are not changed.
239
The default alpha value is -1.
248
Definition at line 143 of file qwt_plot_rasteritem.cpp.
250
References QwtPlotItem::itemChanged().
251
.SS "void QwtPlotRasterItem::setCachePolicy (\fBQwtPlotRasterItem::CachePolicy\fP policy)"
253
Change the cache policy
255
The default policy is NoCache
259
\fIpolicy\fP Cache policy
264
\fBCachePolicy\fP, \fBcachePolicy()\fP
269
Definition at line 176 of file qwt_plot_rasteritem.cpp.
271
References invalidateCache(), and QwtPlotItem::itemChanged().
275
Generated automatically by Doxygen for Qwt User's Guide from the source code.