Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_widget_overlay.cpp
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_widget_overlay.cpp
r8127 r9383 12 12 #include <qpainter.h> 13 13 #include <qpaintengine.h> 14 #include <qpainterpath.h> 14 15 #include <qimage.h> 15 16 #include <qevent.h> … … 23 24 } 24 25 25 static QRegion qwtAlphaMask( 26 const QImage& image, const QVector<QRect> rects )26 static QRegion qwtAlphaMask( 27 const QImage& image, const QVector<QRect> &rects ) 27 28 { 28 29 const int w = image.width(); … … 42 43 y2 = qMin( y2, h - 1 ); 43 44 44 for ( int y = y1; y <= y2; ++y ) 45 for ( int y = y1; y <= y2; ++y ) 45 46 { 46 47 bool inRect = false; 47 48 int rx0 = -1; 48 49 49 const uint *line = 50 const uint *line = 50 51 reinterpret_cast<const uint *> ( image.scanLine( y ) ) + x1; 51 for ( int x = x1; x <= x2; x++ ) 52 for ( int x = x1; x <= x2; x++ ) 52 53 { 53 54 const bool on = ( ( *line++ >> 24 ) != 0 ); 54 if ( on != inRect ) 55 if ( on != inRect ) 55 56 { 56 if ( inRect ) 57 if ( inRect ) 57 58 { 58 59 rect.setCoords( rx0, y, x - 1, y ); 59 60 region += rect; 60 } 61 else 61 } 62 else 62 63 { 63 64 rx0 = x; … … 65 66 66 67 inRect = on; 67 } 68 } 68 69 } 69 70 70 if ( inRect ) 71 if ( inRect ) 71 72 { 72 73 rect.setCoords( rx0, y, x2, y ); … … 212 213 d_data->rgbaBuffer = ( uchar* )::calloc( width() * height(), 4 ); 213 214 214 QImage image( d_data->rgbaBuffer, 215 QImage image( d_data->rgbaBuffer, 215 216 width(), height(), qwtMaskImageFormat() ); 216 217 … … 249 250 void QwtWidgetOverlay::paintEvent( QPaintEvent* event ) 250 251 { 251 const QRegion clipRegion = event->region();252 const QRegion &clipRegion = event->region(); 252 253 253 254 QPainter painter( this ); … … 266 267 if ( d_data->rgbaBuffer && useRgbaBuffer ) 267 268 { 268 const QImage image( d_data->rgbaBuffer, 269 const QImage image( d_data->rgbaBuffer, 269 270 width(), height(), qwtMaskImageFormat() ); 270 271
Note:
See TracChangeset
for help on using the changeset viewer.