Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_pixel_matrix.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_pixel_matrix.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_pixel_matrix.h
r8127 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 12 12 13 13 #include "qwt_global.h" 14 14 15 #include <qbitarray.h> 15 16 #include <qrect.h> 16 17 17 18 /*! 18 \brief A bit field corresponding to the pixels of a rectangle 19 \brief A bit field corresponding to the pixels of a rectangle 19 20 20 QwtPixelMatrix is intended to filter out duplicates in an 21 unsorted array of points. 22 */ 23 class QWT_EXPORT QwtPixelMatrix: public QBitArray 21 QwtPixelMatrix is intended to filter out duplicates in an 22 unsorted array of points. 23 */ 24 class QWT_EXPORT QwtPixelMatrix : public QBitArray 24 25 { 25 public: 26 QwtPixelMatrix( const QRect& rect ); 26 public: 27 explicit QwtPixelMatrix( const QRect& rect ); 27 28 ~QwtPixelMatrix(); 28 29 … … 35 36 int index( int x, int y ) const; 36 37 37 private: 38 QRect d_rect;38 private: 39 QRect m_rect; 39 40 }; 40 41 41 42 /*! 42 \brief Test if a pixel has been set 43 \brief Test if a pixel has been set 43 44 44 \param x X-coordinate 45 \param y Y-coordinate 45 \param x X-coordinate 46 \param y Y-coordinate 46 47 47 \return true, when pos is outside of rect(), or when the pixel 48 \return true, when pos is outside of rect(), or when the pixel 48 49 has already been set. 49 50 */ … … 55 56 56 57 /*! 57 \brief Set a pixel and test if a pixel has been set before 58 \brief Set a pixel and test if a pixel has been set before 58 59 59 \param x X-coordinate 60 \param y Y-coordinate 61 \param on Set/Clear the pixel 60 \param x X-coordinate 61 \param y Y-coordinate 62 \param on Set/Clear the pixel 62 63 63 \return true, when pos is outside of rect(), or when the pixel 64 \return true, when pos is outside of rect(), or when the pixel 64 65 was set before. 65 66 */ … … 77 78 78 79 /*! 79 \brief Calculate the index in the bit field corresponding to a position 80 \brief Calculate the index in the bit field corresponding to a position 80 81 81 \param x X-coordinate 82 \param y Y-coordinate 83 \return Index, when rect() contains pos - otherwise -1. 82 \param x X-coordinate 83 \param y Y-coordinate 84 \return Index, when rect() contains pos - otherwise -1. 84 85 */ 85 86 inline int QwtPixelMatrix::index( int x, int y ) const 86 87 { 87 const int dx = x - d_rect.x();88 if ( dx < 0 || dx >= d_rect.width() )88 const int dx = x - m_rect.x(); 89 if ( dx < 0 || dx >= m_rect.width() ) 89 90 return -1; 90 91 91 const int dy = y - d_rect.y();92 if ( dy < 0 || dy >= d_rect.height() )92 const int dy = y - m_rect.y(); 93 if ( dy < 0 || dy >= m_rect.height() ) 93 94 return -1; 94 95 95 return dy * d_rect.width() + dx;96 return dy * m_rect.width() + dx; 96 97 } 97 98
Note:
See TracChangeset
for help on using the changeset viewer.
