27#ifndef QWT_PIXEL_MATRIX_H
28#define QWT_PIXEL_MATRIX_H
30#include "qwt_global.h"
50 void setRect(
const QRect& rect);
55 bool testPixel(
int x,
int y)
const;
57 bool testAndSetPixel(
int x,
int y,
bool on);
60 int index(
int x,
int y)
const;
74 const int idx =
index(x, y);
75 return (idx >= 0) ? testBit(idx) :
true;
87 const int idx =
index(x, y);
91 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:72
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:85
int index(int x, int y) const
Calculate the index in the bit field corresponding to a position
Definition qwt_pixel_matrix.h:103