Qt 4.8
Public Functions | Private Functions | Properties | List of all members
QSpanBuffer Class Reference

Public Functions

void addSpan (int x, unsigned int len, int y, unsigned char coverage)
 
 QSpanBuffer (ProcessSpans blend, void *data, const QRect &clipRect)
 
 ~QSpanBuffer ()
 

Private Functions

void flushSpans ()
 

Properties

ProcessSpans m_blend
 
QRect m_clipRect
 
void * m_data
 
int m_spanCount
 
QT_FT_Span m_spans [SPAN_BUFFER_SIZE]
 

Detailed Description

Definition at line 74 of file qrasterizer.cpp.

Constructors and Destructors

◆ QSpanBuffer()

QSpanBuffer::QSpanBuffer ( ProcessSpans  blend,
void *  data,
const QRect clipRect 
)
inline

Definition at line 76 of file qrasterizer.cpp.

77  : m_spanCount(0)
78  , m_blend(blend)
79  , m_data(data)
80  , m_clipRect(clipRect)
81  {
82  }
static const char * data(const QByteArray &arr)
QRect m_clipRect
ProcessSpans m_blend

◆ ~QSpanBuffer()

QSpanBuffer::~QSpanBuffer ( )
inline

Definition at line 84 of file qrasterizer.cpp.

85  {
86  flushSpans();
87  }
void flushSpans()

Functions

◆ addSpan()

void QSpanBuffer::addSpan ( int  x,
unsigned int  len,
int  y,
unsigned char  coverage 
)
inline

Definition at line 89 of file qrasterizer.cpp.

Referenced by QScanConverter::emitNode(), qScanConvert(), and QRasterizer::rasterizeLine().

90  {
91  if (!coverage || !len)
92  return;
93 
94  Q_ASSERT(y >= m_clipRect.top());
95  Q_ASSERT(y <= m_clipRect.bottom());
96  Q_ASSERT(x >= m_clipRect.left());
97  Q_ASSERT(x + int(len) - 1 <= m_clipRect.right());
98 
99  m_spans[m_spanCount].x = x;
100  m_spans[m_spanCount].len = len;
101  m_spans[m_spanCount].y = y;
102  m_spans[m_spanCount].coverage = coverage;
103 
104  if (++m_spanCount == SPAN_BUFFER_SIZE)
105  flushSpans();
106  }
unsigned char coverage
unsigned short len
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QT_FT_Span m_spans[SPAN_BUFFER_SIZE]
void flushSpans()
#define SPAN_BUFFER_SIZE
Definition: qrasterizer.cpp:63
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
QRect m_clipRect

◆ flushSpans()

void QSpanBuffer::flushSpans ( )
inlineprivate

Definition at line 109 of file qrasterizer.cpp.

Referenced by addSpan(), and ~QSpanBuffer().

110  {
112  m_spanCount = 0;
113  }
QT_FT_Span m_spans[SPAN_BUFFER_SIZE]
ProcessSpans m_blend

Properties

◆ m_blend

ProcessSpans QSpanBuffer::m_blend
private

Definition at line 118 of file qrasterizer.cpp.

Referenced by flushSpans().

◆ m_clipRect

QRect QSpanBuffer::m_clipRect
private

Definition at line 121 of file qrasterizer.cpp.

Referenced by addSpan().

◆ m_data

void* QSpanBuffer::m_data
private

Definition at line 119 of file qrasterizer.cpp.

Referenced by flushSpans().

◆ m_spanCount

int QSpanBuffer::m_spanCount
private

Definition at line 116 of file qrasterizer.cpp.

Referenced by addSpan(), and flushSpans().

◆ m_spans

QT_FT_Span QSpanBuffer::m_spans[SPAN_BUFFER_SIZE]
private

Definition at line 115 of file qrasterizer.cpp.

Referenced by addSpan(), and flushSpans().


The documentation for this class was generated from the following file: