.TH "QwtPlotRasterItem" 3 "Fri Apr 15 2011" "Version 6.0.0" "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 \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 .ti -1c .RI "enum \fBPaintAttribute\fP { \fBPaintInDeviceResolution\fP = 1 }" .br .ti -1c .RI "typedef QFlags< \fBPaintAttribute\fP > \fBPaintAttributes\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtPlotRasterItem\fP (const QString &title=QString::null)" .br .ti -1c .RI "\fBQwtPlotRasterItem\fP (const \fBQwtText\fP &title)" .br .ti -1c .RI "virtual \fB~QwtPlotRasterItem\fP ()" .br .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 alpha)" .br .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 .ti -1c .RI "virtual QRectF \fBpixelHint\fP (const QRectF &) const " .br .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 .ti -1c .RI "virtual \fBQwtScaleMap\fP \fBimageMap\fP (Qt::Orientation, const \fBQwtScaleMap\fP &map, const QRectF &area, const QSize &imageSize, double pixelSize) const " .br .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 Typedef Documentation" .PP .SS "typedef QFlags<\fBPaintAttribute\fP> \fBQwtPlotRasterItem::PaintAttributes\fP" .PP Paint attributes. .SH "Member Enumeration Documentation" .PP .SS "enum \fBQwtPlotRasterItem::CachePolicy\fP".IP "\(bu" 2 NoCache .br \fBrenderImage()\fP is called, whenever the item has to be repainted .IP "\(bu" 2 PaintCache .br \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. .PP .PP The default policy is NoCache .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 "Constructor & Destructor Documentation" .PP .SS "QwtPlotRasterItem::QwtPlotRasterItem (const QString &title = \fCQString::null\fP)\fC [explicit]\fP" .PP Constructor. .SS "QwtPlotRasterItem::QwtPlotRasterItem (const \fBQwtText\fP &title)\fC [explicit]\fP" .PP Constructor. .SS "QwtPlotRasterItem::~QwtPlotRasterItem ()\fC [virtual]\fP" .PP Destructor. .SH "Member Function Documentation" .PP .SS "int QwtPlotRasterItem::alpha () const"\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"\fBReturns:\fP .RS 4 Bounding rect 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"\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. \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIxMap\fP X-Scale Map .br \fIyMap\fP Y-Scale Map .br \fIcanvasRect\fP Contents rect 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, virtual]\fP" .PP Calculate a scale map for painting to an image. \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 .SS "\fBQwtInterval\fP QwtPlotRasterItem::interval (Qt::Axisaxis) const\fC [virtual]\fP"\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 neighboured 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, 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 .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 Return the current paint attributes. \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.