int horizontalIntersect(double axisIntercept, double left, double right) { int roots = horizontalIntersect(axisIntercept); for (int index = 0; index < roots; ) { double x; xy_at_t(quad, intersections.fT[0][index], x, *(double*) NULL); double lineT = (x - left) / (right - left); if (lineIntersects(lineT, index, roots)) { ++index; } } return roots; }
int horizontalIntersect(double axisIntercept, double left, double right, bool flipped) { addHorizontalEndPoints(left, right, axisIntercept); double rootVals[2]; int roots = horizontalIntersect(axisIntercept, rootVals); for (int index = 0; index < roots; ++index) { double quadT = rootVals[index]; SkDPoint pt = quad.xyAtT(quadT); double lineT = (pt.fX - left) / (right - left); if (PinTs(&quadT, &lineT)) { intersections->insert(quadT, lineT, pt); } } if (flipped) { intersections->flip(); } return intersections->used(); }
int horizontalIntersect(double axisIntercept, double left, double right, bool flipped) { addHorizontalEndPoints(left, right, axisIntercept); double rootVals[2]; int roots = horizontalIntersect(axisIntercept, rootVals); for (int index = 0; index < roots; ++index) { double x; double quadT = rootVals[index]; xy_at_t(quad, quadT, x, *(double*) NULL); double lineT = (x - left) / (right - left); if (pinTs(quadT, lineT)) { intersections.insert(quadT, lineT); } } if (flipped) { flip(); } return intersections.fUsed; }
int horizontalIntersect(double axisIntercept, double left, double right, bool flipped) { addExactHorizontalEndPoints(left, right, axisIntercept); if (fAllowNear) { addNearHorizontalEndPoints(left, right, axisIntercept); } double rootVals[2]; int roots = horizontalIntersect(axisIntercept, rootVals); for (int index = 0; index < roots; ++index) { double quadT = rootVals[index]; SkDPoint pt = fQuad.ptAtT(quadT); double lineT = (pt.fX - left) / (right - left); if (pinTs(&quadT, &lineT, &pt, kPointInitialized)) { fIntersections->insert(quadT, lineT, pt); } } if (flipped) { fIntersections->flip(); } return fIntersections->used(); }
double axialIntersect(const Quadratic& q1, const _Point& p, bool vertical) { if (vertical) { return verticalIntersect(q1, p); } return horizontalIntersect(q1, p); }