QwtPlotRasterItem(3) | Qwt User's Guide | QwtPlotRasterItem(3) |
QwtPlotRasterItem - A class, which displays raster data.
#include <qwt_plot_rasteritem.h>
Inherits QwtPlotItem.
Inherited by QwtPlotSpectrogram.
enum CachePolicy { NoCache, PaintCache }
Cache policy The default policy is NoCache. enum PaintAttribute {
PaintInDeviceResolution = 1 }
typedef QFlags< PaintAttribute > PaintAttributes
Paint attributes.
QwtPlotRasterItem (const QString
&title=QString())
Constructor. QwtPlotRasterItem (const QwtText &title)
Constructor. virtual ~QwtPlotRasterItem ()
Destructor. void setPaintAttribute (PaintAttribute, bool
on=true)
bool testPaintAttribute (PaintAttribute) const
void setAlpha (int alpha)
Set an alpha value for the raster data. int alpha () const
void setCachePolicy (CachePolicy)
CachePolicy cachePolicy () const
void invalidateCache ()
virtual void draw (QPainter *, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, const QRectF &canvasRect) const
Draw the raster data. virtual QRectF pixelHint (const QRectF &)
const
Pixel hint. virtual QwtInterval interval (Qt::Axis) const
virtual QRectF boundingRect () const
virtual QImage renderImage (const QwtScaleMap
&xMap, const QwtScaleMap &yMap, const QRectF &area, const
QSize &imageSize) const =0
Render an image. virtual QwtScaleMap imageMap (Qt::Orientation,
const QwtScaleMap &map, const QRectF &area, const QSize
&imageSize, double pixelSize) const
Calculate a scale map for painting to an image.
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 ...
Often a plot has several types of raster data organized in layers. ( f.e a geographical map, with weather statistics ). Using setAlpha() raster items can be stacked easily.
QwtPlotRasterItem is only implemented for images of the following formats: QImage::Format_Indexed8, QImage::Format_ARGB32.
See also:
Cache policy The default policy is NoCache.
Enumerator
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.
Attributes to modify the drawing algorithm.
See also:
Enumerator
Returns:
See also:
Returns:
See also:
Reimplemented from QwtPlotItem.
Returns:
See also:
Draw the raster data.
Parameters:
Implements QwtPlotItem.
Reimplemented in QwtPlotSpectrogram.
Calculate a scale map for painting to an image.
Parameters:
Returns:
Returns:
This method is intended to be reimplemented by derived classes. The default implementation returns an invalid interval.
Parameters:
Reimplemented in QwtPlotSpectrogram.
Invalidate the paint cache
See also:
Pixel hint. The geometry of a pixel is used to calculated the resolution and alignment of the rendered image.
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 ).
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.
The default implementation returns an empty rectangle (QRectF()), meaning, that the image will be rendered in target device ( f.e screen ) resolution.
Parameters:
Returns:
See also:
Reimplemented in QwtPlotSpectrogram.
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.
Parameters:
Returns:
Implemented in QwtPlotSpectrogram.
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 setAlpha() raster items can be stacked easily.
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.
Parameters:
The default alpha value is -1.
See also:
Change the cache policy
The default policy is NoCache
Parameters:
See also:
Specify an attribute how to draw the raster item
Parameters:
Returns:
See also:
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Wed Jan 2 2019 | Version 6.1.4 |