1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3
<title>Qwt User's Guide: QwtPlotRasterItem Class Reference</title>
4
<link href="tabs.css" rel="stylesheet" type="text/css">
5
<link href="doxygen.css" rel="stylesheet" type="text/css">
7
<!-- Generated by Doxygen 1.5.8 -->
8
<div class="navigation" id="top">
11
<li><a href="index.html"><span>Main Page</span></a></li>
12
<li><a href="pages.html"><span>Related Pages</span></a></li>
13
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
14
<li><a href="files.html"><span>Files</span></a></li>
19
<li><a href="annotated.html"><span>Class List</span></a></li>
20
<li><a href="classes.html"><span>Class Index</span></a></li>
21
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
22
<li><a href="functions.html"><span>Class Members</span></a></li>
26
<div class="contents">
27
<h1>QwtPlotRasterItem Class Reference</h1><!-- doxytag: class="QwtPlotRasterItem" --><!-- doxytag: inherits="QwtPlotItem" -->A class, which displays raster data.
28
<a href="#_details">More...</a>
30
<code>#include <<a class="el" href="qwt__plot__rasteritem_8h-source.html">qwt_plot_rasteritem.h</a>></code>
32
<div class="dynheader">
33
Inheritance diagram for QwtPlotRasterItem:</div>
34
<div class="dynsection">
35
<p><center><img src="class_qwt_plot_raster_item__inherit__graph.png" border="0" usemap="#_qwt_plot_raster_item__inherit__map" alt="Inheritance graph"></center>
36
<map name="_qwt_plot_raster_item__inherit__map">
37
<area shape="rect" href="class_qwt_plot_spectrogram.html" title="A plot item, which displays a spectrogram." alt="" coords="17,232,164,256"><area shape="rect" href="class_qwt_plot_item.html" title="Base class for items on the plot canvas." alt="" coords="43,83,139,107"><area shape="rect" href="class_qwt_legend_item_manager.html" title="Abstract API to bind plot items to the legend." alt="" coords="7,8,175,32"></map>
38
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
41
<a href="class_qwt_plot_raster_item-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
43
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
44
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#94929fc4c31c3dab75ee5adcac2d57b0">CachePolicy</a> { <br>
45
<b>NoCache</b>,
47
<b>PaintCache</b>,
49
<b>ScreenCache</b>
53
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
54
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#2149c1d6b71c607027345a9a51ef3314">QwtPlotRasterItem</a> (const QString &title=QString::null)</td></tr>
56
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#f487c6abc8e95200d4537d1373f96be5">QwtPlotRasterItem</a> (const <a class="el" href="class_qwt_text.html">QwtText</a> &title)</td></tr>
58
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#2715233827c346ab15504dc75d6e9714">~QwtPlotRasterItem</a> ()</td></tr>
60
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#14f2ab8ec0994384e6269f869c352273">setAlpha</a> (int alpha)</td></tr>
62
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#96b2faa0bc0fe086bff1abe72bcb2016">alpha</a> () const </td></tr>
64
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#31f74199f7e333c2683b0f18289e4c7f">setCachePolicy</a> (<a class="el" href="class_qwt_plot_raster_item.html#94929fc4c31c3dab75ee5adcac2d57b0">CachePolicy</a>)</td></tr>
66
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="class_qwt_plot_raster_item.html#94929fc4c31c3dab75ee5adcac2d57b0">CachePolicy</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#c953db5d88084f416b4dbc3ca8a323f3">cachePolicy</a> () const </td></tr>
68
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#547ce4d8d031b230226cfbd509ef65b5">invalidateCache</a> ()</td></tr>
70
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#81b062af415a8df33262f23768fd71ad">draw</a> (QPainter *p, const <a class="el" href="class_qwt_scale_map.html">QwtScaleMap</a> &xMap, const <a class="el" href="class_qwt_scale_map.html">QwtScaleMap</a> &yMap, const QRect &rect) const </td></tr>
72
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual QSize </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#610342c1ff21beed110f6454b705368c">rasterHint</a> (const QwtDoubleRect &) const </td></tr>
74
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
75
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual QImage </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_plot_raster_item.html#8767aea6b99f44109e8490e8ee2c3cbe">renderImage</a> (const <a class="el" href="class_qwt_scale_map.html">QwtScaleMap</a> &xMap, const <a class="el" href="class_qwt_scale_map.html">QwtScaleMap</a> &yMap, const QwtDoubleRect &area) const =0</td></tr>
78
<hr><a name="_details"></a><h2>Detailed Description</h2>
79
A class, which displays raster data.
81
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 ...<p>
82
Often a plot has several types of raster data organized in layers. ( f.e a geographical map, with weather statistics ). Using <a class="el" href="class_qwt_plot_raster_item.html#14f2ab8ec0994384e6269f869c352273" title="Set an alpha value for the raster data.">setAlpha()</a> raster items can be stacked easily.<p>
83
<a class="el" href="class_qwt_plot_raster_item.html" title="A class, which displays raster data.">QwtPlotRasterItem</a> is only implemented for images of the following formats: QImage::Format_Indexed8, QImage::Format_ARGB32.<p>
84
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_plot_spectrogram.html" title="A plot item, which displays a spectrogram.">QwtPlotSpectrogram</a> </dd></dl>
85
<hr><h2>Member Enumeration Documentation</h2>
86
<a class="anchor" name="94929fc4c31c3dab75ee5adcac2d57b0"></a><!-- doxytag: member="QwtPlotRasterItem::CachePolicy" ref="94929fc4c31c3dab75ee5adcac2d57b0" args="" -->
88
<div class="memproto">
89
<table class="memname">
91
<td class="memname">enum <a class="el" href="class_qwt_plot_raster_item.html#94929fc4c31c3dab75ee5adcac2d57b0">QwtPlotRasterItem::CachePolicy</a> </td>
100
<a class="el" href="class_qwt_plot_raster_item.html#8767aea6b99f44109e8490e8ee2c3cbe">renderImage()</a> is called, whenever the item has to be repainted</li><li>PaintCache<br>
101
<a class="el" href="class_qwt_plot_raster_item.html#8767aea6b99f44109e8490e8ee2c3cbe">renderImage()</a> 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.</li><li>ScreenCache<br>
102
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.</li></ul>
104
The default policy is NoCache
107
<hr><h2>Constructor & Destructor Documentation</h2>
108
<a class="anchor" name="2149c1d6b71c607027345a9a51ef3314"></a><!-- doxytag: member="QwtPlotRasterItem::QwtPlotRasterItem" ref="2149c1d6b71c607027345a9a51ef3314" args="(const QString &title=QString::null)" -->
109
<div class="memitem">
110
<div class="memproto">
111
<table class="memname">
113
<td class="memname">QwtPlotRasterItem::QwtPlotRasterItem </td>
115
<td class="paramtype">const QString & </td>
116
<td class="paramname"> <em>title</em> = <code>QString::null</code> </td>
117
<td> ) </td>
118
<td><code> [explicit]</code></td>
130
<a class="anchor" name="f487c6abc8e95200d4537d1373f96be5"></a><!-- doxytag: member="QwtPlotRasterItem::QwtPlotRasterItem" ref="f487c6abc8e95200d4537d1373f96be5" args="(const QwtText &title)" -->
131
<div class="memitem">
132
<div class="memproto">
133
<table class="memname">
135
<td class="memname">QwtPlotRasterItem::QwtPlotRasterItem </td>
137
<td class="paramtype">const <a class="el" href="class_qwt_text.html">QwtText</a> & </td>
138
<td class="paramname"> <em>title</em> </td>
139
<td> ) </td>
140
<td><code> [explicit]</code></td>
152
<a class="anchor" name="2715233827c346ab15504dc75d6e9714"></a><!-- doxytag: member="QwtPlotRasterItem::~QwtPlotRasterItem" ref="2715233827c346ab15504dc75d6e9714" args="()" -->
153
<div class="memitem">
154
<div class="memproto">
155
<table class="memname">
157
<td class="memname">QwtPlotRasterItem::~QwtPlotRasterItem </td>
159
<td class="paramname"> </td>
160
<td> ) </td>
161
<td><code> [virtual]</code></td>
173
<hr><h2>Member Function Documentation</h2>
174
<a class="anchor" name="96b2faa0bc0fe086bff1abe72bcb2016"></a><!-- doxytag: member="QwtPlotRasterItem::alpha" ref="96b2faa0bc0fe086bff1abe72bcb2016" args="() const " -->
175
<div class="memitem">
176
<div class="memproto">
177
<table class="memname">
179
<td class="memname">int QwtPlotRasterItem::alpha </td>
181
<td class="paramname"> </td>
182
<td> ) </td>
190
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Alpha value of the raster item </dd></dl>
191
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_plot_raster_item.html#14f2ab8ec0994384e6269f869c352273" title="Set an alpha value for the raster data.">setAlpha()</a> </dd></dl>
195
<a class="anchor" name="c953db5d88084f416b4dbc3ca8a323f3"></a><!-- doxytag: member="QwtPlotRasterItem::cachePolicy" ref="c953db5d88084f416b4dbc3ca8a323f3" args="() const " -->
196
<div class="memitem">
197
<div class="memproto">
198
<table class="memname">
200
<td class="memname"><a class="el" href="class_qwt_plot_raster_item.html#94929fc4c31c3dab75ee5adcac2d57b0">QwtPlotRasterItem::CachePolicy</a> QwtPlotRasterItem::cachePolicy </td>
202
<td class="paramname"> </td>
203
<td> ) </td>
211
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Cache policy </dd></dl>
212
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_plot_raster_item.html#94929fc4c31c3dab75ee5adcac2d57b0">CachePolicy</a>, <a class="el" href="class_qwt_plot_raster_item.html#31f74199f7e333c2683b0f18289e4c7f">setCachePolicy()</a> </dd></dl>
216
<a class="anchor" name="81b062af415a8df33262f23768fd71ad"></a><!-- doxytag: member="QwtPlotRasterItem::draw" ref="81b062af415a8df33262f23768fd71ad" args="(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &rect) const " -->
217
<div class="memitem">
218
<div class="memproto">
219
<table class="memname">
221
<td class="memname">void QwtPlotRasterItem::draw </td>
223
<td class="paramtype">QPainter * </td>
224
<td class="paramname"> <em>painter</em>, </td>
227
<td class="paramkey"></td>
229
<td class="paramtype">const <a class="el" href="class_qwt_scale_map.html">QwtScaleMap</a> & </td>
230
<td class="paramname"> <em>xMap</em>, </td>
233
<td class="paramkey"></td>
235
<td class="paramtype">const <a class="el" href="class_qwt_scale_map.html">QwtScaleMap</a> & </td>
236
<td class="paramname"> <em>yMap</em>, </td>
239
<td class="paramkey"></td>
241
<td class="paramtype">const QRect & </td>
242
<td class="paramname"> <em>canvasRect</em></td><td> </td>
247
<td></td><td></td><td> const<code> [virtual]</code></td>
254
Draw the raster data.
256
<dl compact><dt><b>Parameters:</b></dt><dd>
257
<table border="0" cellspacing="2" cellpadding="0">
258
<tr><td valign="top"></td><td valign="top"><em>painter</em> </td><td>Painter </td></tr>
259
<tr><td valign="top"></td><td valign="top"><em>xMap</em> </td><td>X-Scale Map </td></tr>
260
<tr><td valign="top"></td><td valign="top"><em>yMap</em> </td><td>Y-Scale Map </td></tr>
261
<tr><td valign="top"></td><td valign="top"><em>canvasRect</em> </td><td>Contents rect of the plot canvas </td></tr>
265
<p>Implements <a class="el" href="class_qwt_plot_item.html#5483623e4fd1ae85b06b93523784358b">QwtPlotItem</a>.</p>
267
<p>Reimplemented in <a class="el" href="class_qwt_plot_spectrogram.html#b76245f919a08375b1f975d507e2afea">QwtPlotSpectrogram</a>.</p>
271
<a class="anchor" name="547ce4d8d031b230226cfbd509ef65b5"></a><!-- doxytag: member="QwtPlotRasterItem::invalidateCache" ref="547ce4d8d031b230226cfbd509ef65b5" args="()" -->
272
<div class="memitem">
273
<div class="memproto">
274
<table class="memname">
276
<td class="memname">void QwtPlotRasterItem::invalidateCache </td>
278
<td class="paramname"> </td>
279
<td> ) </td>
287
Invalidate the paint cache <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_plot_raster_item.html#31f74199f7e333c2683b0f18289e4c7f">setCachePolicy()</a> </dd></dl>
291
<a class="anchor" name="610342c1ff21beed110f6454b705368c"></a><!-- doxytag: member="QwtPlotRasterItem::rasterHint" ref="610342c1ff21beed110f6454b705368c" args="(const QwtDoubleRect &) const " -->
292
<div class="memitem">
293
<div class="memproto">
294
<table class="memname">
296
<td class="memname">QSize QwtPlotRasterItem::rasterHint </td>
298
<td class="paramtype">const QwtDoubleRect & </td>
299
<td class="paramname"> </td>
300
<td> ) </td>
301
<td> const<code> [virtual]</code></td>
308
Returns the recommended raster for a given rect.
310
F.e the raster hint can be used to limit the resolution of the image that is rendered.<p>
311
The default implementation returns an invalid size (QSize()), what means: no hint.
312
<p>Reimplemented in <a class="el" href="class_qwt_plot_spectrogram.html#4e59ddce72db5df3d0be3986e74ab1f7">QwtPlotSpectrogram</a>.</p>
316
<a class="anchor" name="8767aea6b99f44109e8490e8ee2c3cbe"></a><!-- doxytag: member="QwtPlotRasterItem::renderImage" ref="8767aea6b99f44109e8490e8ee2c3cbe" args="(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtDoubleRect &area) const =0" -->
317
<div class="memitem">
318
<div class="memproto">
319
<table class="memname">
321
<td class="memname">virtual QImage QwtPlotRasterItem::renderImage </td>
323
<td class="paramtype">const <a class="el" href="class_qwt_scale_map.html">QwtScaleMap</a> & </td>
324
<td class="paramname"> <em>xMap</em>, </td>
327
<td class="paramkey"></td>
329
<td class="paramtype">const <a class="el" href="class_qwt_scale_map.html">QwtScaleMap</a> & </td>
330
<td class="paramname"> <em>yMap</em>, </td>
333
<td class="paramkey"></td>
335
<td class="paramtype">const QwtDoubleRect & </td>
336
<td class="paramname"> <em>area</em></td><td> </td>
341
<td></td><td></td><td> const<code> [protected, pure virtual]</code></td>
348
Renders an image for an area<p>
349
The format of the image must be QImage::Format_Indexed8, QImage::Format_RGB32 or QImage::Format_ARGB32<p>
350
<dl compact><dt><b>Parameters:</b></dt><dd>
351
<table border="0" cellspacing="2" cellpadding="0">
352
<tr><td valign="top"></td><td valign="top"><em>xMap</em> </td><td>Maps x-values into pixel coordinates. </td></tr>
353
<tr><td valign="top"></td><td valign="top"><em>yMap</em> </td><td>Maps y-values into pixel coordinates. </td></tr>
354
<tr><td valign="top"></td><td valign="top"><em>area</em> </td><td>Requested area for the image in scale coordinates </td></tr>
358
<p>Implemented in <a class="el" href="class_qwt_plot_spectrogram.html#698a7039b51fa259c39bd93a64743eea">QwtPlotSpectrogram</a>.</p>
362
<a class="anchor" name="14f2ab8ec0994384e6269f869c352273"></a><!-- doxytag: member="QwtPlotRasterItem::setAlpha" ref="14f2ab8ec0994384e6269f869c352273" args="(int alpha)" -->
363
<div class="memitem">
364
<div class="memproto">
365
<table class="memname">
367
<td class="memname">void QwtPlotRasterItem::setAlpha </td>
369
<td class="paramtype">int </td>
370
<td class="paramname"> <em>alpha</em> </td>
371
<td> ) </td>
379
Set an alpha value for the raster data.
381
Often a plot has several types of raster data organized in layers. ( f.e a geographical map, with weather statistics ). Using <a class="el" href="class_qwt_plot_raster_item.html#14f2ab8ec0994384e6269f869c352273" title="Set an alpha value for the raster data.">setAlpha()</a> raster items can be stacked easily.<p>
382
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.<p>
383
<dl compact><dt><b>Parameters:</b></dt><dd>
384
<table border="0" cellspacing="2" cellpadding="0">
385
<tr><td valign="top"></td><td valign="top"><em>alpha</em> </td><td>Alpha value</td></tr>
389
<li>alpha >= 0<br>
390
All alpha values of the pixels returned by <a class="el" href="class_qwt_plot_raster_item.html#8767aea6b99f44109e8490e8ee2c3cbe">renderImage()</a> will be set to alpha, beside those with an alpha value of 0 (invalid pixels).</li><li>alpha < 0 The alpha values returned by <a class="el" href="class_qwt_plot_raster_item.html#8767aea6b99f44109e8490e8ee2c3cbe">renderImage()</a> are not changed.</li></ul>
392
The default alpha value is -1.<p>
393
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_plot_raster_item.html#96b2faa0bc0fe086bff1abe72bcb2016">alpha()</a> </dd></dl>
397
<a class="anchor" name="31f74199f7e333c2683b0f18289e4c7f"></a><!-- doxytag: member="QwtPlotRasterItem::setCachePolicy" ref="31f74199f7e333c2683b0f18289e4c7f" args="(CachePolicy)" -->
398
<div class="memitem">
399
<div class="memproto">
400
<table class="memname">
402
<td class="memname">void QwtPlotRasterItem::setCachePolicy </td>
404
<td class="paramtype"><a class="el" href="class_qwt_plot_raster_item.html#94929fc4c31c3dab75ee5adcac2d57b0">QwtPlotRasterItem::CachePolicy</a> </td>
405
<td class="paramname"> <em>policy</em> </td>
406
<td> ) </td>
414
Change the cache policy<p>
415
The default policy is NoCache<p>
416
<dl compact><dt><b>Parameters:</b></dt><dd>
417
<table border="0" cellspacing="2" cellpadding="0">
418
<tr><td valign="top"></td><td valign="top"><em>policy</em> </td><td>Cache policy </td></tr>
421
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_plot_raster_item.html#94929fc4c31c3dab75ee5adcac2d57b0">CachePolicy</a>, <a class="el" href="class_qwt_plot_raster_item.html#c953db5d88084f416b4dbc3ca8a323f3">cachePolicy()</a> </dd></dl>
426
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Mar 22 16:41:25 2009 for Qwt User's Guide by
427
<a href="http://www.doxygen.org/index.html">
428
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>