27#ifndef QWT_PIXEL_MATRIX_H
28#define QWT_PIXEL_MATRIX_H
30#include "qwt_global.h"
47 void setRect(
const QRect& rect );
50 bool testPixel(
int x,
int y )
const;
51 bool testAndSetPixel(
int x,
int y,
bool on );
53 int index(
int x,
int y )
const;
70 const int idx =
index( x, y );
71 return ( idx >= 0 ) ? testBit( idx ) :
true;
86 const int idx =
index( x, y );
90 const bool onBefore = testBit( idx );
105 const int dx = x - m_rect.x();
106 if ( dx < 0 || dx >= m_rect.width() )
109 const int dy = y - m_rect.y();
110 if ( dy < 0 || dy >= m_rect.height() )
113 return dy * m_rect.width() + dx;
A bit field corresponding to the pixels of a rectangle.
Definition qwt_pixel_matrix.h:42
bool testPixel(int x, int y) const
Test if a pixel has been set.
Definition qwt_pixel_matrix.h:68
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:84
int index(int x, int y) const
Calculate the index in the bit field corresponding to a position.
Definition qwt_pixel_matrix.h:103