#include <SkBezierCurves.h>
Definition at line 76 of file SkBezierCurves.h.
◆ Intersect()
SkSpan< const float > SkBezierQuad::Intersect |
( |
double |
AX, |
|
|
double |
BX, |
|
|
double |
CX, |
|
|
double |
AY, |
|
|
double |
BY, |
|
|
double |
CY, |
|
|
double |
yIntercept, |
|
|
float |
intersectionStorage[2] |
|
) |
| |
|
static |
Given AY*t^2 -2*BY*t + CY = 0 and AX*t^2 - 2*BX*t + CX = 0,
Find the t where AY*t^2 - 2*BY*t + CY - y = 0, then return AX*t^2 + - 2*BX*t + CX where t is on [0, 1].
- y - is the height of the line which intersects the quadratic.
- intersectionStorage - is the array to hold the return data pointed to in the span.
Returns a span with the intersections of yIntercept, and the quadratic formed by A, B, and C.
Definition at line 207 of file SkBezierCurves.cpp.
209 {
211
212 int intersectionCount = 0;
213
214
215 const double t0 = pinTRange(r0);
216 if (0 <= t0 && t0 <= 1) {
218 }
219
220 const double t1 = pinTRange(r1);
221 if (0 <= t1 && t1 <= 1 && t1 != t0) {
223 }
224
225 return SkSpan{intersectionStorage, intersectionCount};
226}
#define AX(width, name,...)
static RootResult Roots(double A, double B, double C)
static double EvalAt(double A, double B, double C, double t)
◆ IntersectWithHorizontalLine()
SkSpan< const float > SkBezierQuad::IntersectWithHorizontalLine |
( |
SkSpan< const SkPoint > |
controlPoints, |
|
|
float |
yIntercept, |
|
|
float |
intersectionStorage[2] |
|
) |
| |
|
static |
Definition at line 189 of file SkBezierCurves.cpp.
190 {
192 const DPoint p0 = controlPoints[0],
193 p1 = controlPoints[1],
194 p2 = controlPoints[2];
195
196
197 const DPoint
A = p0 - 2 * p1 + p2,
198
199
200
203
204 return Intersect(
A.x,
B.x,
C.x,
A.y,
B.y,
C.y, yIntercept, intersectionStorage);
205}
static SkSpan< const float > Intersect(double AX, double BX, double CX, double AY, double BY, double CY, double yIntercept, float intersectionStorage[2])
constexpr size_t size() const
The documentation for this class was generated from the following files: