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;
与矩形像素对应的位域
Definition qwt_pixel_matrix.h:50
bool testPixel(int x, int y) const
测试像素是否已设置
Definition qwt_pixel_matrix.h:89
bool testAndSetPixel(int x, int y, bool on)
设置像素并测试之前是否已设置
Definition qwt_pixel_matrix.h:112
int index(int x, int y) const
计算位域中对应位置的索引
Definition qwt_pixel_matrix.h:139