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
Display modes.
Public Member Functions¶
QwtPlotSpectrogram (const QString &title=QString::null)
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
virtual QwtInterval interval (Qt::Axis) const
virtual QRectF pixelHint (const QRectF &) const
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
virtual void draw (QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &rect) const
Draw the spectrogram.
Protected Member Functions¶
virtual QImage renderImage (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &area, const QSize &imageSize) const
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 *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtRasterData::ContourLines &lines) const
void renderTile (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &imageRect, QImage *image) 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:
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.
Constructor & Destructor Documentation¶
QwtPlotSpectrogram::QwtPlotSpectrogram (const QString &title = QString::null) [explicit]¶
Sets the following item attributes:- QwtPlotItem::AutoScale: true
- QwtPlotItem::Legend: false
The z value is initialized by 8.0.
Parameters:
See Also:
Member Function Documentation¶
const QwtColorMap * QwtPlotSpectrogram::colorMap () const¶
Returns:See Also:
QList< double > QwtPlotSpectrogram::contourLevels () const¶
Returns:The levels are sorted in increasing order.
See Also:
QPen QwtPlotSpectrogram::contourPen (doublelevel) const [virtual]¶
Calculate the pen for a contour line. The color of the pen is the color for level calculated by the color mapParameters:
Returns:
Note:
See Also:
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:
const QwtRasterData * QwtPlotSpectrogram::data () const¶
Returns:See Also:
QwtRasterData * QwtPlotSpectrogram::data ()¶
Returns:See Also:
QPen QwtPlotSpectrogram::defaultContourPen () const¶
Returns:See Also:
void QwtPlotSpectrogram::draw (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const [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.
void QwtPlotSpectrogram::drawContourLines (QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QwtRasterData::ContourLines &contourLines) const [protected], [virtual]¶
Paint the contour linesParameters:
xMap Maps x-values into pixel coordinates.
yMap Maps y-values into pixel coordinates.
contourLines Contour lines
See Also:
QwtInterval QwtPlotSpectrogram::interval (Qt::Axisaxis) const [virtual]¶
Returns:The default implementation returns the interval of the associated raster data object.
Parameters:
See Also:
Reimplemented from QwtPlotRasterItem.
QRectF QwtPlotSpectrogram::pixelHint (const QRectF &area) const [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.
QwtRasterData::ContourLines QwtPlotSpectrogram::renderContourLines (const QRectF &rect, const QSize &raster) const [protected], [virtual]¶
Calculate contour linesParameters:
raster Raster, used by the CONREC algorithm
Returns:
See Also:
QImage QwtPlotSpectrogram::renderImage (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &area, const QSize &imageSize) const [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.
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
int QwtPlotSpectrogram::rtti () const [virtual]¶
Returns:Reimplemented from QwtPlotItem.
void QwtPlotSpectrogram::setColorMap (QwtColorMap *colorMap)¶
Change the color mapOften it is useful to display the mapping between intensities and colors as an additional plot axis, showing a color bar.
Parameters:
See Also:
void QwtPlotSpectrogram::setConrecFlag (QwtRasterData::ConrecFlagflag, boolon)¶
Modify an attribute of the CONREC algorithm, used to calculate the contour lines.Parameters:
on On/Off
See Also:
void QwtPlotSpectrogram::setContourLevels (const QList< double > &levels)¶
Set the levels of the contour linesParameters:
See Also:
Note:
void QwtPlotSpectrogram::setData (QwtRasterData *data)¶
Set the data to be displayedParameters:
See Also:
void QwtPlotSpectrogram::setDefaultContourPen (const QColor &color, qrealwidth = 0.0, Qt::PenStylestyle = Qt::SolidLine)¶
Build and assign the default pen for the contour linesIn 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:
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:
void QwtPlotSpectrogram::setDisplayMode (DisplayModemode, boolon = true)¶
The display mode controls how the raster data will be represented.Parameters:
on On/Off
The default setting enables ImageMode.
See Also:
bool QwtPlotSpectrogram::testConrecFlag (QwtRasterData::ConrecFlagflag) const¶
Test an attribute of the CONREC algorithm, used to calculate the contour lines.Parameters:
Returns:
The default setting enables QwtRasterData::IgnoreAllVerticesOnLevel
See Also:
bool QwtPlotSpectrogram::testDisplayMode (DisplayModemode) const¶
The display mode controls how the raster data will be represented.Parameters:
Returns:
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.Thu Dec 11 2014 | Version 6.1.2 |