Qwt User's Guide
5.2.3
|
#include <qwt_plot_rasteritem.h>
Public Types | |
enum | CachePolicy { NoCache, PaintCache, ScreenCache } |
![]() | |
enum | ItemAttribute { Legend = 1, AutoScale = 2 } |
enum | RenderHint { RenderAntialiased = 1 } |
enum | RttiValues { Rtti_PlotItem = 0, Rtti_PlotGrid, Rtti_PlotScale, Rtti_PlotMarker, Rtti_PlotCurve, Rtti_PlotHistogram, Rtti_PlotSpectrogram, Rtti_PlotSVG, Rtti_PlotUserItem = 1000 } |
Public Member Functions | |
QwtPlotRasterItem (const QString &title=QString::null) | |
QwtPlotRasterItem (const QwtText &title) | |
virtual | ~QwtPlotRasterItem () |
int | alpha () const |
CachePolicy | cachePolicy () const |
virtual void | draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &rect) const |
void | invalidateCache () |
virtual QSize | rasterHint (const QwtDoubleRect &) const |
void | setAlpha (int alpha) |
void | setCachePolicy (CachePolicy) |
![]() | |
QwtPlotItem (const QwtText &title=QwtText()) | |
virtual | ~QwtPlotItem () |
void | attach (QwtPlot *plot) |
virtual QwtDoubleRect | boundingRect () const |
void | detach () |
void | hide () |
QwtDoubleRect | invTransform (const QwtScaleMap &, const QwtScaleMap &, const QRect &) const |
bool | isVisible () const |
virtual void | itemChanged () |
virtual QWidget * | legendItem () const |
QRect | paintRect (const QwtScaleMap &, const QwtScaleMap &) const |
QwtPlot * | plot () const |
virtual int | rtti () const |
QwtDoubleRect | scaleRect (const QwtScaleMap &, const QwtScaleMap &) const |
void | setAxis (int xAxis, int yAxis) |
void | setItemAttribute (ItemAttribute, bool on=true) |
void | setRenderHint (RenderHint, bool on=true) |
void | setTitle (const QString &title) |
void | setTitle (const QwtText &title) |
virtual void | setVisible (bool) |
void | setXAxis (int axis) |
void | setYAxis (int axis) |
void | setZ (double z) |
void | show () |
bool | testItemAttribute (ItemAttribute) const |
bool | testRenderHint (RenderHint) const |
const QwtText & | title () const |
QRect | transform (const QwtScaleMap &, const QwtScaleMap &, const QwtDoubleRect &) const |
virtual void | updateLegend (QwtLegend *) const |
virtual void | updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) |
int | xAxis () const |
int | yAxis () const |
double | z () const |
![]() | |
QwtLegendItemManager () | |
virtual | ~QwtLegendItemManager () |
Protected Member Functions | |
virtual QImage | renderImage (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtDoubleRect &area) const =0 |
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.
The default policy is NoCache
int QwtPlotRasterItem::alpha | ( | ) | const |
QwtPlotRasterItem::CachePolicy QwtPlotRasterItem::cachePolicy | ( | ) | const |
|
virtual |
Draw the raster data.
painter | Painter |
xMap | X-Scale Map |
yMap | Y-Scale Map |
canvasRect | Contents rect of the plot canvas |
Implements QwtPlotItem.
Reimplemented in QwtPlotSpectrogram.
void QwtPlotRasterItem::invalidateCache | ( | ) |
Invalidate the paint cache
|
virtual |
Returns the recommended raster for a given rect.
F.e the raster hint can be used to limit the resolution of the image that is rendered.
The default implementation returns an invalid size (QSize()), what means: no hint.
Reimplemented in QwtPlotSpectrogram.
|
protectedpure virtual |
Renders an image for an area
The format of the image must be QImage::Format_Indexed8, QImage::Format_RGB32 or QImage::Format_ARGB32
xMap | Maps x-values into pixel coordinates. |
yMap | Maps y-values into pixel coordinates. |
area | Requested area for the image in scale coordinates |
Implemented in QwtPlotSpectrogram.
void QwtPlotRasterItem::setAlpha | ( | int | alpha | ) |
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.
alpha | Alpha value |
The default alpha value is -1.
void QwtPlotRasterItem::setCachePolicy | ( | QwtPlotRasterItem::CachePolicy | policy | ) |
Change the cache policy
The default policy is NoCache
policy | Cache policy |