#include <SkPathOpsLine.h>
|
static double | ExactPointH (const SkDPoint &xy, double left, double right, double y) |
|
static double | ExactPointV (const SkDPoint &xy, double top, double bottom, double x) |
|
static double | NearPointH (const SkDPoint &xy, double left, double right, double y) |
|
static double | NearPointV (const SkDPoint &xy, double top, double bottom, double x) |
|
Definition at line 14 of file SkPathOpsLine.h.
◆ dump()
void SkDLine::dump |
( |
| ) |
const |
Definition at line 163 of file PathOpsDebug.cpp.
163 {
166}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
◆ dumpID()
void SkDLine::dumpID |
( |
int |
id | ) |
const |
Definition at line 168 of file PathOpsDebug.cpp.
168 {
172}
void DumpID(const SkDConic &, int id)
◆ dumpInner()
void SkDLine::dumpInner |
( |
| ) |
const |
◆ exactPoint()
double SkDLine::exactPoint |
( |
const SkDPoint & |
xy | ) |
const |
Definition at line 26 of file SkPathOpsLine.cpp.
26 {
28 return 0;
29 }
31 return 1;
32 }
33 return -1;
34}
◆ ExactPointH()
double SkDLine::ExactPointH |
( |
const SkDPoint & |
xy, |
|
|
double |
left, |
|
|
double |
right, |
|
|
double |
y |
|
) |
| |
|
static |
Definition at line 86 of file SkPathOpsLine.cpp.
86 {
89 return 0;
90 }
92 return 1;
93 }
94 }
95 return -1;
96}
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
◆ ExactPointV()
double SkDLine::ExactPointV |
( |
const SkDPoint & |
xy, |
|
|
double |
top, |
|
|
double |
bottom, |
|
|
double |
x |
|
) |
| |
|
static |
Definition at line 121 of file SkPathOpsLine.cpp.
121 {
124 return 0;
125 }
126 if (xy.
fY == bottom) {
127 return 1;
128 }
129 }
130 return -1;
131}
◆ nearPoint()
double SkDLine::nearPoint |
( |
const SkDPoint & |
xy, |
|
|
bool * |
unequal |
|
) |
| const |
Definition at line 36 of file SkPathOpsLine.cpp.
36 {
39 return -1;
40 }
41
45 double numer =
len.fX * ab0.
fX + ab0.
fY *
len.fY;
46 if (!
between(0, numer, denom)) {
47 return -1;
48 }
49 if (!denom) {
50 return 0;
51 }
52 double t = numer / denom;
55
56 double tiniest = std::min(std::min(std::min(
fPts[0].fX,
fPts[0].fY),
fPts[1].fX),
fPts[1].fY);
57 double largest = std::max(std::max(std::max(
fPts[0].fX,
fPts[0].fY),
fPts[1].fX),
fPts[1].fY);
58 largest = std::max(largest, -tiniest);
60 return -1;
61 }
62 if (unequal) {
63 *unequal = (
float) largest != (
float) (largest + dist);
64 }
67 return t;
68}
static bool between(SkScalar a, SkScalar b, SkScalar c)
bool AlmostEqualUlps_Pin(float a, float b)
bool AlmostBetweenUlps(float a, float b, float c)
SkDPoint ptAtT(double t) const
double distance(const SkDPoint &a) const
◆ NearPointH()
double SkDLine::NearPointH |
( |
const SkDPoint & |
xy, |
|
|
double |
left, |
|
|
double |
right, |
|
|
double |
y |
|
) |
| |
|
static |
Definition at line 98 of file SkPathOpsLine.cpp.
98 {
100 return -1;
101 }
103 return -1;
104 }
108 double realPtX = (1 - t) *
left + t *
right;
110 double distSq = distU.
fX * distU.
fX + distU.
fY * distU.
fY;
111 double dist =
sqrt(distSq);
112 double tiniest = std::min(std::min(
y,
left),
right);
113 double largest = std::max(std::max(
y,
left),
right);
114 largest = std::max(largest, -tiniest);
116 return -1;
117 }
118 return t;
119}
bool AlmostEqualUlps(const SkPoint &pt1, const SkPoint &pt2)
bool AlmostBequalUlps(float a, float b)
SIN Vec< N, float > sqrt(const Vec< N, float > &x)
◆ NearPointV()
double SkDLine::NearPointV |
( |
const SkDPoint & |
xy, |
|
|
double |
top, |
|
|
double |
bottom, |
|
|
double |
x |
|
) |
| |
|
static |
Definition at line 133 of file SkPathOpsLine.cpp.
133 {
135 return -1;
136 }
138 return -1;
139 }
140 double t = (xy.
fY - top) / (bottom - top);
143 double realPtY = (1 - t) * top + t * bottom;
145 double distSq = distU.
fX * distU.
fX + distU.
fY * distU.
fY;
146 double dist =
sqrt(distSq);
147 double tiniest = std::min(std::min(
x, top), bottom);
148 double largest = std::max(std::max(
x, top), bottom);
149 largest = std::max(largest, -tiniest);
151 return -1;
152 }
153 return t;
154}
◆ nearRay()
bool SkDLine::nearRay |
( |
const SkDPoint & |
xy | ) |
const |
Definition at line 70 of file SkPathOpsLine.cpp.
70 {
71
75 double numer =
len.fX * ab0.
fX + ab0.
fY *
len.fY;
76 double t = numer / denom;
79
80 double tiniest = std::min(std::min(std::min(
fPts[0].fX,
fPts[0].fY),
fPts[1].fX),
fPts[1].fY);
81 double largest = std::max(std::max(std::max(
fPts[0].fX,
fPts[0].fY),
fPts[1].fX),
fPts[1].fY);
82 largest = std::max(largest, -tiniest);
84}
bool RoughlyEqualUlps(float a, float b)
◆ operator[]() [1/2]
◆ operator[]() [2/2]
◆ ptAtT()
SkDPoint SkDLine::ptAtT |
( |
double |
t | ) |
const |
Definition at line 14 of file SkPathOpsLine.cpp.
14 {
15 if (0 == t) {
17 }
18 if (1 == t) {
20 }
21 double one_t = 1 - t;
24}
◆ set()
◆ fPts
The documentation for this struct was generated from the following files: