#include <SkPathOpsQuad.h>
|
bool | collapsed () const |
|
bool | controlsInside () const |
|
void | debugInit () |
|
void | debugSet (const SkDPoint *pts) |
|
SkDQuad | flip () const |
|
const SkDQuad & | set (const SkPoint pts[kPointCount] SkDEBUGPARAMS(SkOpGlobalState *state=nullptr)) |
|
const SkDPoint & | operator[] (int n) const |
|
SkDPoint & | operator[] (int n) |
|
void | align (int endIndex, SkDPoint *dstPt) const |
|
SkDQuadPair | chopAt (double t) const |
|
SkDVector | dxdyAtT (double t) const |
|
int | horizontalIntersect (double yIntercept, double roots[2]) const |
|
bool | hullIntersects (const SkDQuad &, bool *isLinear) const |
|
bool | hullIntersects (const SkDConic &, bool *isLinear) const |
|
bool | hullIntersects (const SkDCubic &, bool *isLinear) const |
|
bool | isLinear (int startIndex, int endIndex) const |
|
bool | monotonicInX () const |
|
bool | monotonicInY () const |
|
void | otherPts (int oddMan, const SkDPoint *endPt[2]) const |
|
SkDPoint | ptAtT (double t) const |
|
SkDQuad | subDivide (double t1, double t2) const |
|
void | subDivide (double t1, double t2, SkDQuad *quad) const |
|
SkDPoint | subDivide (const SkDPoint &a, const SkDPoint &c, double t1, double t2) const |
|
int | verticalIntersect (double xIntercept, double roots[2]) const |
|
SkDCubic | debugToCubic () const |
|
void | dump () const |
|
void | dumpID (int id) const |
|
void | dumpInner () const |
|
|
static bool | IsConic () |
|
static int | AddValidTs (double s[], int realRoots, double *t) |
|
static int | FindExtrema (const double src[], double tValue[1]) |
|
static int | maxIntersections () |
|
static int | pointCount () |
|
static int | pointLast () |
|
static int | RootsReal (double A, double B, double C, double t[2]) |
|
static int | RootsValidT (const double A, const double B, const double C, double s[2]) |
|
static void | SetABC (const double *quad, double *a, double *b, double *c) |
|
static SkDQuad | SubDivide (const SkPoint a[kPointCount], double t1, double t2) |
|
static SkDPoint | SubDivide (const SkPoint pts[kPointCount], const SkDPoint &a, const SkDPoint &c, double t1, double t2) |
|
Definition at line 34 of file SkPathOpsQuad.h.
◆ AddValidTs()
int SkDQuad::AddValidTs |
( |
double |
s[], |
|
|
int |
realRoots, |
|
|
double * |
t |
|
) |
| |
|
static |
Definition at line 116 of file SkPathOpsQuad.cpp.
116 {
117 int foundRoots = 0;
118 for (int index = 0; index < realRoots; ++index) {
119 double tValue =
s[index];
122 tValue = 0;
124 tValue = 1;
125 }
126 for (int idx2 = 0; idx2 < foundRoots; ++idx2) {
128 goto nextRoot;
129 }
130 }
131 t[foundRoots++] = tValue;
132 }
133nextRoot:
134 {}
135 }
136 return foundRoots;
137}
bool approximately_less_than_zero(double x)
bool approximately_equal(double x, double y)
bool approximately_one_or_less(double x)
bool approximately_zero_or_more(double x)
bool approximately_greater_than_one(double x)
◆ align()
void SkDQuad::align |
( |
int |
endIndex, |
|
|
SkDPoint * |
dstPt |
|
) |
| const |
Definition at line 301 of file SkPathOpsQuad.cpp.
301 {
302 if (
fPts[endIndex].fX ==
fPts[1].fX) {
304 }
305 if (
fPts[endIndex].fY ==
fPts[1].fY) {
307 }
308}
SkDPoint fPts[kPointCount]
◆ chopAt()
Definition at line 354 of file SkPathOpsQuad.cpp.
355{
360}
static double interp_quad_coords(const double *src, double t)
◆ collapsed()
bool SkDQuad::collapsed |
( |
| ) |
const |
|
inline |
Definition at line 41 of file SkPathOpsQuad.h.
41 {
43 }
bool approximatelyEqual(const SkDPoint &a) const
◆ controlsInside()
bool SkDQuad::controlsInside |
( |
| ) |
const |
|
inline |
Definition at line 45 of file SkPathOpsQuad.h.
45 {
49 return v02.
dot(v01) > 0 && v02.
dot(v12) > 0;
50 }
double dot(const SkDVector &a) const
◆ debugInit()
void SkDQuad::debugInit |
( |
| ) |
|
|
inline |
Definition at line 52 of file SkPathOpsQuad.h.
52 {
54 }
sk_bzero(glyphs, sizeof(glyphs))
◆ debugSet()
void SkDQuad::debugSet |
( |
const SkDPoint * |
pts | ) |
|
Definition at line 707 of file SkPathOpsDebug.cpp.
707 {
710}
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
◆ debugToCubic()
SkDCubic SkDQuad::debugToCubic |
( |
| ) |
const |
◆ dump()
void SkDQuad::dump |
( |
| ) |
const |
Definition at line 205 of file PathOpsDebug.cpp.
205 {
208}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
◆ dumpID()
void SkDQuad::dumpID |
( |
int |
id | ) |
const |
◆ dumpInner()
void SkDQuad::dumpInner |
( |
| ) |
const |
Definition at line 216 of file PathOpsDebug.cpp.
216 {
218 int index = 0;
219 do {
222 } while (++index < 2);
224}
◆ dxdyAtT()
Definition at line 206 of file SkPathOpsQuad.cpp.
206 {
208 double b = 1 - 2 * t;
209 double c = t;
215 } else {
216
218 }
219 }
221}
bool zero_or_one(double x)
◆ FindExtrema()
int SkDQuad::FindExtrema |
( |
const double |
src[], |
|
|
double |
tValue[1] |
|
) |
| |
|
static |
Quad'(t) = At + B, where A = 2(a - 2b + c) B = 2(b - a) Solve for t, only if it fits between 0 < t < 1
Definition at line 384 of file SkPathOpsQuad.cpp.
384 {
385
386
387
392}
static int valid_unit_divide(double numer, double denom, double *ratio)
◆ flip()
◆ horizontalIntersect()
int SkDQuad::horizontalIntersect |
( |
double |
yIntercept, |
|
|
double |
roots[2] |
|
) |
| const |
Return the number of valid roots (0 < root < 1) for this cubic intersecting the specified horizontal line.
Definition at line 472 of file SkDQuadLineIntersection.cpp.
472 {
474}
static double HorizontalIntercept(const SkDLine &line, double y)
◆ hullIntersects() [1/3]
bool SkDQuad::hullIntersects |
( |
const SkDConic & |
conic, |
|
|
bool * |
isLinear |
|
) |
| const |
Definition at line 91 of file SkPathOpsQuad.cpp.
91 {
93}
bool isLinear(int startIndex, int endIndex) const
◆ hullIntersects() [2/3]
bool SkDQuad::hullIntersects |
( |
const SkDCubic & |
cubic, |
|
|
bool * |
isLinear |
|
) |
| const |
◆ hullIntersects() [3/3]
bool SkDQuad::hullIntersects |
( |
const SkDQuad & |
q2, |
|
|
bool * |
isLinear |
|
) |
| const |
Definition at line 53 of file SkPathOpsQuad.cpp.
53 {
55 for (
int oddMan = 0; oddMan <
kPointCount; ++oddMan) {
58 double origX = endPt[0]->
fX;
59 double origY = endPt[0]->
fY;
60 double adj = endPt[1]->
fX - origX;
61 double opp = endPt[1]->
fY - origY;
62 double sign = (
fPts[oddMan].
fY - origY) * adj - (
fPts[oddMan].fX - origX) * opp;
64 continue;
65 }
67 bool foundOutlier = false;
69 double test = (q2[n].fY - origY) * adj - (q2[n].fX - origX) * opp;
71 foundOutlier = true;
72 break;
73 }
74 }
75 if (!foundOutlier) {
76 return false;
77 }
78 }
80
81
82
85 }
86 }
88 return true;
89}
static bool approximately_zero(double x)
static bool pointInTriangle(const SkDPoint fPts[3], const SkDPoint &test)
static bool matchesEnd(const SkDPoint fPts[3], const SkDPoint &test)
bool precisely_zero(double x)
static int sign(SkScalar x)
void otherPts(int oddMan, const SkDPoint *endPt[2]) const
static const int kPointCount
static sk_sp< SkShader > linear(sk_sp< SkShader > shader)
◆ IsConic()
static bool SkDQuad::IsConic |
( |
| ) |
|
|
inlinestatic |
◆ isLinear()
bool SkDQuad::isLinear |
( |
int |
startIndex, |
|
|
int |
endIndex |
|
) |
| const |
Definition at line 192 of file SkPathOpsQuad.cpp.
192 {
195
202 largest =
std::max(largest, -tiniest);
204}
bool approximately_zero_when_compared_to(double x, double y)
double controlPtDistance(const SkDCubic &pts, int index) const
bool quadEndPoints(const SkDQuad &pts)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
◆ maxIntersections()
static int SkDQuad::maxIntersections |
( |
| ) |
|
|
inlinestatic |
◆ monotonicInX()
bool SkDQuad::monotonicInX |
( |
| ) |
const |
Definition at line 253 of file SkPathOpsQuad.cpp.
253 {
255}
bool between(double a, double b, double c)
◆ monotonicInY()
bool SkDQuad::monotonicInY |
( |
| ) |
const |
◆ operator[]() [1/2]
◆ operator[]() [2/2]
◆ otherPts()
void SkDQuad::otherPts |
( |
int |
oddMan, |
|
|
const SkDPoint * |
endPt[2] |
|
) |
| const |
◆ pointCount()
static int SkDQuad::pointCount |
( |
| ) |
|
|
inlinestatic |
◆ pointLast()
static int SkDQuad::pointLast |
( |
| ) |
|
|
inlinestatic |
◆ ptAtT()
SkDPoint SkDQuad::ptAtT |
( |
double |
t | ) |
const |
Definition at line 224 of file SkPathOpsQuad.cpp.
224 {
225 if (0 == t) {
227 }
228 if (1 == t) {
230 }
231 double one_t = 1 - t;
232 double a = one_t * one_t;
233 double b = 2 * one_t * t;
234 double c = t * t;
238}
◆ RootsReal()
int SkDQuad::RootsReal |
( |
double |
A, |
|
|
double |
B, |
|
|
double |
C, |
|
|
double |
t[2] |
|
) |
| |
|
static |
Definition at line 169 of file SkPathOpsQuad.cpp.
169 {
172 }
173 const double p =
B / (2 *
A);
174 const double q =
C /
A;
177 }
178
179 const double p2 =
p *
p;
181 return 0;
182 }
183 double sqrt_D = 0;
184 if (p2 > q) {
185 sqrt_D =
sqrt(p2 - q);
186 }
190}
static int handle_zero(const double B, const double C, double s[2])
bool AlmostDequalUlps(float a, float b)
bool approximately_zero_inverse(double x)
SIN Vec< N, float > sqrt(const Vec< N, float > &x)
◆ RootsValidT()
int SkDQuad::RootsValidT |
( |
const double |
A, |
|
|
const double |
B, |
|
|
const double |
C, |
|
|
double |
s[2] |
|
) |
| |
|
static |
Definition at line 144 of file SkPathOpsQuad.cpp.
144 {
148 return foundRoots;
149}
static int RootsReal(double A, double B, double C, double t[2])
static int AddValidTs(double s[], int realRoots, double *t)
◆ set()
const SkDQuad & SkDQuad::set |
( |
const SkPoint pts |
SkDEBUGPARAMS(SkOpGlobalState *state=nullptr)[kPointCount] | ) |
|
|
inline |
◆ SetABC()
void SkDQuad::SetABC |
( |
const double * |
quad, |
|
|
double * |
a, |
|
|
double * |
b, |
|
|
double * |
c |
|
) |
| |
|
static |
◆ subDivide() [1/3]
Definition at line 310 of file SkPathOpsQuad.cpp.
310 {
314 SkDLine b0 = {{
a, sub[1] + (
a - sub[0])}};
315 SkDLine b1 = {{c, sub[1] + (c - sub[2])}};
317 i.intersectRay(b0, b1);
318 if (
i.used() == 1 &&
i[0][0] >= 0 &&
i[1][0] >= 0) {
320 } else {
323 }
324 if (t1 == 0 || t2 == 0) {
326 }
327 if (t1 == 1 || t2 == 1) {
329 }
334 }
339 }
341}
bool AlmostBequalUlps(float a, float b)
static SkDPoint Mid(const SkDPoint &a, const SkDPoint &b)
SkDQuad subDivide(double t1, double t2) const
void align(int endIndex, SkDPoint *dstPt) const
◆ SubDivide() [1/2]
static SkDQuad SkDQuad::SubDivide |
( |
const SkPoint |
a[kPointCount], |
|
|
double |
t1, |
|
|
double |
t2 |
|
) |
| |
|
inlinestatic |
Definition at line 110 of file SkPathOpsQuad.h.
110 {
114 }
const SkDQuad & set(const SkPoint pts[kPointCount] SkDEBUGPARAMS(SkOpGlobalState *state=nullptr))
◆ SubDivide() [2/2]
◆ subDivide() [2/3]
SkDQuad SkDQuad::subDivide |
( |
double |
t1, |
|
|
double |
t2 |
|
) |
| const |
Definition at line 285 of file SkPathOpsQuad.cpp.
285 {
286 if (0 == t1 && 1 == t2) {
287 return *this;
288 }
296 dst[1].fX = 2 *
dx - (
ax + cx) / 2;
297 dst[1].fY = 2 * dy - (ay + cy) / 2;
299}
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
◆ subDivide() [3/3]
void SkDQuad::subDivide |
( |
double |
t1, |
|
|
double |
t2, |
|
|
SkDQuad * |
quad |
|
) |
| const |
|
inline |
◆ verticalIntersect()
int SkDQuad::verticalIntersect |
( |
double |
xIntercept, |
|
|
double |
roots[2] |
|
) |
| const |
Return the number of valid roots (0 < root < 1) for this cubic intersecting the specified vertical line.
Definition at line 476 of file SkDQuadLineIntersection.cpp.
476 {
478}
static double VerticalIntercept(const SkDLine &line, double x)
◆ fPts
◆ kMaxIntersections
const int SkDQuad::kMaxIntersections = 4 |
|
static |
◆ kPointCount
const int SkDQuad::kPointCount = 3 |
|
static |
◆ kPointLast
The documentation for this struct was generated from the following files: