|
HikoGUI
A low latency retained GUI
|
#include <TTauri/Foundation/BezierCurve.hpp>
Public Types | |
| enum class | Type : uint8_t { None , Linear , Quadratic , Cubic } |
| enum class | Color : uint8_t { Yellow , Magenta , Cyan , White } |
Public Member Functions | |
| BezierCurve (BezierCurve const &other) noexcept=default | |
| BezierCurve (BezierCurve &&other) noexcept=default | |
| BezierCurve & | operator= (BezierCurve const &other) noexcept=default |
| BezierCurve & | operator= (BezierCurve &&other) noexcept=default |
| BezierCurve (vec const P1, vec const P2, Color color=Color::White) noexcept | |
| BezierCurve (vec const P1, vec const C1, vec const P2, Color color=Color::White) noexcept | |
| BezierCurve (vec const P1, vec const C1, vec const C2, vec const P2, Color color=Color::White) noexcept | |
| BezierCurve (Type const type, vec const P1, vec const C1, vec const C2, vec const P2, Color color=Color::White) noexcept | |
| bool | has_red () const noexcept |
| bool | has_green () const noexcept |
| bool | has_blue () const noexcept |
| vec | pointAt (float const t) const noexcept |
| vec | tangentAt (float const t) const noexcept |
| results< float, 3 > | solveXByY (float const y) const noexcept |
| results< float, 3 > | solveTForNormalsIntersectingPoint (vec P) const noexcept |
| float | sdf_distance (vec P) const noexcept |
| Find the distance from the point to the curve. | |
| std::pair< BezierCurve, BezierCurve > | cubicSplit (float const t) const noexcept |
| std::pair< BezierCurve, BezierCurve > | quadraticSplit (float const t) const noexcept |
| std::pair< BezierCurve, BezierCurve > | linearSplit (float const t) const noexcept |
| std::pair< BezierCurve, BezierCurve > | split (float const t) const noexcept |
| void | subdivideUntilFlat_impl (std::vector< BezierCurve > &r, float const minimumFlatness) const noexcept |
| std::vector< BezierCurve > | subdivideUntilFlat (float const tolerance) const noexcept |
| float | flatness () const noexcept |
| template<typename M , std::enable_if_t< is_mat_v< M >, int > = 0> | |
| BezierCurve & | operator*= (M const rhs) noexcept |
| BezierCurve | toParrallelLine (float const offset) const noexcept |
Data Fields | |
| Type | type |
| Color | color |
| vec | P1 |
| First point. | |
| vec | C1 |
| Control point. | |
| vec | C2 |
| Control point. | |
| vec | P2 |
| Last point. | |
Friends | |
| bool | operator== (BezierCurve const &lhs, BezierCurve const &rhs) noexcept |
| template<typename M , std::enable_if_t< is_mat_v< M >, int > = 0> | |
| BezierCurve | operator* (M const &lhs, BezierCurve const &rhs) noexcept |
| BezierCurve | operator~ (BezierCurve const &rhs) noexcept |
Bezier Curve A linear, quadratic or cubic bezier curve.
|
inlinenoexcept |
Construct a linear bezier-curve.
|
inlinenoexcept |
Construct a quadratic bezier-curve.
|
inlinenoexcept |
Construct a cubic bezier-curve.
|
inlinenoexcept |
Construct a bezier-curve of any type.
|
inlinenoexcept |
Split a cubic bezier-curve into two cubic bezier-curve.
| t | a relative distance between 0.0 (point P1) and 1.0 (point P2) where to split the curve. |
|
inlinenoexcept |
Return the flatness of a curve.
|
inlinenoexcept |
Split a linear bezier-curve into two linear bezier-curve.
| t | a relative distance between 0.0 (point P1) and 1.0 (point P2) where to split the curve. |
|
inlinenoexcept |
Return a point on the bezier-curve. Values of t beyond 0.0 and 1.0 will find a point extrapolated beyond the bezier segment.
| t | a relative distance between 0.0 (point P1) and 1.0 (point P2). |
|
inlinenoexcept |
Split a quadratic bezier-curve into two quadratic bezier-curve.
| t | a relative distance between 0.0 (point P1) and 1.0 (point P2) where to split the curve. |
|
inlinenoexcept |
Find the distance from the point to the curve.
|
inlinenoexcept |
Return the x values where the curve crosses the y-axis.
| y | y-axis. |
|
inlinenoexcept |
Split a bezier-curve into two bezier-curve of the same type.
| t | a relative distance between 0.0 (point P1) and 1.0 (point P2) where to split the curve. |
|
inlinenoexcept |
Subdivide a bezier-curve until each are flat enough.
| tolerance | maximum amount of curviness. |
|
inlinenoexcept |
Subdivide a bezier-curve until each are flat enough.
| r | resulting list of linear segments. |
| minimumFlatness | minimum amount of flatness of the resulting curve segments. |
|
inlinenoexcept |
Return a tangent on the bezier-curve. Values of t beyond 0.0 and 1.0 will find a point extrapolated beyond the bezier segment.
| t | a relative distance between 0.0 (point P1) and 1.0 (point P2). |
|
inlinenoexcept |
Return a line-segment from a curve at a certain distance.
| offset | positive means the parallel line will be on the starboard of the curve. |
|
friend |
Reverse direction of a curve.
| vec tt::BezierCurve::C1 |
Control point.
| vec tt::BezierCurve::C2 |
Control point.
| vec tt::BezierCurve::P1 |
First point.
| vec tt::BezierCurve::P2 |
Last point.