Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_spectrogram.cpp
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (8 days ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_plot_spectrogram.cpp (modified) (35 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_spectrogram.cpp
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 13 13 #include "qwt_scale_map.h" 14 14 #include "qwt_color_map.h" 15 #include "qwt_math.h" 16 15 17 #include <qimage.h> 16 18 #include <qpen.h> 17 19 #include <qpainter.h> 18 #include <qmath.h>19 #include <qalgorithms.h>20 #if QT_VERSION >= 0x04040021 20 #include <qthread.h> 22 21 #include <qfuture.h> 23 22 #include <qtconcurrentrun.h> 23 24 #define DEBUG_RENDER 0 25 26 #if DEBUG_RENDER 27 #include <qelapsedtimer.h> 24 28 #endif 25 29 26 #define DEBUG_RENDER 0 27 28 #if DEBUG_RENDER 29 #include <QElapsedTimer> 30 #endif 30 #include <algorithm> 31 32 static inline bool qwtIsNaN( double d ) 33 { 34 // qt_is_nan is private header and qIsNaN is not inlined 35 // so we need these code here too 36 37 const uchar* ch = (const uchar*)&d; 38 if ( QSysInfo::ByteOrder == QSysInfo::BigEndian ) 39 { 40 return ( ch[0] & 0x7f ) == 0x7f && ch[1] > 0xf0; 41 } 42 else 43 { 44 return ( ch[7] & 0x7f ) == 0x7f && ch[6] > 0xf0; 45 } 46 } 31 47 32 48 class QwtPlotSpectrogram::PrivateData 33 49 { 34 public: 35 PrivateData(): 36 data( NULL ) 50 public: 51 PrivateData() 52 : data( NULL ) 53 , colorTableSize( 0 ) 37 54 { 38 55 colorMap = new QwtLinearColorMap(); … … 44 61 #endif 45 62 } 63 46 64 ~PrivateData() 47 65 { … … 50 68 } 51 69 52 QwtRasterData *data; 53 QwtColorMap *colorMap; 70 void updateColorTable() 71 { 72 if ( colorMap->format() == QwtColorMap::Indexed ) 73 { 74 colorTable = colorMap->colorTable256(); 75 } 76 else 77 { 78 if ( colorTableSize == 0 ) 79 colorTable.clear(); 80 else 81 colorTable = colorMap->colorTable( colorTableSize ); 82 } 83 } 84 85 QwtRasterData* data; 86 QwtColorMap* colorMap; 54 87 DisplayModes displayMode; 55 88 56 QList< double> contourLevels;89 QList< double > contourLevels; 57 90 QPen defaultContourPen; 58 91 QwtRasterData::ConrecFlags conrecFlags; 92 93 int colorTableSize; 94 QVector< QRgb > colorTable; 59 95 }; 60 96 … … 69 105 70 106 \sa QwtPlotItem::setItemAttribute(), QwtPlotItem::setZ() 71 */ 72 QwtPlotSpectrogram::QwtPlotSpectrogram( const QString &title ):73 QwtPlotRasterItem( title ) 74 { 75 d_data = new PrivateData();107 */ 108 QwtPlotSpectrogram::QwtPlotSpectrogram( const QString& title ) 109 : QwtPlotRasterItem( title ) 110 { 111 m_data = new PrivateData(); 76 112 77 113 setItemAttribute( QwtPlotItem::AutoScale, true ); … … 84 120 QwtPlotSpectrogram::~QwtPlotSpectrogram() 85 121 { 86 delete d_data;122 delete m_data; 87 123 } 88 124 … … 102 138 103 139 \sa DisplayMode, displayMode() 104 */ 140 */ 105 141 void QwtPlotSpectrogram::setDisplayMode( DisplayMode mode, bool on ) 106 142 { 107 if ( on != bool( mode & d_data->displayMode ) )143 if ( on != bool( mode & m_data->displayMode ) ) 108 144 { 109 145 if ( on ) 110 d_data->displayMode |= mode;146 m_data->displayMode |= mode; 111 147 else 112 d_data->displayMode &= ~mode;148 m_data->displayMode &= ~mode; 113 149 } 114 150 … … 122 158 \param mode Display mode 123 159 \return true if mode is enabled 124 */ 160 */ 125 161 bool QwtPlotSpectrogram::testDisplayMode( DisplayMode mode ) const 126 162 { 127 return ( d_data->displayMode & mode );128 } 129 130 /*! 131 Change the color map 132 133 Often it is useful to display the mapping between intensities and 134 colors as an additional plot axis, showing a color bar. 135 136 \param colorMap Color Map 137 138 \sa colorMap(), QwtScaleWidget::setColorBarEnabled(), 163 return ( m_data->displayMode & mode ); 164 } 165 166 /*! 167 Change the color map 168 169 Often it is useful to display the mapping between intensities and 170 colors as an additional plot axis, showing a color bar. 171 172 \param colorMap Color Map 173 174 \sa colorMap(), QwtScaleWidget::setColorBarEnabled(), 139 175 QwtScaleWidget::setColorMap() 140 */ 141 void QwtPlotSpectrogram::setColorMap( QwtColorMap *colorMap ) 142 { 143 if ( d_data->colorMap != colorMap ) 144 { 145 delete d_data->colorMap; 146 d_data->colorMap = colorMap; 147 } 176 */ 177 void QwtPlotSpectrogram::setColorMap( QwtColorMap* colorMap ) 178 { 179 if ( colorMap == NULL ) 180 return; 181 182 if ( colorMap != m_data->colorMap ) 183 { 184 delete m_data->colorMap; 185 m_data->colorMap = colorMap; 186 } 187 188 m_data->updateColorTable(); 148 189 149 190 invalidateCache(); … … 156 197 \return Color Map used for mapping the intensity values to colors 157 198 \sa setColorMap() 158 */ 159 const QwtColorMap *QwtPlotSpectrogram::colorMap() const 160 { 161 return d_data->colorMap; 162 } 163 164 /*! 165 Build and assign the default pen for the contour lines 166 167 In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it 168 non cosmetic ( see QPen::isCosmetic() ). This method has been introduced 169 to hide this incompatibility. 170 171 \param color Pen color 172 \param width Pen width 173 \param style Pen style 174 175 \sa pen(), brush() 199 */ 200 const QwtColorMap* QwtPlotSpectrogram::colorMap() const 201 { 202 return m_data->colorMap; 203 } 204 205 /*! 206 Limit the number of colors being used by the color map 207 208 When using a color table the mapping from the value into a color 209 is usually faster as it can be done by simple lookups into a 210 precalculated color table. 211 212 Setting a table size > 0 enables using a color table, while setting 213 the size to 0 disables it. 214 215 The default size = 0, and no color table is used. 216 217 \param numColors Number of colors. 0 means not using a color table 218 \note The colorTableSize has no effect when using a color table 219 of QwtColorMap::Indexed, where the size is always 256. 220 221 222 \sa QwtColorMap::colorTable(), colorTableSize() 223 */ 224 void QwtPlotSpectrogram::setColorTableSize( int numColors ) 225 { 226 numColors = qMax( numColors, 0 ); 227 if ( numColors != m_data->colorTableSize ) 228 { 229 m_data->colorTableSize = numColors; 230 m_data->updateColorTable(); 231 invalidateCache(); 232 } 233 } 234 /*! 235 \return Size of the color table, 0 means not using a color table 236 \sa QwtColorMap::colorTable(), setColorTableSize() 237 */ 238 int QwtPlotSpectrogram::colorTableSize() const 239 { 240 return m_data->colorTableSize; 241 } 242 243 /*! 244 Build and assign the default pen for the contour lines 245 246 In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it 247 non cosmetic ( see QPen::isCosmetic() ). This method has been introduced 248 to hide this incompatibility. 249 250 \param color Pen color 251 \param width Pen width 252 \param style Pen style 253 254 \sa pen(), brush() 176 255 */ 177 256 void QwtPlotSpectrogram::setDefaultContourPen( 178 const QColor &color, qreal width, Qt::PenStyle style )257 const QColor& color, qreal width, Qt::PenStyle style ) 179 258 { 180 259 setDefaultContourPen( QPen( color, width, style ) ); … … 190 269 191 270 \sa defaultContourPen(), contourPen() 192 */ 193 void QwtPlotSpectrogram::setDefaultContourPen( const QPen &pen )194 { 195 if ( pen != d_data->defaultContourPen )196 { 197 d_data->defaultContourPen = pen;271 */ 272 void QwtPlotSpectrogram::setDefaultContourPen( const QPen& pen ) 273 { 274 if ( pen != m_data->defaultContourPen ) 275 { 276 m_data->defaultContourPen = pen; 198 277 199 278 legendChanged(); … … 205 284 \return Default contour pen 206 285 \sa setDefaultContourPen() 207 */ 286 */ 208 287 QPen QwtPlotSpectrogram::defaultContourPen() const 209 288 { 210 return d_data->defaultContourPen;289 return m_data->defaultContourPen; 211 290 } 212 291 … … 221 300 222 301 \sa setDefaultContourPen(), setColorMap(), setContourLevels() 223 */ 302 */ 224 303 QPen QwtPlotSpectrogram::contourPen( double level ) const 225 304 { 226 if ( d_data->data == NULL ||d_data->colorMap == NULL )305 if ( m_data->data == NULL || m_data->colorMap == NULL ) 227 306 return QPen(); 228 307 229 const QwtInterval intensityRange = d_data->data->interval(Qt::ZAxis);230 const QColor c( d_data->colorMap->rgb( intensityRange, level ) );308 const QwtInterval intensityRange = m_data->data->interval(Qt::ZAxis); 309 const QColor c( m_data->colorMap->rgb( intensityRange, level ) ); 231 310 232 311 return QPen( c ); … … 242 321 \sa testConrecFlag(), renderContourLines(), 243 322 QwtRasterData::contourLines() 244 */ 323 */ 245 324 void QwtPlotSpectrogram::setConrecFlag( 246 325 QwtRasterData::ConrecFlag flag, bool on ) 247 326 { 248 if ( bool( d_data->conrecFlags & flag ) == on )327 if ( bool( m_data->conrecFlags & flag ) == on ) 249 328 return; 250 329 251 330 if ( on ) 252 d_data->conrecFlags |= flag;331 m_data->conrecFlags |= flag; 253 332 else 254 d_data->conrecFlags &= ~flag;333 m_data->conrecFlags &= ~flag; 255 334 256 335 itemChanged(); … … 268 347 \sa setConrecClag(), renderContourLines(), 269 348 QwtRasterData::contourLines() 270 */ 349 */ 271 350 bool QwtPlotSpectrogram::testConrecFlag( 272 351 QwtRasterData::ConrecFlag flag ) const 273 352 { 274 return d_data->conrecFlags & flag;353 return m_data->conrecFlags & flag; 275 354 } 276 355 … … 283 362 284 363 \note contourLevels returns the same levels but sorted. 285 */ 286 void QwtPlotSpectrogram::setContourLevels( const QList< double> &levels )287 { 288 d_data->contourLevels = levels;289 qSort( d_data->contourLevels );364 */ 365 void QwtPlotSpectrogram::setContourLevels( const QList< double >& levels ) 366 { 367 m_data->contourLevels = levels; 368 std::sort( m_data->contourLevels.begin(), m_data->contourLevels.end() ); 290 369 291 370 legendChanged(); … … 300 379 \sa contourLevels(), renderContourLines(), 301 380 QwtRasterData::contourLines() 302 */ 303 QList< double> QwtPlotSpectrogram::contourLevels() const304 { 305 return d_data->contourLevels;306 } 307 308 /*! 309 Set the data to be displayed 310 311 \param data Spectrogram Data 312 \sa data() 313 */ 314 void QwtPlotSpectrogram::setData( QwtRasterData *data )315 { 316 if ( data != d_data->data )317 { 318 delete d_data->data;319 d_data->data = data;381 */ 382 QList< double > QwtPlotSpectrogram::contourLevels() const 383 { 384 return m_data->contourLevels; 385 } 386 387 /*! 388 Set the data to be displayed 389 390 \param data Spectrogram Data 391 \sa data() 392 */ 393 void QwtPlotSpectrogram::setData( QwtRasterData* data ) 394 { 395 if ( data != m_data->data ) 396 { 397 delete m_data->data; 398 m_data->data = data; 320 399 321 400 invalidateCache(); … … 325 404 326 405 /*! 327 \return Spectrogram data 328 \sa setData() 329 */ 330 const QwtRasterData *QwtPlotSpectrogram::data() const331 { 332 return d_data->data;333 } 334 335 /*! 336 \return Spectrogram data 337 \sa setData() 338 */ 339 QwtRasterData *QwtPlotSpectrogram::data()340 { 341 return d_data->data;406 \return Spectrogram data 407 \sa setData() 408 */ 409 const QwtRasterData* QwtPlotSpectrogram::data() const 410 { 411 return m_data->data; 412 } 413 414 /*! 415 \return Spectrogram data 416 \sa setData() 417 */ 418 QwtRasterData* QwtPlotSpectrogram::data() 419 { 420 return m_data->data; 342 421 } 343 422 … … 350 429 \param axis X, Y, or Z axis 351 430 \sa QwtRasterData::interval() 352 */ 431 */ 353 432 QwtInterval QwtPlotSpectrogram::interval(Qt::Axis axis) const 354 433 { 355 if ( d_data->data == NULL )434 if ( m_data->data == NULL ) 356 435 return QwtInterval(); 357 436 358 return d_data->data->interval( axis );437 return m_data->data->interval( axis ); 359 438 } 360 439 … … 374 453 \sa QwtPlotRasterItem::pixelHint(), QwtRasterData::pixelHint(), 375 454 render(), renderImage() 376 */ 377 QRectF QwtPlotSpectrogram::pixelHint( const QRectF &area ) const378 { 379 if ( d_data->data == NULL )455 */ 456 QRectF QwtPlotSpectrogram::pixelHint( const QRectF& area ) const 457 { 458 if ( m_data->data == NULL ) 380 459 return QRectF(); 381 460 382 return d_data->data->pixelHint( area );461 return m_data->data->pixelHint( area ); 383 462 } 384 463 … … 388 467 For each pixel of area the value is mapped into a color. 389 468 390 \param xMap X-Scale Map 391 \param yMap Y-Scale Map 392 \param area Requested area for the image in scale coordinates 393 \param imageSize Size of the requested image 469 \param xMap X-Scale Map 470 \param yMap Y-Scale Map 471 \param area Requested area for the image in scale coordinates 472 \param imageSize Size of the requested image 394 473 395 474 \return A QImage::Format_Indexed8 or QImage::Format_ARGB32 depending … … 398 477 \sa QwtRasterData::value(), QwtColorMap::rgb(), 399 478 QwtColorMap::colorIndex() 400 */ 479 */ 401 480 QImage QwtPlotSpectrogram::renderImage( 402 const QwtScaleMap &xMap, const QwtScaleMap&yMap,403 const QRectF &area, const QSize&imageSize ) const404 { 405 if ( imageSize.isEmpty() || d_data->data == NULL406 || d_data->colorMap == NULL )481 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 482 const QRectF& area, const QSize& imageSize ) const 483 { 484 if ( imageSize.isEmpty() || m_data->data == NULL 485 || m_data->colorMap == NULL ) 407 486 { 408 487 return QImage(); 409 488 } 410 489 411 const QwtInterval intensityRange = d_data->data->interval( Qt::ZAxis );490 const QwtInterval intensityRange = m_data->data->interval( Qt::ZAxis ); 412 491 if ( !intensityRange.isValid() ) 413 492 return QImage(); 414 493 415 QImage::Format format = ( d_data->colorMap->format() == QwtColorMap::RGB )494 const QImage::Format format = ( m_data->colorMap->format() == QwtColorMap::RGB ) 416 495 ? QImage::Format_ARGB32 : QImage::Format_Indexed8; 417 496 418 497 QImage image( imageSize, format ); 419 498 420 if ( d_data->colorMap->format() == QwtColorMap::Indexed )421 image.setColorTable( d_data->colorMap->colorTable( intensityRange) );422 423 d_data->data->initRaster( area, image.size() );499 if ( m_data->colorMap->format() == QwtColorMap::Indexed ) 500 image.setColorTable( m_data->colorMap->colorTable256() ); 501 502 m_data->data->initRaster( area, image.size() ); 424 503 425 504 #if DEBUG_RENDER … … 428 507 #endif 429 508 430 #if QT_VERSION >= 0x040400 &&!defined(QT_NO_QFUTURE)509 #if !defined( QT_NO_QFUTURE ) 431 510 uint numThreads = renderThreadCount(); 432 511 … … 439 518 const int numRows = imageSize.height() / numThreads; 440 519 441 QList< QFuture<void> > futures; 520 QVector< QFuture< void > > futures; 521 futures.reserve( numThreads - 1 ); 522 442 523 for ( uint i = 0; i < numThreads; i++ ) 443 524 { … … 451 532 { 452 533 futures += QtConcurrent::run( 534 #if QT_VERSION >= 0x060000 535 &QwtPlotSpectrogram::renderTile, this, 536 #else 453 537 this, &QwtPlotSpectrogram::renderTile, 538 #endif 454 539 xMap, yMap, tile, &image ); 455 540 } 456 541 } 542 457 543 for ( int i = 0; i < futures.size(); i++ ) 458 544 futures[i].waitForFinished(); 459 545 460 #else // QT_VERSION < 0x040400546 #else 461 547 const QRect tile( 0, 0, image.width(), image.height() ); 462 548 renderTile( xMap, yMap, tile, &image ); … … 468 554 #endif 469 555 470 d_data->data->discardRaster();556 m_data->data->discardRaster(); 471 557 472 558 return image; … … 483 569 \param tile Geometry of the tile in image coordinates 484 570 \param image Image to be rendered 485 */ 571 */ 486 572 void QwtPlotSpectrogram::renderTile( 487 const QwtScaleMap &xMap, const QwtScaleMap&yMap,488 const QRect &tile, QImage*image ) const489 { 490 const QwtInterval range = d_data->data->interval( Qt::ZAxis );491 if ( !range.isValid())573 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 574 const QRect& tile, QImage* image ) const 575 { 576 const QwtInterval range = m_data->data->interval( Qt::ZAxis ); 577 if ( range.width() <= 0.0 ) 492 578 return; 493 579 494 if ( d_data->colorMap->format() == QwtColorMap::RGB ) 495 { 580 const bool hasGaps = !m_data->data->testAttribute( QwtRasterData::WithoutGaps ); 581 582 if ( m_data->colorMap->format() == QwtColorMap::RGB ) 583 { 584 const int numColors = m_data->colorTable.size(); 585 const QRgb* rgbTable = m_data->colorTable.constData(); 586 const QwtColorMap* colorMap = m_data->colorMap; 587 496 588 for ( int y = tile.top(); y <= tile.bottom(); y++ ) 497 589 { 498 590 const double ty = yMap.invTransform( y ); 499 591 500 QRgb *line = reinterpret_cast<QRgb *>( image->scanLine( y ) );592 QRgb* line = reinterpret_cast< QRgb* >( image->scanLine( y ) ); 501 593 line += tile.left(); 502 594 … … 505 597 const double tx = xMap.invTransform( x ); 506 598 507 *line++ = d_data->colorMap->rgb( range, 508 d_data->data->value( tx, ty ) ); 599 const double value = m_data->data->value( tx, ty ); 600 601 if ( hasGaps && qwtIsNaN( value ) ) 602 { 603 *line++ = 0u; 604 } 605 else if ( numColors == 0 ) 606 { 607 *line++ = colorMap->rgb( range, value ); 608 } 609 else 610 { 611 const uint index = colorMap->colorIndex( numColors, range, value ); 612 *line++ = rgbTable[index]; 613 } 509 614 } 510 615 } 511 616 } 512 else if ( d_data->colorMap->format() == QwtColorMap::Indexed )617 else if ( m_data->colorMap->format() == QwtColorMap::Indexed ) 513 618 { 514 619 for ( int y = tile.top(); y <= tile.bottom(); y++ ) … … 516 621 const double ty = yMap.invTransform( y ); 517 622 518 unsigned char *line = image->scanLine( y );623 unsigned char* line = image->scanLine( y ); 519 624 line += tile.left(); 520 625 … … 523 628 const double tx = xMap.invTransform( x ); 524 629 525 *line++ = d_data->colorMap->colorIndex( range, 526 d_data->data->value( tx, ty ) ); 630 const double value = m_data->data->value( tx, ty ); 631 632 if ( hasGaps && qwtIsNaN( value ) ) 633 { 634 *line++ = 0; 635 } 636 else 637 { 638 const uint index = m_data->colorMap->colorIndex( 256, range, value ); 639 *line++ = static_cast< unsigned char >( index ); 640 } 527 641 } 528 642 } … … 546 660 547 661 \sa drawContourLines(), QwtRasterData::contourLines() 548 */ 662 */ 549 663 QSize QwtPlotSpectrogram::contourRasterSize( 550 const QRectF &area, const QRect&rect ) const664 const QRectF& area, const QRect& rect ) const 551 665 { 552 666 QSize raster = rect.size() / 2; … … 555 669 if ( !pixelRect.isEmpty() ) 556 670 { 557 const QSize res( qCeil( rect.width() / pixelRect.width() ), 558 qCeil( rect.height() / pixelRect.height() ) ); 671 const QSize res( qwtCeil( rect.width() / pixelRect.width() ), 672 qwtCeil( rect.height() / pixelRect.height() ) ); 559 673 raster = raster.boundedTo( res ); 560 674 } … … 572 686 \sa contourLevels(), setConrecFlag(), 573 687 QwtRasterData::contourLines() 574 */ 688 */ 575 689 QwtRasterData::ContourLines QwtPlotSpectrogram::renderContourLines( 576 const QRectF &rect, const QSize&raster ) const577 { 578 if ( d_data->data == NULL )690 const QRectF& rect, const QSize& raster ) const 691 { 692 if ( m_data->data == NULL ) 579 693 return QwtRasterData::ContourLines(); 580 694 581 return d_data->data->contourLines( rect, raster,582 d_data->contourLevels,d_data->conrecFlags );695 return m_data->data->contourLines( rect, raster, 696 m_data->contourLevels, m_data->conrecFlags ); 583 697 } 584 698 … … 592 706 593 707 \sa renderContourLines(), defaultContourPen(), contourPen() 594 */ 595 void QwtPlotSpectrogram::drawContourLines( QPainter *painter,596 const QwtScaleMap&xMap, const QwtScaleMap&yMap,597 const QwtRasterData::ContourLines&contourLines ) const598 { 599 if ( d_data->data == NULL )708 */ 709 void QwtPlotSpectrogram::drawContourLines( QPainter* painter, 710 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 711 const QwtRasterData::ContourLines& contourLines ) const 712 { 713 if ( m_data->data == NULL ) 600 714 return; 601 715 602 const int numLevels = d_data->contourLevels.size();716 const int numLevels = m_data->contourLevels.size(); 603 717 for ( int l = 0; l < numLevels; l++ ) 604 718 { 605 const double level = d_data->contourLevels[l];719 const double level = m_data->contourLevels[l]; 606 720 607 721 QPen pen = defaultContourPen(); … … 614 728 painter->setPen( pen ); 615 729 616 const QPolygonF &lines = contourLines[level];730 const QPolygonF& lines = contourLines[level]; 617 731 for ( int i = 0; i < lines.size(); i += 2 ) 618 732 { 619 733 const QPointF p1( xMap.transform( lines[i].x() ), 620 734 yMap.transform( lines[i].y() ) ); 621 const QPointF p2( xMap.transform( lines[i +1].x() ),622 yMap.transform( lines[i +1].y() ) );735 const QPointF p2( xMap.transform( lines[i + 1].x() ), 736 yMap.transform( lines[i + 1].y() ) ); 623 737 624 738 QwtPainter::drawLine( painter, p1, p2 ); … … 628 742 629 743 /*! 630 \brief Draw the spectrogram 631 632 \param painter Painter 633 \param xMap Maps x-values into pixel coordinates. 634 \param yMap Maps y-values into pixel coordinates. 635 \param canvasRect Contents rectangle of the canvas in painter coordinates 636 637 \sa setDisplayMode(), renderImage(), 744 \brief Draw the spectrogram 745 746 \param painter Painter 747 \param xMap Maps x-values into pixel coordinates. 748 \param yMap Maps y-values into pixel coordinates. 749 \param canvasRect Contents rectangle of the canvas in painter coordinates 750 751 \sa setDisplayMode(), renderImage(), 638 752 QwtPlotRasterItem::draw(), drawContourLines() 639 */ 640 void QwtPlotSpectrogram::draw( QPainter *painter,641 const QwtScaleMap &xMap, const QwtScaleMap&yMap,642 const QRectF &canvasRect ) const643 { 644 if ( d_data->displayMode & ImageMode )753 */ 754 void QwtPlotSpectrogram::draw( QPainter* painter, 755 const QwtScaleMap& xMap, const QwtScaleMap& yMap, 756 const QRectF& canvasRect ) const 757 { 758 if ( m_data->displayMode & ImageMode ) 645 759 QwtPlotRasterItem::draw( painter, xMap, yMap, canvasRect ); 646 760 647 if ( d_data->displayMode & ContourMode )761 if ( m_data->displayMode & ContourMode ) 648 762 { 649 763 // Add some pixels at the borders
Note:
See TracChangeset
for help on using the changeset viewer.
