OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #if !defined CUBIC_UTILITIES_H | 7 #if !defined CUBIC_UTILITIES_H |
8 #define CUBIC_UTILITIES_H | 8 #define CUBIC_UTILITIES_H |
9 | 9 |
10 #include "DataTypes.h" | 10 #include "DataTypes.h" |
11 #include "SkTDArray.h" | 11 #include "SkTDArray.h" |
12 | 12 |
13 double calcPrecision(const Cubic& cubic); | 13 double calcPrecision(const Cubic& cubic); |
14 #if SK_DEBUG | 14 #ifdef SK_DEBUG |
15 double calcPrecision(const Cubic& cubic, double t, double scale); | 15 double calcPrecision(const Cubic& cubic, double t, double scale); |
16 #endif | 16 #endif |
17 void chop_at(const Cubic& src, CubicPair& dst, double t); | 17 void chop_at(const Cubic& src, CubicPair& dst, double t); |
18 bool clockwise(const Cubic& c); | 18 bool clockwise(const Cubic& c); |
19 double cube_root(double x); | 19 double cube_root(double x); |
20 int cubic_to_quadratics(const Cubic& cubic, double precision, | 20 int cubic_to_quadratics(const Cubic& cubic, double precision, |
21 SkTDArray<Quadratic>& quadratics); | 21 SkTDArray<Quadratic>& quadratics); |
22 void cubic_to_quadratics(const Cubic& cubic, double precision, SkTDArray<double>
& ts); | 22 void cubic_to_quadratics(const Cubic& cubic, double precision, SkTDArray<double>
& ts); |
23 void coefficients(const double* cubic, double& A, double& B, double& C, double&
D); | 23 void coefficients(const double* cubic, double& A, double& B, double& C, double&
D); |
24 bool controls_contained_by_ends(const Cubic& c); | 24 bool controls_contained_by_ends(const Cubic& c); |
(...skipping 12 matching lines...) Expand all Loading... |
37 bool serpentine(const Cubic& c); | 37 bool serpentine(const Cubic& c); |
38 void sub_divide(const Cubic& src, double t1, double t2, Cubic& dst); | 38 void sub_divide(const Cubic& src, double t1, double t2, Cubic& dst); |
39 void sub_divide(const Cubic& , const _Point& a, const _Point& d, double t1, doub
le t2, _Point [2]); | 39 void sub_divide(const Cubic& , const _Point& a, const _Point& d, double t1, doub
le t2, _Point [2]); |
40 _Point top(const Cubic& , double startT, double endT); | 40 _Point top(const Cubic& , double startT, double endT); |
41 void xy_at_t(const Cubic& , double t, double& x, double& y); | 41 void xy_at_t(const Cubic& , double t, double& x, double& y); |
42 _Point xy_at_t(const Cubic& , double t); | 42 _Point xy_at_t(const Cubic& , double t); |
43 | 43 |
44 extern const int gPrecisionUnit; | 44 extern const int gPrecisionUnit; |
45 | 45 |
46 #endif | 46 #endif |
OLD | NEW |