QwtPlotRasterItem(3)
π NAME π
QwtPlotRasterItem β bestie, this is the class that puts raster data up on your plot π
β¨
π¦ SYNOPSIS π¦
#include <qwt_plot_rasteritem.h>
Inherits QwtPlotItem.
Inherited by QwtPlotSpectrogram.
π Public Types
enum CachePolicy { NoCache, PaintCache, ScreenCache }
πΈ Public Member Functions
QwtPlotRasterItem (const QString &title=QString::null)QwtPlotRasterItem (const QwtText &title)virtual ~QwtPlotRasterItem ()int alpha () constCachePolicy cachePolicy () constvirtual void draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &rect) constvoid invalidateCache ()virtual QSize rasterHint (const QwtDoubleRect &) constvoid setAlpha (int alpha)void setCachePolicy (CachePolicy)
π Protected Member Functions
virtual QImage renderImage (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtDoubleRect &area) const =0
π DETAILED DESCRIPTION π
It's a class that displays raster data, no cap.
So like, raster data is a grid of pixel values, right? And that grid can be represented as a QImage. It's giving main character energy for sooo many kinds of info β think spectrograms, cartograms, geographical maps... the whole vibe πΊοΈ
A lot of the time a plot has several types of raster data organized in layers (f.e a geographical map, with weather statistics). And the way you stack those layers so easily? That's setAlpha() doing its thing π
Heads up though β QwtPlotRasterItem is only implemented for images of the following formats: QImage::Format_Indexed8, QImage::Format_ARGB32.
See also:
QwtPlotSpectrogram
π§ MEMBER ENUMERATION DOCUMENTATION π§
β¨ enum QwtPlotRasterItem::CachePolicy β¨
NoCacheβrenderImage()is called, whenever the item has to be repainted. (fr fr, every single time π)PaintCacheβrenderImage()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.ScreenCacheβ 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. (iykyk, it's giving blurry π« )
The default policy is NoCache.
π MEMBER FUNCTION DOCUMENTATION π
β int QwtPlotRasterItem::alpha () const
Returns: Alpha value of the raster item.
See also: setAlpha()
β QwtPlotRasterItem::CachePolicy QwtPlotRasterItem::cachePolicy () const
Returns: Cache policy.
See also: CachePolicy, setCachePolicy()
β void QwtPlotRasterItem::draw (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &canvasRect) const [virtual]
Draws the raster data. Obsessed. π«
Parameters:
- 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. Bye bye cache bestie π
See also: setCachePolicy()
β QSize QwtPlotRasterItem::rasterHint (const QwtDoubleRect &) const [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. (not me being unhelpful π)
Reimplemented in QwtPlotSpectrogram.
β virtual QImage QwtPlotRasterItem::renderImage (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtDoubleRect &area) const [protected], [pure virtual]
Renders an image for an area.
The format of the image must beQImage::Format_Indexed8,QImage::Format_RGB32orQImage::Format_ARGB32. No other formats, periodt. π
Parameters:
- 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.
Parameters:
- alpha β Alpha value
alpha >= 0β All alpha values of the pixels returned byrenderImage()will be set to alpha, beside those with an alpha value of0(invalid pixels).alpha < 0β The alpha values returned byrenderImage()are not changed.
The default alpha value is -1.
See also: alpha()
β void QwtPlotRasterItem::setCachePolicy (QwtPlotRasterItem::CachePolicy policy)
Change the cache policy.
The default policy is NoCache.
Parameters:
- policy β Cache policy
See also: CachePolicy, cachePolicy()
π«Ά AUTHOR π«Ά
Generated automatically by Doxygen for Qwt User's Guide from the source code. Slay, Doxygen, you ate that π
Okay that's the whole page bestie, you're fully caught up! πβ¨ This was Qwt User's Guide, version 5.2.3, dated Tue Nov 20 2012. Go forth and render those rasters, icon ππ¦π
π¦ where this page comes from
- epel 9: qwt5-qt5-devel 5.2.3a-12.20210522gita2b11e3.el9 Β· LGPLv2+ with exceptions
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms