- bookworm 6.1.4-2
- testing 6.1.4-2
- unstable 6.1.4-2
- experimental 6.2.0-1
QwtPlotSpectrogram(3) | Qwt User's Guide | QwtPlotSpectrogram(3) |
NAME¶
QwtPlotSpectrogram - A plot item, which displays a spectrogram.
SYNOPSIS¶
#include <qwt_plot_spectrogram.h>
Inherits QwtPlotRasterItem.
Public Types¶
enum DisplayMode { ImageMode = 0x01,
ContourMode = 0x02 }
typedef QFlags< DisplayMode > DisplayModes
Public Member Functions¶
QwtPlotSpectrogram (const QString
&title=QString())
virtual ~QwtPlotSpectrogram ()
Destructor. void setDisplayMode (DisplayMode, bool on=true)
bool testDisplayMode (DisplayMode) const
void setData (QwtRasterData *data)
const QwtRasterData * data () const
QwtRasterData * data ()
void setColorMap (QwtColorMap *)
const QwtColorMap * colorMap () const
void setColorTableSize (int numColors)
int colorTableSize () const
virtual QwtInterval interval (Qt::Axis) const override
virtual QRectF pixelHint (const QRectF &) const override
Pixel hint. void setDefaultContourPen (const QColor &, qreal
width=0.0, Qt::PenStyle=Qt::SolidLine)
void setDefaultContourPen (const QPen &)
Set the default pen for the contour lines. QPen defaultContourPen ()
const
virtual QPen contourPen (double level) const
Calculate the pen for a contour line. void setConrecFlag
(QwtRasterData::ConrecFlag, bool on)
bool testConrecFlag (QwtRasterData::ConrecFlag) const
void setContourLevels (const QList< double > &)
QList< double > contourLevels () const
virtual int rtti () const override
virtual void draw (QPainter *, const QwtScaleMap &xMap,
const QwtScaleMap &yMap, const QRectF &canvasRect) const
override
Draw the spectrogram.
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
virtual void drawContourLines (QPainter *, const QwtScaleMap
&xMap, const QwtScaleMap &yMap, const
QwtRasterData::ContourLines &) const
void renderTile (const QwtScaleMap &xMap, const
QwtScaleMap &yMap, const QRect &tile, QImage *) const
Render a tile of an image.
Detailed Description¶
A plot item, which displays a spectrogram.
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.
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() ).
In ContourMode contour lines are painted for the contour levels.
See also
Definition at line 36 of file qwt_plot_spectrogram.h.
Member Typedef Documentation¶
typedef QFlags<DisplayMode > QwtPlotSpectrogram::DisplayModes¶
An ORed combination of DisplayMode values.
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.
See also
Enumerator
- ImageMode
- The values are mapped to colors using a color map.
- ContourMode
- The data is displayed using contour lines.
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: true
- QwtPlotItem::Legend: false
The z value is initialized by 8.0.
Parameters
See also
Definition at line 108 of file qwt_plot_spectrogram.cpp.
Member Function Documentation¶
const QwtColorMap * QwtPlotSpectrogram::colorMap () const¶
Returns
See also
Definition at line 200 of file qwt_plot_spectrogram.cpp.
int QwtPlotSpectrogram::colorTableSize () const¶
Returns
See also
Definition at line 238 of file qwt_plot_spectrogram.cpp.
QList< double > QwtPlotSpectrogram::contourLevels () const¶
Returns
The levels are sorted in increasing order.
See also
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
Parameters
Returns
Note
See also
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.
The default implementation returns rect.size() / 2 bounded to the resolution depending on pixelSize().
Parameters
rect Rectangle in pixel coordinates, where to paint the contour lines
Returns
Note
See also
Definition at line 663 of file qwt_plot_spectrogram.cpp.
QwtRasterData * QwtPlotSpectrogram::data ()¶
Returns
See also
Definition at line 418 of file qwt_plot_spectrogram.cpp.
const QwtRasterData * QwtPlotSpectrogram::data () const¶
Returns
See also
Definition at line 409 of file qwt_plot_spectrogram.cpp.
QPen QwtPlotSpectrogram::defaultContourPen () const¶
Returns
See also
Definition at line 287 of file qwt_plot_spectrogram.cpp.
void QwtPlotSpectrogram::draw (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect) const [override], [virtual]¶
Draw the spectrogram.
Parameters
xMap Maps x-values into pixel coordinates.
yMap Maps y-values into pixel coordinates.
canvasRect Contents rectangle of the canvas in painter coordinates
See also
Reimplemented from QwtPlotRasterItem.
Definition at line 754 of file qwt_plot_spectrogram.cpp.
void QwtPlotSpectrogram::drawContourLines (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QwtRasterData::ContourLines & contourLines) const [protected], [virtual]¶
Paint the contour lines
Parameters
xMap Maps x-values into pixel coordinates.
yMap Maps y-values into pixel coordinates.
contourLines Contour lines
See also
Definition at line 709 of file qwt_plot_spectrogram.cpp.
QwtInterval QwtPlotSpectrogram::interval (Qt::Axis axis) const [override], [virtual]¶
Returns
The default implementation returns the interval of the associated raster data object.
Parameters
See also
Reimplemented from QwtPlotRasterItem.
Definition at line 432 of file qwt_plot_spectrogram.cpp.
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
Returns
See also
Reimplemented from QwtPlotRasterItem.
Definition at line 456 of file qwt_plot_spectrogram.cpp.
QwtRasterData::ContourLines QwtPlotSpectrogram::renderContourLines (const QRectF & rect, const QSize & raster) const [protected], [virtual]¶
Calculate contour lines
Parameters
raster Raster, used by the CONREC algorithm
Returns
See also
Definition at line 689 of file qwt_plot_spectrogram.cpp.
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
yMap Y-Scale Map
area Requested area for the image in scale coordinates
imageSize Size of the requested image
Returns
See also
Implements QwtPlotRasterItem.
Definition at line 480 of file qwt_plot_spectrogram.cpp.
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
yMap Y-Scale Map
tile Geometry of the tile in image coordinates
image Image to be rendered
Definition at line 572 of file qwt_plot_spectrogram.cpp.
int QwtPlotSpectrogram::rtti () const [override], [virtual]¶
Returns
Reimplemented from QwtPlotItem.
Definition at line 126 of file qwt_plot_spectrogram.cpp.
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
See also
Definition at line 177 of file qwt_plot_spectrogram.cpp.
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
Note
See also
Definition at line 224 of file qwt_plot_spectrogram.cpp.
void QwtPlotSpectrogram::setConrecFlag (QwtRasterData::ConrecFlag flag, bool on)¶
Modify an attribute of the CONREC algorithm, used to calculate the contour lines.
Parameters
on On/Off
See also
Definition at line 324 of file qwt_plot_spectrogram.cpp.
void QwtPlotSpectrogram::setContourLevels (const QList< double > & levels)¶
Set the levels of the contour lines
Parameters
See also
Note
Definition at line 365 of file qwt_plot_spectrogram.cpp.
void QwtPlotSpectrogram::setData (QwtRasterData * data)¶
Set the data to be displayed
Parameters
See also
Definition at line 393 of file qwt_plot_spectrogram.cpp.
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
width Pen width
style Pen style
See also
Definition at line 256 of file qwt_plot_spectrogram.cpp.
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
Definition at line 272 of file qwt_plot_spectrogram.cpp.
void QwtPlotSpectrogram::setDisplayMode (DisplayMode mode, bool on = true)¶
The display mode controls how the raster data will be represented.
Parameters
on On/Off
The default setting enables ImageMode.
See also
Definition at line 141 of file qwt_plot_spectrogram.cpp.
bool QwtPlotSpectrogram::testConrecFlag (QwtRasterData::ConrecFlag flag) const¶
Test an attribute of the CONREC algorithm, used to calculate the contour lines.
Parameters
Returns
The default setting enables QwtRasterData::IgnoreAllVerticesOnLevel
See also
Definition at line 350 of file qwt_plot_spectrogram.cpp.
bool QwtPlotSpectrogram::testDisplayMode (DisplayMode mode) const¶
The display mode controls how the raster data will be represented.
Parameters
Returns
Definition at line 161 of file qwt_plot_spectrogram.cpp.
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Sun Jul 18 2021 | Version 6.2.0 |