QwtPlotSpectrogram(3)
π QwtPlotSpectrogram(3) β Library Functions Manual π
πΈ NAME πΈ
okay so bestie, QwtPlotSpectrogram is a plot item that displays a spectrogram. That's the whole name vibe, no cap π
β¨ SYNOPSIS β¨
#include <qwt_plot_spectrogram.h>
Inherits QwtPlotRasterItem.
𧬠Public Types π§¬
enum DisplayMode { ImageMode = 0x01, ContourMode = 0x02 }β the display-mode enum, iconic.typedef QFlags< DisplayMode > DisplayModesβ a flags combo for those display modes.
π Public Types inherited from QwtPlotRasterItem π
enum CachePolicy { NoCache, PaintCache }β cache policy vibes; the default policy isNoCache.enum PaintAttribute { PaintInDeviceResolution = 1 }β paint attribute energy.typedef QFlags< PaintAttribute > PaintAttributesβ flags combo for paint attributes.
π Public Types inherited from QwtPlotItem π
enum RttiValues { Rtti_PlotItem = 0, Rtti_PlotGrid, Rtti_PlotScale,
Rtti_PlotLegend, Rtti_PlotMarker, Rtti_PlotCurve,
Rtti_PlotSpectroCurve, Rtti_PlotIntervalCurve, Rtti_PlotHistogram,
Rtti_PlotSpectrogram, Rtti_PlotGraphic, Rtti_PlotTradingCurve,
Rtti_PlotBarChart, Rtti_PlotMultiBarChart, Rtti_PlotShape,
Rtti_PlotTextLabel, Rtti_PlotZone, Rtti_PlotVectorField,
Rtti_PlotUserItem = 1000 }
Runtime type information, periodt.
enum ItemAttribute { Legend = 0x01, AutoScale = 0x02, Margins = 0x04 }β plot item attributes, lowkey essential.enum ItemInterest { ScaleInterest = 0x01, LegendInterest = 0x02 }β plot item interests.enum RenderHint { RenderAntialiased = 0x1 }β render hints, cute.typedef QFlags< ItemAttribute > ItemAttributesβ flags for item attributes.typedef QFlags< ItemInterest > ItemInterestsβ flags for item interests.typedef QFlags< RenderHint > RenderHintsβ flags for render hints.
π Public Member Functions π
QwtPlotSpectrogram (const QString &title=QString())β constructor bestie.virtual ~QwtPlotSpectrogram ()β destructor.void setDisplayMode (DisplayMode, bool on=true)β set a display mode on or off.bool testDisplayMode (DisplayMode) constβ check whether a display mode is on.void setData (QwtRasterData *data)β give it the raster data.const QwtRasterData * data () constβ const access to the data.QwtRasterData * data ()β non-const access to the data.void setColorMap (QwtColorMap *)β set the color map.const QwtColorMap * colorMap () constβ get the color map.void setColorTableSize (int numColors)β set how many colors are in the color table.int colorTableSize () constβ get the color table size.virtual QwtInterval interval (Qt::Axis) const overrideβ interval override.virtual QRectF pixelHint (const QRectF &) const overrideβ pixel hint.void setDefaultContourPen (const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)β set the default contour pen from a color, width, and pen style.void setDefaultContourPen (const QPen &)β set the default pen for the contour lines.QPen defaultContourPen () constβ get the default contour pen.virtual QPen contourPen (double level) constβ calculate the pen for a contour line.void setConrecFlag (QwtRasterData::ConrecFlag, bool on)β set a CONREC flag.bool testConrecFlag (QwtRasterData::ConrecFlag) constβ check a CONREC flag.void setContourLevels (const QList< double > &)β set the contour levels.QList< double > contourLevels () constβ get the contour levels.virtual int rtti () const overrideβ runtime type info override.virtual void draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const overrideβ draw the spectrogram.
π«Ά Public Member Functions inherited from QwtPlotRasterItem π«Ά
QwtPlotRasterItem (const QString &title=QString())β constructor.QwtPlotRasterItem (const QwtText &title)β constructor.virtual ~QwtPlotRasterItem ()β destructor.void setPaintAttribute (PaintAttribute, bool on=true)β set a paint attribute.bool testPaintAttribute (PaintAttribute) constβ test a paint attribute.void setAlpha (int alpha)β set an alpha value for the raster data.int alpha () constβ get the alpha value.void setCachePolicy (CachePolicy)β set the cache policy.CachePolicy cachePolicy () constβ get the cache policy.void invalidateCache ()β invalidate the cache.virtual QRectF boundingRect () const overrideβ bounding rectangle override.
π¦ Public Member Functions inherited from QwtPlotItem π¦
QwtPlotItem ()β constructor.QwtPlotItem (const QString &title)β constructor.QwtPlotItem (const QwtText &title)β constructor.virtual ~QwtPlotItem ()β destroy theQwtPlotItem.void attach (QwtPlot *plot)β attach the item to a plot.void detach ()β this method detaches aQwtPlotItemfrom anyQwtPlotit has been associated with.QwtPlot * plot () constβ return attached plot.void setTitle (const QString &title)β set the title.void setTitle (const QwtText &title)β set the title asQwtText.const QwtText & title () constβ get the title.void setItemAttribute (ItemAttribute, bool on=true)β set an item attribute.bool testItemAttribute (ItemAttribute) constβ test an item attribute.void setItemInterest (ItemInterest, bool on=true)β set an item interest.bool testItemInterest (ItemInterest) constβ test an item interest.void setRenderHint (RenderHint, bool on=true)β set a render hint.bool testRenderHint (RenderHint) constβ test a render hint.void setRenderThreadCount (uint numThreads)β set the render thread count.uint renderThreadCount () constβ get the render thread count.void setLegendIconSize (const QSize &)β set the legend icon size.QSize legendIconSize () constβ get the legend icon size.double z () constβ get the z value.void setZ (double z)β set the z value.void show ()β show the item.void hide ()β hide the item.virtual void setVisible (bool)β set visibility.bool isVisible () constβ is it visible?void setAxes (QwtAxisId xAxis, QwtAxisId yAxis)β set both axes.void setXAxis (QwtAxisId)β set the x axis.QwtAxisId xAxis () constβ returnxAxis.void setYAxis (QwtAxisId)β set the y axis.QwtAxisId yAxis () constβ returnyAxis.virtual void itemChanged ()β item changed hook.virtual void legendChanged ()β legend changed hook.virtual void getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) constβ calculate a hint for the canvas margin.virtual void updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &)β update the item to changes of the axes scale division.virtual void updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &)β update the item to changes of the legend info.QRectF scaleRect (const QwtScaleMap &, const QwtScaleMap &) constβ calculate the bounding scale rectangle of 2 maps.QRectF paintRect (const QwtScaleMap &, const QwtScaleMap &) constβ calculate the bounding paint rectangle of 2 maps.virtual QList< QwtLegendData > legendData () constβ return all information that is needed to represent the item on the legend.virtual QwtGraphic legendIcon (int index, const QSizeF &) constβ legend icon hook.
π₯ Protected Member Functions π₯
virtual QImage renderImage (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &area, const QSize &imageSize) const overrideβ render an image from data and color map.virtual QSize contourRasterSize (const QRectF &, const QRect &) constβ return the raster to be used by the CONREC contour algorithm.virtual QwtRasterData::ContourLines renderContourLines (const QRectF &rect, const QSize &raster) constβ render contour lines.virtual void drawContourLines (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtRasterData::ContourLines &) constβ draw contour lines.void renderTile (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &tile, QImage *) constβ render a tile of an image.
πΈ Protected Member Functions inherited from QwtPlotRasterItem πΈ
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.
π Protected Member Functions inherited from QwtPlotItem π
QwtGraphic defaultIcon (const QBrush &, const QSizeF &) constβ return a default icon from a brush.
π DETAILED DESCRIPTION π
A plot item, which displays a spectrogram. That's the main-character energy right there π
A spectrogram displays 3-dimensional data, where the 3rd dimension (the intensity) is displayed using colors. The colors are calculated from the values using a color map. So pretty, so math, we love to see it β¨
On multi-core systems the performance of the image composition can often be improved by dividing the area into tiles β each of them rendered in a different thread (see QwtPlotItem::setRenderThreadCount()). fr fr, tiling goes hard.
In ContourMode contour lines are painted for the contour levels. iconic behavior.
See also:QwtRasterData,QwtColorMap,QwtPlotItem::setRenderThreadCount()
Definition at line 36 of file qwt_plot_spectrogram.h.
π§ MEMBER TYPEDEF DOCUMENTATION π§
okay so this one:
typedef QFlags<DisplayMode > QwtPlotSpectrogram::DisplayModes
An ORed combination of DisplayMode values. No cap, it's literally a flags combo.
Definition at line 53 of file qwt_plot_spectrogram.h.
π MEMBER ENUMERATION DOCUMENTATION π
enum QwtPlotSpectrogram::DisplayMode
The display mode controls how the raster data will be represented. vibe check for your data rendering π
See also:setDisplayMode(),testDisplayMode()
Enumerator
ImageModeβ the values are mapped to colors using a color map. slay.ContourModeβ the data is displayed using contour lines. also slay.
Definition at line 44 of file qwt_plot_spectrogram.h.
π CONSTRUCTOR & DESTRUCTOR DOCUMENTATION π
QwtPlotSpectrogram::QwtPlotSpectrogram (const QString & title = QString())
[explicit]
Sets the following item attributes:
QwtPlotItem::AutoScale:trueQwtPlotItem::Legend:false
The z value is initialized by 8.0. periodt.
Parameters
- title β Title
See also:QwtPlotItem::setItemAttribute(),QwtPlotItem::setZ()
Definition at line 108 of file qwt_plot_spectrogram.cpp.
QwtPlotSpectrogram::~QwtPlotSpectrogram ()
[virtual]
Destructor. bye bestie π
Definition at line 120 of file qwt_plot_spectrogram.cpp.
β MEMBER FUNCTION DOCUMENTATION β
const QwtColorMap * QwtPlotSpectrogram::colorMap () const
Returns: Color Map used for mapping the intensity values to colors. the glow-up map, iykyk.
See also: setColorMap()
Definition at line 200 of file qwt_plot_spectrogram.cpp.
int QwtPlotSpectrogram::colorTableSize () const
Returns: Size of the color table; 0 means not using a color table. zero means no table, bestie, don't forget.
See also:QwtColorMap::colorTable(),setColorTableSize()
Definition at line 238 of file qwt_plot_spectrogram.cpp.
QList< double > QwtPlotSpectrogram::contourLevels () const
Returns: Levels of the contour lines.
The levels are sorted in increasing order. lowkey tidy.
See also:contourLevels(),renderContourLines(),QwtRasterData::contourLines()
Definition at line 382 of file qwt_plot_spectrogram.cpp.
QPen QwtPlotSpectrogram::contourPen (double level) const
[virtual]
Calculate the pen for a contour line. The color of the pen is the color for level calculated by the color map. cute pen logic, no cap ποΈ
Parameters
- level β Contour level
Returns: Pen for the contour line
Note:contourPenis only used ifdefaultContourPen().style() == Qt::NoPen. that's the rule, bestie, don't skip it.
See also:setDefaultContourPen(),setColorMap(),setContourLevels()
Definition at line 303 of file qwt_plot_spectrogram.cpp.
QSize QwtPlotSpectrogram::contourRasterSize (const QRectF & area, const QRect & rect) const [protected], [virtual]
Return the raster to be used by the CONREC contour algorithm. A larger size will improve the precision of the CONREC algorithm, but will slow down the time that is needed to calculate the lines. it's giving "more precision, more waiting" energy π
The default implementation returns rect.size() / 2 bounded to the resolution depending on pixelSize().
Parameters
- area β Rectangle, where to calculate the contour lines
- rect β Rectangle in pixel coordinates, where to paint the contour lines
Returns: Raster to be used by the CONREC contour algorithm.
Note: The size will be bounded to rect.size().
See also: drawContourLines(), QwtRasterData::contourLines().
Definition at line 663 of file qwt_plot_spectrogram.cpp.
π data() β the non-const getter
QwtRasterData * QwtPlotSpectrogram::data ()
Returns the spectrogram data, bestie.
- Returns: Spectrogram data
- See also:
setData() - Definition at line 418 of file
qwt_plot_spectrogram.cpp.
β¨ data() const β the const getter
const QwtRasterData * QwtPlotSpectrogram::data () const
Same data vibes, but const this time. Iconic.
- Returns: Spectrogram data
- See also:
setData() - Definition at line 409 of file
qwt_plot_spectrogram.cpp.
π defaultContourPen()
QPen QwtPlotSpectrogram::defaultContourPen () const
Returns the default contour pen.
- Returns: Default contour pen
- See also:
setDefaultContourPen() - Definition at line 287 of file
qwt_plot_spectrogram.cpp.
π¦ draw() β main character draw energy
void QwtPlotSpectrogram::draw (QPainter * painter, const QwtScaleMap & xMap,
const QwtScaleMap & yMap, const QRectF & canvasRect) const [override],
[virtual]
Draws the spectrogram. Slay.
- Parameters:
painterβ PainterxMapβ Maps x-values into pixel coordinates.yMapβ Maps y-values into pixel coordinates.canvasRectβ Contents rectangle of the canvas in painter coordinates
- See also:
setDisplayMode(),renderImage(),QwtPlotRasterItem::draw(),drawContourLines() - Reimplemented from
QwtPlotRasterItem. - Definition at line 754 of file
qwt_plot_spectrogram.cpp.
πΈ drawContourLines() β protected contour painting
void QwtPlotSpectrogram::drawContourLines (QPainter * painter, const
QwtScaleMap & xMap, const QwtScaleMap & yMap, const
QwtRasterData::ContourLines & contourLines) const [protected],
[virtual]
Paints the contour lines. Very demure, very contour.
- Parameters:
painterβ PainterxMapβ Maps x-values into pixel coordinates.yMapβ Maps y-values into pixel coordinates.contourLinesβ Contour lines
- See also:
renderContourLines(),defaultContourPen(),contourPen() - Definition at line 709 of file
qwt_plot_spectrogram.cpp.
π«Ά interval() β bounding interval tea
QwtInterval QwtPlotSpectrogram::interval (Qt::Axis axis) const [override],
[virtual]
Gives you the bounding interval for an axis.
The default implementation returns the interval of the associated raster data object.
- Parameters:
axisβ X, Y, or Z axis
- Returns: Bounding interval for an axis
- See also:
QwtRasterData::interval() - Reimplemented from
QwtPlotRasterItem. - Definition at line 432 of file
qwt_plot_spectrogram.cpp.
π pixelHint() β pixel geometry detective
QRectF QwtPlotSpectrogram::pixelHint (const QRectF & area) const [override],
[virtual]
Pixel hint. The geometry of a pixel is used to calculated the resolution and alignment of the rendered image.
The default implementation returns data()->pixelHint( rect );
- Parameters:
areaβ In most implementations the resolution of the data doesn't depend on the requested area.
- Returns: Bounding rectangle of a pixel
- See also:
QwtPlotRasterItem::pixelHint(),QwtRasterData::pixelHint(),render(),renderImage() - Reimplemented from
QwtPlotRasterItem. - Definition at line 456 of file
qwt_plot_spectrogram.cpp.
π₯ renderContourLines() β protected contour calculation
QwtRasterData::ContourLines QwtPlotSpectrogram::renderContourLines (const
QRectF & rect, const QSize & raster) const [protected], [virtual]
Calculates contour lines. Math but make it fashion.
- Parameters:
rectβ Rectangle, where to calculate the contour linesrasterβ Raster, used by the CONREC algorithm
- Returns: Calculated contour lines
- See also:
contourLevels(),setConrecFlag(),QwtRasterData::contourLines() - Definition at line 689 of file
qwt_plot_spectrogram.cpp.
π renderImage() β pixels into colors
QImage QwtPlotSpectrogram::renderImage (const QwtScaleMap & xMap, const
QwtScaleMap & yMap, const QRectF & area, const QSize & imageSize) const
[override], [protected], [virtual]
Render an image from data and color map. For each pixel of area the value is mapped into a color.
- Parameters:
xMapβ X-Scale MapyMapβ Y-Scale Mapareaβ Requested area for the image in scale coordinatesimageSizeβ Size of the requested image
- Returns: A
QImage::Format_Indexed8orQImage::Format_ARGB32depending on the color map. - See also:
QwtRasterData::value(),QwtColorMap::rgb(),QwtColorMap::colorIndex() - Implements
QwtPlotRasterItem. - Definition at line 480 of file
qwt_plot_spectrogram.cpp.
π renderTile() β tile-by-tile rendering
void QwtPlotSpectrogram::renderTile (const QwtScaleMap & xMap, const
QwtScaleMap & yMap, const QRect & tile, QImage * image) const
[protected]
Render a tile of an image. Rendering in tiles can be used to composite an image in parallel threads.
- Parameters:
xMapβ X-Scale MapyMapβ Y-Scale Maptileβ Geometry of the tile in image coordinatesimageβ Image to be rendered
- Definition at line 572 of file
qwt_plot_spectrogram.cpp.
π rtti() β runtime type info check
int QwtPlotSpectrogram::rtti () const [override], [virtual]
- Returns:
QwtPlotItem::Rtti_PlotSpectrogram - Reimplemented from
QwtPlotItem. - Definition at line 126 of file
qwt_plot_spectrogram.cpp.
π setColorMap() β change the color map
void QwtPlotSpectrogram::setColorMap (QwtColorMap * colorMap)
Change the color map.
Often it is useful to display the mapping between intensities and colors as an additional plot axis, showing a color bar.
- Parameters:
colorMapβ Color Map
- See also:
colorMap(),QwtScaleWidget::setColorBarEnabled(),QwtScaleWidget::setColorMap() - Definition at line 177 of file
qwt_plot_spectrogram.cpp.
π setColorTableSize() β color table size limit
void QwtPlotSpectrogram::setColorTableSize (int numColors)
Limit the number of colors being used by the color map.
When using a color table the mapping from the value into a color is usually faster as it can be done by simple lookups into a precalculated color table.
Setting a table size > 0 enables using a color table, while setting the size to 0 disables it.
The default size = 0, and no color table is used.
- Parameters:
numColorsβ Number of colors. 0 means not using a color table
- Note: The colorTableSize has no effect when using a color table of
QwtColorMap::Indexed, where the size is always 256. - See also:
QwtColorMap::colorTable(),colorTableSize() - Definition at line 224 of file
qwt_plot_spectrogram.cpp.
π§ setConrecFlag() β CONREC algorithm switch
void QwtPlotSpectrogram::setConrecFlag (QwtRasterData::ConrecFlag flag, bool
on)
Modify an attribute of the CONREC algorithm, used to calculate the contour lines.
- Parameters:
flagβ CONREC flagonβ On/Off
- See also:
testConrecFlag(),renderContourLines(),QwtRasterData::contourLines() - Definition at line 324 of file
qwt_plot_spectrogram.cpp.
π setContourLevels() β set those contour levels
void QwtPlotSpectrogram::setContourLevels (const QList< double > & levels)
Set the levels of the contour lines.
- Parameters:
levelsβ Values of the contour levels
- See also:
contourLevels(),renderContourLines(),QwtRasterData::contourLines() - Note:
contourLevelsreturns the same levels but sorted. - Definition at line 365 of file
qwt_plot_spectrogram.cpp.
π setData() β give it the data
void QwtPlotSpectrogram::setData (QwtRasterData * data)
Set the data to be displayed.
- Parameters:
dataβ Spectrogram Data
- See also:
data() - Definition at line 393 of file
qwt_plot_spectrogram.cpp.
πΈ setDefaultContourPen() β color, width, style edition
void QwtPlotSpectrogram::setDefaultContourPen (const QColor & color, qreal
width = 0.0, Qt::PenStyle style = Qt::SolidLine)
Build and assign the default pen for the contour lines.
In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it non cosmetic ( see QPen::isCosmetic() ). This method has been introduced to hide this incompatibility.
- Parameters:
colorβ Pen colorwidthβ Pen widthstyleβ Pen style
- See also:
pen(),brush() - Definition at line 256 of file
qwt_plot_spectrogram.cpp.
π¦ setDefaultContourPen() β pen object edition
void QwtPlotSpectrogram::setDefaultContourPen (const QPen & pen)
Set the default pen for the contour lines. If the spectrogram has a valid default contour pen a contour line is painted using the default contour pen. Otherwise (pen.style() == Qt::NoPen) the pen is calculated for each contour level using contourPen().
- See also:
defaultContourPen(),contourPen() - Definition at line 272 of file
qwt_plot_spectrogram.cpp.
β¨ setDisplayMode() β display mode toggle
void QwtPlotSpectrogram::setDisplayMode (DisplayMode mode, bool on = true)
The display mode controls how the raster data will be represented.
- Parameters:
modeβ Display modeonβ On/Off
- The default setting enables
ImageMode. - See also:
DisplayMode,displayMode() - Definition at line 141 of file
qwt_plot_spectrogram.cpp.
π testConrecFlag() β check that CONREC flag
bool QwtPlotSpectrogram::testConrecFlag (QwtRasterData::ConrecFlag flag)
const
Test an attribute of the CONREC algorithm, used to calculate the contour lines.
- Parameters:
flagβ CONREC flag
- Returns:
true, is enabled - The default setting enables
QwtRasterData::IgnoreAllVerticesOnLevel - See also:
setConrecClag(),renderContourLines(),QwtRasterData::contourLines() - Definition at line 350 of file
qwt_plot_spectrogram.cpp.
π testDisplayMode() β is that mode on?
bool QwtPlotSpectrogram::testDisplayMode (DisplayMode mode) const
The display mode controls how the raster data will be represented.
- Parameters:
modeβ Display mode
- Returns:
trueif mode is enabled - Definition at line 161 of file
qwt_plot_spectrogram.cpp.
π AUTHOR π
Generated automatically by Doxygen for Qwt User's Guide from the source code.
And thatβs the whole page, bestie π β source/version: Qwt User's Guide, page QwtPlotSpectrogram(3). The date lives in the original footer, and weβre not copy-pasting that line, just giving it a little kiss ππ
.
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms