OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2012 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 #ifndef SkPathOpsLine_DEFINED |
| 8 #define SkPathOpsLine_DEFINED |
| 9 |
| 10 #include "SkPathOpsPoint.h" |
| 11 |
| 12 struct SkDLine { |
| 13 SkDPoint fPts[2]; |
| 14 |
| 15 void set(const SkPoint pts[2]) { |
| 16 fPts[0] = pts[0]; |
| 17 fPts[1] = pts[1]; |
| 18 } |
| 19 |
| 20 const SkDPoint& operator[](int n) const { return fPts[n]; } |
| 21 SkDPoint& operator[](int n) { return fPts[n]; } |
| 22 |
| 23 // bool implicitLine(double* slope, double* axisIntercept) const; // uncalled |
| 24 // int reduceOrder(SkDLine* reduced) const; // uncalled |
| 25 double isLeft(const SkDPoint& pt) const; |
| 26 SkDLine subDivide(double t1, double t2) const; |
| 27 static SkDLine SubDivide(const SkPoint a[2], double t1, double t2) { |
| 28 SkDLine line; |
| 29 line.set(a); |
| 30 return line.subDivide(t1, t2); |
| 31 } |
| 32 // double tAt(const SkDPoint& ) const; // uncalled |
| 33 SkDPoint xyAtT(double t) const; |
| 34 private: |
| 35 SkDVector tangent() const { return fPts[0] - fPts[1]; } |
| 36 }; |
| 37 |
| 38 #endif |
OLD | NEW |