HikoGUI
A low latency retained GUI
|
#include <hikogui/graphic_path/bezier_curve.hpp>
Data Structures | |
struct | sdf_distance_result |
Public Types | |
enum class | Type : uint8_t { None , Linear , Quadratic , Cubic } |
Public Member Functions | |
bezier_curve (bezier_curve const &other) noexcept=default | |
bezier_curve (bezier_curve &&other) noexcept=default | |
bezier_curve & | operator= (bezier_curve const &other) noexcept=default |
bezier_curve & | operator= (bezier_curve &&other) noexcept=default |
bezier_curve (point2 const P1, point2 const P2) noexcept | |
bezier_curve (point2 const P1, point2 const C1, point2 const P2) noexcept | |
bezier_curve (point2 const P1, point2 const C1, point2 const C2, point2 const P2) noexcept | |
bezier_curve (Type const type, point2 const P1, point2 const C1, point2 const C2, point2 const P2) noexcept | |
point2 | pointAt (float const t) const noexcept |
constexpr vector2 | tangentAt (float const t) const noexcept |
lean_vector< float > | solveXByY (float const y) const noexcept |
hi_force_inline lean_vector< float > | solveTForNormalsIntersectingPoint (point2 P) const noexcept |
sdf_distance_result | sdf_distance (point2 P) const noexcept |
Find the distance from the point to the curve. | |
std::pair< bezier_curve, bezier_curve > | cubicSplit (float const t) const noexcept |
std::pair< bezier_curve, bezier_curve > | quadraticSplit (float const t) const noexcept |
std::pair< bezier_curve, bezier_curve > | linearSplit (float const t) const noexcept |
std::pair< bezier_curve, bezier_curve > | split (float const t) const noexcept |
void | subdivideUntilFlat_impl (std::vector< bezier_curve > &r, float const minimumFlatness) const noexcept |
std::vector< bezier_curve > | subdivideUntilFlat (float const tolerance) const noexcept |
float | flatness () const noexcept |
bezier_curve | toParallelLine (float const offset) const noexcept |
Data Fields | |
Type | type |
point2 | P1 |
First point. | |
point2 | C1 |
Control point. | |
point2 | C2 |
Control point. | |
point2 | P2 |
Last point. | |
Friends | |
bool | operator== (bezier_curve const &lhs, bezier_curve const &rhs) noexcept |
bezier_curve | operator* (transformer2 auto const &lhs, bezier_curve const &rhs) noexcept |
bezier_curve | operator~ (bezier_curve 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.
If the distances are equal between two curves, take the one with a maximum orthognality. If the orthogonality >= then the point is inside that edge.
P | The point from which to calculate the distance to this 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. |
|
inlineconstexprnoexcept |
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.
point2 hi::v1::bezier_curve::C1 |
Control point.
point2 hi::v1::bezier_curve::C2 |
Control point.
point2 hi::v1::bezier_curve::P1 |
First point.
point2 hi::v1::bezier_curve::P2 |
Last point.