Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtransform.cpp File Reference

(5b9ce5d1298f5dffd986b422857cd1624693cabd)

#include "qtransform.h"
#include "qdatastream.h"
#include "qdebug.h"
#include "qhashfunctions.h"
#include "qregion.h"
#include "qpainterpath.h"
#include "qpainterpath_p.h"
#include "qvariant.h"
#include "qmath_p.h"
#include <qnumeric.h>
#include <private/qbezier_p.h>
+ Include dependency graph for qtransform.cpp:

Go to the source code of this file.

Classes

struct  QHomogeneousCoordinate
 

Macros

#define Q_NEAR_CLIP   (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001)
 
#define MAP(x, y, nx, ny)
 

Functions

QT_BEGIN_NAMESPACE static Q_NEVER_INLINE void nanWarning (const char *func)
 
QDataStreamoperator<< (QDataStream &s, const QTransform &m)
 
QDataStreamoperator>> (QDataStream &s, QTransform &t)
 
QDebug operator<< (QDebug dbg, const QTransform &m)
 
QPainterPath qt_regionToPath (const QRegion &region)
 
static QHomogeneousCoordinate mapHomogeneous (const QTransform &transform, const QPointF &p)
 
static bool lineTo_clipped (QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, bool needsMoveTo, bool needsLineTo=true)
 
Q_GUI_EXPORT bool qt_scaleForTransform (const QTransform &transform, qreal *scale)
 
static bool cubicTo_clipped (QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, const QPointF &c, const QPointF &d, bool needsMoveTo)
 
static QPainterPath mapProjective (const QTransform &transform, const QPainterPath &path)
 
QDataStreamoperator>> (QDataStream &s, QTransform::Affine &m)
 
QDataStreamoperator<< (QDataStream &s, const QTransform::Affine &m)
 

Macro Definition Documentation

◆ MAP

#define MAP ( x,
y,
nx,
ny )
Value:
do { \
qreal FX_ = x; \
qreal FY_ = y; \
switch(t) { \
case TxNone: \
nx = FX_; \
ny = FY_; \
break; \
case TxTranslate: \
nx = FX_ + m_matrix[2][0]; \
ny = FY_ + m_matrix[2][1]; \
break; \
case TxScale: \
nx = m_matrix[0][0] * FX_ + m_matrix[2][0]; \
ny = m_matrix[1][1] * FY_ + m_matrix[2][1]; \
break; \
case TxRotate: \
case TxShear: \
case TxProject: \
nx = m_matrix[0][0] * FX_ + m_matrix[1][0] * FY_ + m_matrix[2][0]; \
ny = m_matrix[0][1] * FX_ + m_matrix[1][1] * FY_ + m_matrix[2][1]; \
if (t == TxProject) { \
qreal w = (m_matrix[0][2] * FX_ + m_matrix[1][2] * FY_ + m_matrix[2][2]); \
w = qreal(1.)/w; \
nx *= w; \
ny *= w; \
} \
} \
} while (0)
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint y
GLbyte nx
GLfixed ny
GLdouble GLdouble t
Definition qopenglext.h:243
#define Q_NEAR_CLIP
double qreal
Definition qtypes.h:187

Definition at line 32 of file qtransform.cpp.

Referenced by QTransform::map(), QTransform::map(), QTransform::map(), QTransform::map(), QTransform::map(), QTransform::map(), QTransform::map(), QTransform::map(), QTransform::map(), QTransform::mapRect(), QTransform::mapRect(), and QTransform::mapToPolygon().

◆ Q_NEAR_CLIP

#define Q_NEAR_CLIP   (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001)

Definition at line 27 of file qtransform.cpp.

Referenced by lineTo_clipped().

Function Documentation

◆ cubicTo_clipped()

static bool cubicTo_clipped ( QPainterPath & path,
const QTransform & transform,
const QPointF & a,
const QPointF & b,
const QPointF & c,
const QPointF & d,
bool needsMoveTo )
inlinestatic

Definition at line 1454 of file qtransform.cpp.

References d, QBezier::fromPoints(), i, lineTo_clipped(), and qt_scaleForTransform().

Referenced by mapProjective().

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

◆ lineTo_clipped()

static bool lineTo_clipped ( QPainterPath & path,
const QTransform & transform,
const QPointF & a,
const QPointF & b,
bool needsMoveTo,
bool needsLineTo = true )
inlinestatic

Definition at line 1413 of file qtransform.cpp.

References mapHomogeneous(), Q_NEAR_CLIP, and QPointF::toPoint().

Referenced by cubicTo_clipped(), and mapProjective().

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

◆ mapHomogeneous()

static QHomogeneousCoordinate mapHomogeneous ( const QTransform & transform,
const QPointF & p )
inlinestatic

Definition at line 1404 of file qtransform.cpp.

Referenced by lineTo_clipped().

+ Here is the caller graph for this function:

◆ mapProjective()

static QPainterPath mapProjective ( const QTransform & transform,
const QPainterPath & path )
static

Definition at line 1473 of file qtransform.cpp.

References cubicTo_clipped(), QPainterPath::CurveToElement, i, lineTo_clipped(), QPainterPath::LineToElement, QPainterPath::MoveToElement, and Q_ASSERT.

Referenced by QTransform::map().

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

◆ nanWarning()

QT_BEGIN_NAMESPACE static Q_NEVER_INLINE void nanWarning ( const char * func)
static

Definition at line 21 of file qtransform.cpp.

References qWarning.

Referenced by QTransform::fromScale(), QTransform::fromTranslate(), QTransform::rotate(), QTransform::rotateRadians(), QTransform::scale(), QTransform::shear(), and QTransform::translate().

+ Here is the caller graph for this function:

◆ operator<<() [1/3]

QDataStream & operator<< ( QDataStream & s,
const QTransform & m )
related

Definition at line 1052 of file qtransform.cpp.

◆ operator<<() [2/3]

QDataStream & operator<< ( QDataStream & s,
const QTransform::Affine & m )

Definition at line 2215 of file qtransform.cpp.

◆ operator<<() [3/3]

QDebug operator<< ( QDebug dbg,
const QTransform & m )

Definition at line 1100 of file qtransform.cpp.

References typeStr().

+ Here is the call graph for this function:

◆ operator>>() [1/2]

QDataStream & operator>> ( QDataStream & s,
QTransform & t )
related

Definition at line 1076 of file qtransform.cpp.

◆ operator>>() [2/2]

QDataStream & operator>> ( QDataStream & s,
QTransform::Affine & m )

Definition at line 2189 of file qtransform.cpp.

◆ qt_regionToPath()

QPainterPath qt_regionToPath ( const QRegion & region)
extern

Definition at line 1007 of file qregion.cpp.

◆ qt_scaleForTransform()

Q_GUI_EXPORT bool qt_scaleForTransform ( const QTransform & transform,
qreal * scale )

Definition at line 2148 of file qtransform.cpp.

References qAbs(), qFuzzyCompare(), qMax(), qSqrt(), QTransform::TxRotate, QTransform::TxScale, and QTransform::TxTranslate.

Referenced by cubicTo_clipped(), QCoreTextFontEngine::draw(), QPixmapBlurFilter::draw(), QCoreTextFontEngine::imageForGlyph(), QStrokerOps::setCurveThresholdFromTransform(), QOutlineMapper::setMatrix(), QOpenGL2PaintEngineEx::stroke(), QRasterPaintEngine::updateMatrix(), and QX11PaintEngine::updateMatrix().

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