QwtRasterData(3)

okay so you opened QwtRasterData(3) in the Library Functions Manual, and it’s giving abstract-interface main character energy πŸ’– buckle up, bestie.

πŸŽ€ NAME πŸŽ€

QwtRasterData β€” QwtRasterData defines an interface to any type of raster data.

✨ SYNOPSIS ✨

#include <qwt_raster_data.h>

Inherited by QwtMatrixRasterData.

πŸ’– Public Types

  • enum Attribute { WithoutGaps = 0x01 } β€” Raster data attributes.
  • enum ConrecFlag { IgnoreAllVerticesOnLevel = 0x01, IgnoreOutOfRange = 0x02 } β€” Flags to modify the contour algorithm.
  • typedef QMap< double, QPolygonF > ContourLines β€” Contour lines.
  • typedef QFlags< Attribute > Attributes
  • typedef QFlags< ConrecFlag > ConrecFlags

🫢 Public Member Functions

  • QwtRasterData () β€” Constructor.
  • virtual ~QwtRasterData () β€” Destructor.
  • void setAttribute (Attribute, bool on=true)
  • bool testAttribute (Attribute) const
  • virtual QwtInterval interval (Qt::Axis) const =0
  • virtual QRectF pixelHint (const QRectF &) const β€” Pixel hint.
  • virtual void initRaster (const QRectF &, const QSize &raster) β€” Initialize a raster.
  • virtual void discardRaster () β€” Discard a raster.
  • virtual double value (double x, double y) const =0
  • virtual ContourLines contourLines (const QRectF &rect, const QSize &raster, const QList< double > &levels, ConrecFlags) const

🌸 Detailed Description 🌸

QwtRasterData defines an interface to any type of raster data. It’s an abstract interface, and QwtPlotRasterItem uses it to find the values at the pixels of its raster. No cap.

Gaps inside the bounding rectangle of the data can be indicated by NaN values β€” when WithoutGaps is disabled.

Often a raster item is used to display values from a matrix. In that case, the derived raster data class needs to implement some sort of resampling that maps the raster of the matrix into the requested raster of the raster item β€” depending on resolution and scales of the canvas. It’s giving β€œresample me, bestie” πŸ”₯

QwtMatrixRasterData implements raster data that returns values from a given 2D matrix.

See also: QwtMatrixRasterData

Definition at line 42 of file qwt_raster_data.h.

πŸ¦‹ Member Typedef Documentation πŸ¦‹

typedef QFlags<Attribute > QwtRasterData::Attributes

An ORed combination of Attribute values.

Definition at line 74 of file qwt_raster_data.h.

typedef QFlags<ConrecFlag > QwtRasterData::ConrecFlags

An ORed combination of ConrecFlag values.

Definition at line 86 of file qwt_raster_data.h.

typedef QMap< double, QPolygonF > QwtRasterData::ContourLines

Contour lines. Literally the contour-line container, slay.

Definition at line 46 of file qwt_raster_data.h.

🐚 Member Enumeration Documentation 🐚

enum QwtRasterData::Attribute

Raster data attributes. These are extra info used to improve processing of the data.

Enumerator

  • WithoutGaps β€” The bounding rectangle of the data is spanned by the interval(Qt::XAxis) and interval(Qt::YAxis).

WithoutGaps indicates that the data has no gaps (unknown values) in this area, and the result of value() does not need to be checked for NaN values.

Enabling this flag will have a positive effect on the performance of rendering a QwtPlotSpectrogram.

The default setting is false.

Note: NaN values indicate an undefined value.

Definition at line 54 of file qwt_raster_data.h.

enum QwtRasterData::ConrecFlag

Flags to modify the contour algorithm.

Enumerator

  • IgnoreAllVerticesOnLevel β€” Ignore all vertices on the same level.
  • IgnoreOutOfRange β€” Ignore all values that are out of range.

Definition at line 77 of file qwt_raster_data.h.

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

QwtRasterData::QwtRasterData ()

Constructor. Gotta start somewhere, bestie ✨

Definition at line 171 of file qwt_raster_data.cpp.

QwtRasterData::~QwtRasterData () [virtual]

Destructor. Cleanup era πŸ’…

Definition at line 177 of file qwt_raster_data.cpp.

πŸ’… Member Function Documentation πŸ’…

QwtRasterData::ContourLines QwtRasterData::contourLines (const QRectF & rect, const QSize & raster, const QList< double > & levels, ConrecFlags flags) const [virtual]

Calculate contour lines. It’s an adaption of CONREC, a simple contouring algorithm:

http://local.wasp.uwa.edu.au/~pbourke/papers/conrec/

Parameters

  • rect β€” Bounding rectangle for the contour lines
  • raster β€” Number of data pixels of the raster data
  • levels β€” List of limits, where to insert contour lines
  • flags β€” Flags to customize the contouring algorithm

Returns: Calculated contour lines.

Definition at line 286 of file qwt_raster_data.cpp.

void QwtRasterData::discardRaster () [virtual]

Discard a raster. After the composition of an image, QwtPlotSpectrogram calls discardRaster().

The default implementation does nothing, but if data has been loaded in initRaster(), it could be deleted now. Cleanup opportunity, iykyk.

See also: initRaster(), value()

Definition at line 237 of file qwt_raster_data.cpp.

void QwtRasterData::initRaster (const QRectF & area, const QSize & raster) [virtual]

Initialize a raster. Before the composition of an image, QwtPlotSpectrogram calls initRaster(), announcing the area and its resolution that will be requested.

The default implementation does nothing, but for data sets that are stored in files, it might be a good idea to reimplement initRaster(), where the data is resampled and loaded into memory.

Parameters

  • area β€” Area of the raster
  • raster β€” Number of horizontal and vertical pixels

See also: initRaster(), value()

Definition at line 221 of file qwt_raster_data.cpp.

virtual QwtInterval QwtRasterData::interval (Qt::Axis ) const [pure virtual]

Returns: Bounding interval for an axis.

See also: setInterval

Implemented in QwtMatrixRasterData.

QRectF QwtRasterData::pixelHint (const QRectF & area) const [virtual]

Pixel hint. pixelHint() returns the geometry of a pixel that can be used to calculate the resolution and alignment of the plot item representing the data.

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.

An empty hint indicates that there are values for any detail level.

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 recommending to render in target device (f.e. screen) resolution.

Parameters

  • area β€” In most implementations the resolution of the data doesn’t depend on the requested area.

Returns: Bounding rectangle of a pixel.

Reimplemented in QwtMatrixRasterData.

Definition at line 267 of file qwt_raster_data.cpp.

void QwtRasterData::setAttribute (Attribute attribute, bool on = true)

Specify an attribute of the data.

Parameters

  • attribute β€” Attribute
  • on β€” On/Off

See also: Attribute, testAttribute()

Definition at line 189 of file qwt_raster_data.cpp.

bool QwtRasterData::testAttribute (Attribute attribute) const

Returns: True, when attribute is enabled.

See also: Attribute, setAttribute()

Definition at line 201 of file qwt_raster_data.cpp.

virtual double QwtRasterData::value (double x, double y) const [pure virtual]

Returns: the value at a raster position.

Parameters

  • x β€” X value in plot coordinates
  • y β€” Y value in plot coordinates

Implemented in QwtMatrixRasterData.

⭐ Author ⭐

Generated automatically by Doxygen for Qwt User’s Guide from the source code.


cute sign-off time, bestie 🫢 the footer vibes are source/version Qwt User's Guide and page QwtRasterData(3) β€” and the original footer doesn’t give a date, so I’m not inventing one πŸ’…βœ¨

πŸ“¦ where this page comes from