1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388
|
.TH "QwtPlotRasterItem" 3 "Thu Dec 11 2014" "Version 6.1.2" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotRasterItem \-
.PP
A class, which displays raster data\&.
.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_plot_rasteritem\&.h>\fP
.PP
Inherits \fBQwtPlotItem\fP\&.
.PP
Inherited by \fBQwtPlotSpectrogram\fP\&.
.SS "Public Types"
.in +1c
.ti -1c
.RI "enum \fBCachePolicy\fP { \fBNoCache\fP, \fBPaintCache\fP }"
.br
.RI "\fICache policy The default policy is NoCache\&. \fP"
.ti -1c
.RI "enum \fBPaintAttribute\fP { \fBPaintInDeviceResolution\fP = 1 }"
.br
.ti -1c
.RI "typedef QFlags< \fBPaintAttribute\fP > \fBPaintAttributes\fP"
.br
.RI "\fIPaint attributes\&. \fP"
.in -1c
.SS "Public Member Functions"
.in +1c
.ti -1c
.RI "\fBQwtPlotRasterItem\fP (const QString &\fBtitle\fP=QString::null)"
.br
.RI "\fIConstructor\&. \fP"
.ti -1c
.RI "\fBQwtPlotRasterItem\fP (const \fBQwtText\fP &\fBtitle\fP)"
.br
.RI "\fIConstructor\&. \fP"
.ti -1c
.RI "virtual \fB~QwtPlotRasterItem\fP ()"
.br
.RI "\fIDestructor\&. \fP"
.ti -1c
.RI "void \fBsetPaintAttribute\fP (\fBPaintAttribute\fP, bool on=true)"
.br
.ti -1c
.RI "bool \fBtestPaintAttribute\fP (\fBPaintAttribute\fP) const "
.br
.ti -1c
.RI "void \fBsetAlpha\fP (int \fBalpha\fP)"
.br
.RI "\fISet an alpha value for the raster data\&. \fP"
.ti -1c
.RI "int \fBalpha\fP () const "
.br
.ti -1c
.RI "void \fBsetCachePolicy\fP (\fBCachePolicy\fP)"
.br
.ti -1c
.RI "\fBCachePolicy\fP \fBcachePolicy\fP () const "
.br
.ti -1c
.RI "void \fBinvalidateCache\fP ()"
.br
.ti -1c
.RI "virtual void \fBdraw\fP (QPainter *p, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &rect) const "
.br
.RI "\fIDraw the raster data\&. \fP"
.ti -1c
.RI "virtual QRectF \fBpixelHint\fP (const QRectF &) const "
.br
.RI "\fIPixel hint\&. \fP"
.ti -1c
.RI "virtual \fBQwtInterval\fP \fBinterval\fP (Qt::Axis) const "
.br
.ti -1c
.RI "virtual QRectF \fBboundingRect\fP () const "
.br
.in -1c
.SS "Protected Member Functions"
.in +1c
.ti -1c
.RI "virtual QImage \fBrenderImage\fP (const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &area, const QSize &imageSize) const =0"
.br
.RI "\fIRender an image\&. \fP"
.ti -1c
.RI "virtual \fBQwtScaleMap\fP \fBimageMap\fP (Qt::Orientation, const \fBQwtScaleMap\fP &map, const QRectF &area, const QSize &imageSize, double pixelSize) const "
.br
.RI "\fICalculate a scale map for painting to an image\&. \fP"
.in -1c
.SH "Detailed Description"
.PP
A class, which displays raster data\&.
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 \&.\&.\&.
.PP
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\&.
.PP
\fBQwtPlotRasterItem\fP is only implemented for images of the following formats: QImage::Format_Indexed8, QImage::Format_ARGB32\&.
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlotSpectrogram\fP
.RE
.PP
.SH "Member Enumeration Documentation"
.PP
.SS "enum \fBQwtPlotRasterItem::CachePolicy\fP"
.PP
Cache policy The default policy is NoCache\&.
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fINoCache \fP\fP
\fBrenderImage()\fP is called each time the item has to be repainted
.TP
\fB\fIPaintCache \fP\fP
\fBrenderImage()\fP is called, whenever the image cache is not valid, or the scales, or the size of the canvas has changed\&.
.PP
This type of cache is useful for improving the performance of hide/show operations or manipulations of the alpha value\&. All other situations are handled by the canvas backing store\&.
.SS "enum \fBQwtPlotRasterItem::PaintAttribute\fP"
Attributes to modify the drawing algorithm\&.
.PP
\fBSee Also:\fP
.RS 4
\fBsetPaintAttribute()\fP, \fBtestPaintAttribute()\fP
.RE
.PP
.PP
\fBEnumerator\fP
.in +1c
.TP
\fB\fIPaintInDeviceResolution \fP\fP
When the image is rendered according to the data pixels ( \fBQwtRasterData::pixelHint()\fP ) it can be expanded to paint device resolution before it is passed to QPainter\&. The expansion algorithm rounds the pixel borders in the same way as the axis ticks, what is usually better than the scaling algorithm implemented in Qt\&. Disabling this flag might make sense, to reduce the size of a document/file\&. If this is possible for a document format depends on the implementation of the specific QPaintEngine\&.
.SH "Member Function Documentation"
.PP
.SS "int QwtPlotRasterItem::alpha () const"
.PP
\fBReturns:\fP
.RS 4
Alpha value of the raster item
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetAlpha()\fP
.RE
.PP
.SS "QRectF QwtPlotRasterItem::boundingRect () const\fC [virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
Bounding rectangle of the data
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlotRasterItem::interval()\fP
.RE
.PP
.PP
Reimplemented from \fBQwtPlotItem\fP\&.
.SS "\fBQwtPlotRasterItem::CachePolicy\fP QwtPlotRasterItem::cachePolicy () const"
.PP
\fBReturns:\fP
.RS 4
Cache policy
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBCachePolicy\fP, \fBsetCachePolicy()\fP
.RE
.PP
.SS "void QwtPlotRasterItem::draw (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect) const\fC [virtual]\fP"
.PP
Draw the raster data\&.
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter
.br
\fIxMap\fP X-Scale Map
.br
\fIyMap\fP Y-Scale Map
.br
\fIcanvasRect\fP Contents rectangle of the plot canvas
.RE
.PP
.PP
Implements \fBQwtPlotItem\fP\&.
.PP
Reimplemented in \fBQwtPlotSpectrogram\fP\&.
.SS "\fBQwtScaleMap\fP QwtPlotRasterItem::imageMap (Qt::Orientationorientation, const \fBQwtScaleMap\fP &map, const QRectF &area, const QSize &imageSize, doublepixelSize) const\fC [protected]\fP, \fC [virtual]\fP"
.PP
Calculate a scale map for painting to an image\&.
.PP
\fBParameters:\fP
.RS 4
\fIorientation\fP Orientation, Qt::Horizontal means a X axis
.br
\fImap\fP Scale map for rendering the plot item
.br
\fIarea\fP Area to be painted on the image
.br
\fIimageSize\fP Image size
.br
\fIpixelSize\fP Width/Height of a data pixel
.RE
.PP
\fBReturns:\fP
.RS 4
Calculated scale map
.RE
.PP
.SS "\fBQwtInterval\fP QwtPlotRasterItem::interval (Qt::Axisaxis) const\fC [virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
Bounding interval for an axis
.RE
.PP
This method is intended to be reimplemented by derived classes\&. The default implementation returns an invalid interval\&.
.PP
\fBParameters:\fP
.RS 4
\fIaxis\fP X, Y, or Z axis
.RE
.PP
.PP
Reimplemented in \fBQwtPlotSpectrogram\fP\&.
.SS "void QwtPlotRasterItem::invalidateCache ()"
Invalidate the paint cache
.PP
\fBSee Also:\fP
.RS 4
\fBsetCachePolicy()\fP
.RE
.PP
.SS "QRectF QwtPlotRasterItem::pixelHint (const QRectF &area) const\fC [virtual]\fP"
.PP
Pixel hint\&. The geometry of a pixel is used to calculated the resolution and alignment of the rendered image\&.
.PP
Width and height of the hint need to be the horizontal and vertical distances between 2 neighbored points\&. The center of the hint has to be the position of any point ( it doesn't matter which one )\&.
.PP
Limiting the resolution of the image might significantly improve the performance and heavily reduce the amount of memory when rendering a QImage from the raster data\&.
.PP
The default implementation returns an empty rectangle (QRectF()), meaning, that the image will be rendered in target device ( f\&.e screen ) resolution\&.
.PP
\fBParameters:\fP
.RS 4
\fIarea\fP In most implementations the resolution of the data doesn't depend on the requested area\&.
.RE
.PP
\fBReturns:\fP
.RS 4
Bounding rectangle of a pixel
.RE
.PP
\fBSee Also:\fP
.RS 4
render(), \fBrenderImage()\fP
.RE
.PP
.PP
Reimplemented in \fBQwtPlotSpectrogram\fP\&.
.SS "virtual QImage QwtPlotRasterItem::renderImage (const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &area, const QSize &imageSize) const\fC [protected]\fP, \fC [pure virtual]\fP"
.PP
Render an image\&. An implementation of render() might iterate over all pixels of imageRect\&. Each pixel has to be translated into the corresponding position in scale coordinates using the maps\&. This position can be used to look up a value in a implementation specific way and to map it into a color\&.
.PP
\fBParameters:\fP
.RS 4
\fIxMap\fP X-Scale Map
.br
\fIyMap\fP Y-Scale Map
.br
\fIarea\fP Requested area for the image in scale coordinates
.br
\fIimageSize\fP Requested size of the image
.RE
.PP
\fBReturns:\fP
.RS 4
Rendered image
.RE
.PP
.PP
Implemented in \fBQwtPlotSpectrogram\fP\&.
.SS "void QwtPlotRasterItem::setAlpha (intalpha)"
.PP
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 \fBsetAlpha()\fP raster items can be stacked easily\&.
.PP
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\&.
.PP
\fBParameters:\fP
.RS 4
\fIalpha\fP Alpha value
.RE
.PP
.IP "\(bu" 2
alpha >= 0
.br
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)\&.
.IP "\(bu" 2
alpha < 0 The alpha values returned by \fBrenderImage()\fP are not changed\&.
.PP
.PP
The default alpha value is -1\&.
.PP
\fBSee Also:\fP
.RS 4
\fBalpha()\fP
.RE
.PP
.SS "void QwtPlotRasterItem::setCachePolicy (\fBQwtPlotRasterItem::CachePolicy\fPpolicy)"
Change the cache policy
.PP
The default policy is NoCache
.PP
\fBParameters:\fP
.RS 4
\fIpolicy\fP Cache policy
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBCachePolicy\fP, \fBcachePolicy()\fP
.RE
.PP
.SS "void QwtPlotRasterItem::setPaintAttribute (\fBPaintAttribute\fPattribute, boolon = \fCtrue\fP)"
Specify an attribute how to draw the raster item
.PP
\fBParameters:\fP
.RS 4
\fIattribute\fP Paint attribute
.br
\fIon\fP On/Off /sa PaintAttribute, \fBtestPaintAttribute()\fP
.RE
.PP
.SS "bool QwtPlotRasterItem::testPaintAttribute (\fBPaintAttribute\fPattribute) const"
.PP
\fBReturns:\fP
.RS 4
True, when attribute is enabled
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBPaintAttribute\fP, \fBsetPaintAttribute()\fP
.RE
.PP
.SH "Author"
.PP
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
|