10 #ifndef QWT_PIXEL_MATRIX_H 11 #define QWT_PIXEL_MATRIX_H 15 #include <qbitarray.h> 30 void setRect(
const QRect& rect );
33 bool testPixel(
int x,
int y )
const;
34 bool testAndSetPixel(
int x,
int y,
bool on );
36 int index(
int x,
int y )
const;
53 const int idx = index( x, y );
54 return ( idx >= 0 ) ? testBit( idx ) :
true;
69 const int idx = index( x, y );
73 const bool onBefore = testBit( idx );
88 const int dx = x - d_rect.x();
89 if ( dx < 0 || dx >= d_rect.width() )
92 const int dy = y - d_rect.y();
93 if ( dy < 0 || dy >= d_rect.height() )
96 return dy * d_rect.width() + dx;
bool testPixel(int x, int y) const
Test if a pixel has been set.
int index(int x, int y) const
Calculate the index in the bit field corresponding to a position.
A bit field corresponding to the pixels of a rectangle.
bool testAndSetPixel(int x, int y, bool on)
Set a pixel and test if a pixel has been set before.