Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qrasterizer.cpp File Reference
#include "qrasterizer_p.h"
#include <QPoint>
#include <QRect>
#include <private/qmath_p.h>
#include <private/qdatabuffer_p.h>
#include <private/qdrawhelper_p.h>
#include <QtGui/qpainterpath.h>
#include <algorithm>
+ Include dependency graph for qrasterizer.cpp:

Go to the source code of this file.

Classes

class  QSpanBuffer
 
class  QScanConverter
 
struct  QScanConverter::Line
 
class  QRasterizerPrivate
 

Macros

#define QScFixedToFloat(i)   ((i) * (1./65536.))
 
#define FloatToQScFixed(i)   (QScFixed)((i) * 65536.)
 
#define IntToQScFixed(i)   ((QScFixed)(i) * (1 << 16))
 
#define QScFixedToInt(i)   ((i) >> 16)
 
#define QScFixedFactor   65536
 
#define FTPosToQScFixed(i)   ((QScFixed)(i) * (1 << 10))
 
#define QScFixedMultiply(x, y)   (QScFixed)((qlonglong(x) * qlonglong(y)) >> 16)
 
#define QScFixedFastMultiply(x, y)   (((x) * (y)) >> 16)
 
#define SPAN_BUFFER_SIZE   256
 
#define COORD_ROUNDING   1
 
#define COORD_OFFSET   32
 
#define CHUNK_SIZE   64
 
#define DO_SEGMENT(next, li, ri, ls, rs)
 

Functions

static QT_FT_Vector PointToVector (const QPointF &p)
 
static void split (QT_FT_Vector *b)
 
static QScFixed intersectPixelFP (int x, QScFixed top, QScFixed bottom, QScFixed leftIntersectX, QScFixed rightIntersectX, QScFixed slope, QScFixed invSlope)
 
static bool q26Dot6Compare (qreal p1, qreal p2)
 
static QPointF snapTo26Dot6Grid (const QPointF &p)
 
static qreal qSafeDivide (qreal x, qreal y)
 
static QScFixed qSafeFloatToQScFixed (qreal x)
 
static bool qClipLine (QPointF *pt1, QPointF *pt2, const QRectF &clip)
 

Variables

QT_BEGIN_NAMESPACE typedef int QScFixed
 

Macro Definition Documentation

◆ CHUNK_SIZE

#define CHUNK_SIZE   64

Definition at line 96 of file qrasterizer.cpp.

◆ COORD_OFFSET

#define COORD_OFFSET   32

Definition at line 37 of file qrasterizer.cpp.

◆ COORD_ROUNDING

#define COORD_ROUNDING   1

Definition at line 36 of file qrasterizer.cpp.

◆ DO_SEGMENT

#define DO_SEGMENT (   next,
  li,
  ri,
  ls,
  rs 
)
Value:
ny = qMin(next + 1, d->clipRect.top()); \
if (y < ny) { \
li += ls * (ny - y); \
ri += rs * (ny - y); \
y = ny; \
} \
if (next > d->clipRect.bottom()) \
next = d->clipRect.bottom(); \
for (; y <= next; ++y) { \
const int x1 = qMax(QScFixedToInt(li), d->clipRect.left()); \
const int x2 = qMin(QScFixedToInt(ri), d->clipRect.right()); \
if (x2 >= x1) \
buffer.addSpan(x1, x2 - x1 + 1, y, 255); \
li += ls; \
ri += rs; \
}
short next
Definition keywords.cpp:445
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
GLuint GLfloat GLfloat GLfloat x1
GLenum GLuint buffer
GLint y
GLfixed ny
GLfixed GLfixed x2
#define QScFixedToInt(i)

◆ FloatToQScFixed

#define FloatToQScFixed (   i)    (QScFixed)((i) * 65536.)

Definition at line 25 of file qrasterizer.cpp.

◆ FTPosToQScFixed

#define FTPosToQScFixed (   i)    ((QScFixed)(i) * (1 << 10))

Definition at line 29 of file qrasterizer.cpp.

◆ IntToQScFixed

#define IntToQScFixed (   i)    ((QScFixed)(i) * (1 << 16))

Definition at line 26 of file qrasterizer.cpp.

◆ QScFixedFactor

#define QScFixedFactor   65536

Definition at line 28 of file qrasterizer.cpp.

◆ QScFixedFastMultiply

#define QScFixedFastMultiply (   x,
  y 
)    (((x) * (y)) >> 16)

Definition at line 32 of file qrasterizer.cpp.

◆ QScFixedMultiply

#define QScFixedMultiply (   x,
  y 
)    (QScFixed)((qlonglong(x) * qlonglong(y)) >> 16)

Definition at line 31 of file qrasterizer.cpp.

◆ QScFixedToFloat

#define QScFixedToFloat (   i)    ((i) * (1./65536.))

Definition at line 24 of file qrasterizer.cpp.

◆ QScFixedToInt

#define QScFixedToInt (   i)    ((i) >> 16)

Definition at line 27 of file qrasterizer.cpp.

◆ SPAN_BUFFER_SIZE

#define SPAN_BUFFER_SIZE   256

Definition at line 34 of file qrasterizer.cpp.

Function Documentation

◆ intersectPixelFP()

static QScFixed intersectPixelFP ( int  x,
QScFixed  top,
QScFixed  bottom,
QScFixed  leftIntersectX,
QScFixed  rightIntersectX,
QScFixed  slope,
QScFixed  invSlope 
)
static

Definition at line 618 of file qrasterizer.cpp.

References IntToQScFixed, QScFixed, QScFixedFactor, QScFixedFastMultiply, and QScFixedMultiply.

Referenced by QRasterizer::rasterizeLine().

+ Here is the caller graph for this function:

◆ PointToVector()

static QT_FT_Vector PointToVector ( const QPointF p)
inlinestatic

Definition at line 39 of file qrasterizer.cpp.

References QT_FT_Pos.

Referenced by QRasterizer::rasterize().

+ Here is the caller graph for this function:

◆ q26Dot6Compare()

static bool q26Dot6Compare ( qreal  p1,
qreal  p2 
)
inlinestatic

Definition at line 664 of file qrasterizer.cpp.

References p1, and p2.

Referenced by QRasterizer::rasterizeLine().

+ Here is the caller graph for this function:

◆ qClipLine()

static bool qClipLine ( QPointF pt1,
QPointF pt2,
const QRectF clip 
)
inlinestatic

Definition at line 712 of file qrasterizer.cpp.

References QRectF::bottom(), QRectF::left(), qIsFinite(), QRectF::right(), QPointF::rx(), QPointF::ry(), and QRectF::top().

Referenced by QRasterizer::rasterizeLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qSafeDivide()

static qreal qSafeDivide ( qreal  x,
qreal  y 
)
inlinestatic

Definition at line 683 of file qrasterizer.cpp.

Referenced by QRasterizer::rasterizeLine().

+ Here is the caller graph for this function:

◆ qSafeFloatToQScFixed()

static QScFixed qSafeFloatToQScFixed ( qreal  x)
inlinestatic

Definition at line 694 of file qrasterizer.cpp.

References QScFixed, and QScFixedFactor.

Referenced by QRasterizer::rasterizeLine().

+ Here is the caller graph for this function:

◆ snapTo26Dot6Grid()

static QPointF snapTo26Dot6Grid ( const QPointF p)
inlinestatic

Definition at line 669 of file qrasterizer.cpp.

Referenced by QRasterizer::rasterizeLine().

+ Here is the caller graph for this function:

◆ split()

Variable Documentation

◆ QScFixed