Home | History | Annotate | Download | only in pathops

Lines Matching full:line

12    From http://en.wikipedia.org/wiki/Line-line_intersection
14 SkDPoint SkIntersections::Line(const SkDLine& a, const SkDLine& b) {
58 void SkIntersections::computePoints(const SkDLine& line, int used) {
59 fPt[0] = line.ptAtT(fT[0][0]);
61 fPt[1] = line.ptAtT(fT[0][1]);
114 // see if end points intersect the opposite line
126 /* Determine the intersection point of two line segments
211 static int horizontal_coincident(const SkDLine& line, double y) {
212 double min = line[0].fY;
213 double max = line[1].fY;
220 if (AlmostEqualUlps(min, max) && max - min < fabs(line[0].fX - line[1].fX)) {
226 static double horizontal_intercept(const SkDLine& line, double y) {
227 return SkPinT((y - line[0].fY) / (line[1].fY - line[0].fY));
230 int SkIntersections::horizontal(const SkDLine& line, double y) {
232 int horizontalType = horizontal_coincident(line, y);
234 fT[0][0] = horizontal_intercept(line, y);
242 int SkIntersections::horizontal(const SkDLine& line, double left, double right,
245 // see if end points intersect the opposite line
248 if ((t = line.exactPoint(leftPt)) >= 0) {
253 if ((t = line.exactPoint(rightPt)) >= 0) {
257 if ((t = SkDLine::ExactPointH(line[index], left, right, y)) >= 0) {
258 insert((double) index, flipped ? 1 - t : t, line[index]);
262 int result = horizontal_coincident(line, y);
264 fT[0][0] = horizontal_intercept(line, y);
265 double xIntercept = line[0].fX + fT[0][0] * (line[1].fX - line[0].fX);
269 // OPTIMIZATION: ? instead of swapping, pass original line, use [1].fX - [0].fX
280 if ((t = line.nearPoint(leftPt, NULL)) >= 0) {
285 if ((t = line.nearPoint(rightPt, NULL)) >= 0) {
289 if ((t = SkDLine::NearPointH(line[index], left, right, y)) >= 0) {
290 insert((double) index, flipped ? 1 - t : t, line[index]);
299 static int vertical_coincident(const SkDLine& line, double x) {
300 double min = line[0].fX;
301 double max = line[1].fX;
314 static double vertical_intercept(const SkDLine& line, double x) {
315 return SkPinT((x - line[0].fX) / (line[1].fX - line[0].fX));
318 int SkIntersections::vertical(const SkDLine& line, double x) {
320 int verticalType = vertical_coincident(line, x);
322 fT[0][0] = vertical_intercept(line, x);
330 int SkIntersections::vertical(const SkDLine& line, double top, double bottom,
332 fMax = 3; // cleanup parallel lines will bring this back line
333 // see if end points intersect the opposite line
336 if ((t = line.exactPoint(topPt)) >= 0) {
341 if ((t = line.exactPoint(bottomPt)) >= 0) {
345 if ((t = SkDLine::ExactPointV(line[index], top, bottom, x)) >= 0) {
346 insert((double) index, flipped ? 1 - t : t, line[index]);
350 int result = vertical_coincident(line, x);
352 fT[0][0] = vertical_intercept(line, x);
353 double yIntercept = line[0].fY + fT[0][0] * (line[1].fY - line[0].fY);
357 // OPTIMIZATION: instead of swapping, pass original line, use [1].fY - [0].fY
368 if ((t = line.nearPoint(topPt, NULL)) >= 0) {
373 if ((t = line.nearPoint(bottomPt, NULL)) >= 0) {
377 if ((t = SkDLine::NearPointV(line[index], top, bottom, x)) >= 0) {
378 insert((double) index, flipped ? 1 - t : t, line[index]);