![]() |
Qt 6.x
The Qt SDK
|
#include <QtGui/private/qtguiglobal_p.h>
#include "QtGui/qpainterpath.h"
#include "private/qdatabuffer_p.h"
#include "private/qnumeric_p.h"
Go to the source code of this file.
Classes | |
struct | qfixed2d |
class | QStrokerOps |
struct | QStrokerOps::Element |
class | QStroker |
class | QDashStroker |
Macros | |
#define | qt_real_to_fixed(real) qfixed(real) |
#define | qt_fixed_to_real(fixed) fixed |
#define | QT_PATH_KAPPA 0.5522847498 |
Typedefs | |
typedef void(* | qStrokerMoveToHook) (qfixed x, qfixed y, void *data) |
typedef void(* | qStrokerLineToHook) (qfixed x, qfixed y, void *data) |
typedef void(* | qStrokerCubicToHook) (qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey, void *data) |
Functions | |
QPointF | qt_curves_for_arc (const QRectF &rect, qreal startAngle, qreal sweepLength, QPointF *controlPoints, int *point_count) |
qreal | qt_t_for_arc_angle (qreal angle) |
Q_GUI_EXPORT bool | qt_scaleForTransform (const QTransform &transform, qreal *scale) |
Variables | |
QT_BEGIN_NAMESPACE typedef qreal | qfixed |
#define qt_fixed_to_real | ( | fixed | ) | fixed |
Definition at line 65 of file qstroker_p.h.
#define QT_PATH_KAPPA 0.5522847498 |
Definition at line 77 of file qstroker_p.h.
#define qt_real_to_fixed | ( | real | ) | qfixed(real) |
Definition at line 64 of file qstroker_p.h.
typedef void(* qStrokerCubicToHook) (qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey, void *data) |
Definition at line 86 of file qstroker_p.h.
Definition at line 85 of file qstroker_p.h.
Definition at line 84 of file qstroker_p.h.
QPointF qt_curves_for_arc | ( | const QRectF & | rect, |
qreal | startAngle, | ||
qreal | sweepLength, | ||
QPointF * | curves, | ||
int * | point_count | ||
) |
Creates a number of curves for a given arc definition. The arc is defined an arc along the ellipses that fits into rect starting at startAngle and an arc length of sweepLength.
The function has three out parameters. The return value is the starting point of the arc. The curves array represents the list of cubicTo elements up to a maximum of point_count. There are of course 3 points pr curve.
Definition at line 816 of file qstroker.cpp.
References QBezier::fromPoints(), i, j, Q_ASSERT, qFloor(), qFuzzyCompare(), qFuzzyIsNull(), qt_find_ellipse_coords(), qt_is_nan(), QT_PATH_KAPPA, qt_t_for_arc_angle(), qWarning, and rect.
Referenced by QPainterPath::addEllipse(), QPainterPath::arcTo(), QPaintEngineEx::drawEllipse(), QStroker::joinPoints(), and QStrokerOps::strokeEllipse().
Q_GUI_EXPORT bool qt_scaleForTransform | ( | const QTransform & | transform, |
qreal * | scale | ||
) |
Definition at line 2301 of file qtransform.cpp.
For a given angle in the range [0 .. 90], finds the corresponding parameter t of the prototype cubic bezier arc segment b = fromPoints(QPointF(1, 0), QPointF(1, KAPPA), QPointF(KAPPA, 1), QPointF(0, 1));
From the bezier equation: b.pointAt(t).x() = (1-t)^3 + t*(1-t)^2 + t^2*(1-t)*KAPPA b.pointAt(t).y() = t*(1-t)^2 * KAPPA + t^2*(1-t) + t^3
Third degree coefficients: b.pointAt(t).x() = at^3 + bt^2 + ct + d where a = 2-3*KAPPA, b = 3*(KAPPA-1), c = 0, d = 1
b.pointAt(t).y() = at^3 + bt^2 + ct + d where a = 3*KAPPA-2, b = 6*KAPPA+3, c = 3*KAPPA, d = 0
Newton's method to find the zero of a function: given a function f(x) and initial guess x_0 x_1 = f(x_0) / f'(x_0) x_2 = f(x_1) / f'(x_1) etc...
Definition at line 756 of file qstroker.cpp.
References d, qCos(), qDegreesToRadians(), qFuzzyCompare(), qFuzzyIsNull(), qSin(), and QT_PATH_KAPPA.
Referenced by qt_curves_for_arc(), and qt_find_ellipse_coords().
QT_BEGIN_NAMESPACE typedef qreal qfixed |
Definition at line 63 of file qstroker_p.h.
Referenced by QStroker::joinPoints(), QDashStroker::patternForStyle(), QDashStroker::processCurrentSubpath(), and qt_stroke_side().