27#ifndef QWT_PIXEL_MATRIX_H
28#define QWT_PIXEL_MATRIX_H
30#include "qwt_global.h"
58 void setRect(
const QRect& rect );
63 bool testPixel(
int x,
int y )
const;
65 bool testAndSetPixel(
int x,
int y,
bool on );
68 int index(
int x,
int y )
const;
91 const int idx =
index( x, y );
92 return ( idx >= 0 ) ? testBit( idx ) :
true;
114 const int idx =
index( x, y );
118 const bool onBefore = testBit( idx );
141 const int dx = x - m_rect.x();
142 if ( dx < 0 || dx >= m_rect.width() )
145 const int dy = y - m_rect.y();
146 if ( dy < 0 || dy >= m_rect.height() )
149 return dy * m_rect.width() + dx;
A bit field corresponding to the pixels of a rectangle.
Definition qwt_pixel_matrix.h:50
bool testPixel(int x, int y) const
Test if a pixel has been set.
Definition qwt_pixel_matrix.h:89
bool testAndSetPixel(int x, int y, bool on)
Set a pixel and test if a pixel has been set before.
Definition qwt_pixel_matrix.h:112
int index(int x, int y) const
Calculate the index in the bit field corresponding to a position.
Definition qwt_pixel_matrix.h:139