Qwt User's Guide  6.1.6
QwtPixelMatrix Class Reference

A bit field corresponding to the pixels of a rectangle. More...

#include <qwt_pixel_matrix.h>

Inheritance diagram for QwtPixelMatrix:

Public Member Functions

 QwtPixelMatrix (const QRect &rect)
 Constructor. More...
 
 ~QwtPixelMatrix ()
 Destructor.
 
void setRect (const QRect &rect)
 
QRect rect () const
 
bool testPixel (int x, int y) const
 Test if a pixel has been set. More...
 
bool testAndSetPixel (int x, int y, bool on)
 Set a pixel and test if a pixel has been set before. More...
 
int index (int x, int y) const
 Calculate the index in the bit field corresponding to a position. More...
 

Detailed Description

A bit field corresponding to the pixels of a rectangle.

QwtPixelMatrix is intended to filter out duplicates in an unsorted array of points.

Constructor & Destructor Documentation

◆ QwtPixelMatrix()

QwtPixelMatrix::QwtPixelMatrix ( const QRect &  rect)

Constructor.

Parameters
rectBounding rectangle for the matrix

Member Function Documentation

◆ index()

int QwtPixelMatrix::index ( int  x,
int  y 
) const
inline

Calculate the index in the bit field corresponding to a position.

Parameters
xX-coordinate
yY-coordinate
Returns
Index, when rect() contains pos - otherwise -1.

◆ rect()

QRect QwtPixelMatrix::rect ( ) const
Returns
Bounding rectangle

◆ setRect()

void QwtPixelMatrix::setRect ( const QRect &  rect)

Set the bounding rectangle of the matrix

Parameters
rectBounding rectangle
Note
All bits are cleared

◆ testAndSetPixel()

bool QwtPixelMatrix::testAndSetPixel ( int  x,
int  y,
bool  on 
)
inline

Set a pixel and test if a pixel has been set before.

Parameters
xX-coordinate
yY-coordinate
onSet/Clear the pixel
Returns
true, when pos is outside of rect(), or when the pixel was set before.

◆ testPixel()

bool QwtPixelMatrix::testPixel ( int  x,
int  y 
) const
inline

Test if a pixel has been set.

Parameters
xX-coordinate
yY-coordinate
Returns
true, when pos is outside of rect(), or when the pixel has already been set.