int verticalIntersect(double axisIntercept, double top, double bottom) { int roots = verticalIntersect(axisIntercept); for (int index = 0; index < roots; ) { double y; xy_at_t(quad, intersections.fT[0][index], *(double*) NULL, y); double lineT = (y - top) / (bottom - top); if (lineIntersects(lineT, index, roots)) { ++index; } } return roots; }
int verticalIntersect(double axisIntercept, double top, double bottom, bool flipped) { addVerticalEndPoints(top, bottom, axisIntercept); double rootVals[2]; int roots = verticalIntersect(axisIntercept, rootVals); for (int index = 0; index < roots; ++index) { double quadT = rootVals[index]; SkDPoint pt = quad.xyAtT(quadT); double lineT = (pt.fY - top) / (bottom - top); if (PinTs(&quadT, &lineT)) { intersections->insert(quadT, lineT, pt); } } if (flipped) { intersections->flip(); } return intersections->used(); }
int verticalIntersect(double axisIntercept, double top, double bottom, bool flipped) { addVerticalEndPoints(top, bottom, axisIntercept); double rootVals[2]; int roots = verticalIntersect(axisIntercept, rootVals); for (int index = 0; index < roots; ++index) { double y; double quadT = rootVals[index]; xy_at_t(quad, quadT, *(double*) NULL, y); double lineT = (y - top) / (bottom - top); if (pinTs(quadT, lineT)) { intersections.insert(quadT, lineT); } } if (flipped) { flip(); } return intersections.fUsed; }
int verticalIntersect(double axisIntercept, double top, double bottom, bool flipped) { addExactVerticalEndPoints(top, bottom, axisIntercept); if (fAllowNear) { addNearVerticalEndPoints(top, bottom, axisIntercept); } double rootVals[2]; int roots = verticalIntersect(axisIntercept, rootVals); for (int index = 0; index < roots; ++index) { double quadT = rootVals[index]; SkDPoint pt = fQuad.ptAtT(quadT); double lineT = (pt.fY - top) / (bottom - top); 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); }