QwtPlotRasterItem(3)

πŸ“¦ version 5.2.3a, in epel 9, fedora 43, fedora 44

πŸ’– 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 () 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)

πŸŽ€ 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 be QImage::Format_Indexed8, QImage::Format_RGB32 or QImage::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 by renderImage() will be set to alpha, beside those with an alpha value of 0 (invalid pixels).
  • alpha < 0 β€” The alpha values returned by renderImage() 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