HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Friends
hi::v1::bezier_point Struct Reference

#include <hikogui/graphic_path/bezier_point.hpp>

Public Types

enum class  Type { Anchor , QuadraticControl , CubicControl1 , CubicControl2 }
 

Public Member Functions

constexpr bezier_point (point2 const p, Type const type) noexcept
 
constexpr bezier_point (float const x, float const y, Type const type) noexcept
 

Static Public Member Functions

static constexpr std::vector< bezier_pointnormalizePoints (std::vector< bezier_point >::const_iterator const begin, std::vector< bezier_point >::const_iterator const end) noexcept
 

Data Fields

Type type
 
point2 p
 

Friends

constexpr friend bool operator== (bezier_point const &, bezier_point const &) noexcept=default
 
constexpr friend bezier_point operator* (transformer2 auto const &lhs, bezier_point const &rhs) noexcept
 Transform the point.
 

Detailed Description

A point or control-point on contour of bezier curves. The bezier curves can be linear (a line), quadratic or cubic.

Member Function Documentation

◆ normalizePoints()

static constexpr std::vector< bezier_point > hi::v1::bezier_point::normalizePoints ( std::vector< bezier_point >::const_iterator const begin,
std::vector< bezier_point >::const_iterator const end )
inlinestaticconstexprnoexcept

Normalize points in a list. The following normalizations are executed:

  • Missing anchor points between two quadratic-control-points are added.
  • Missing first-cubic-control-points are added by reflecting the previous second-control point around the previous anchor.
  • The list of points will start with an anchor.
  • The list will close with the first anchor.
Parameters
beginiterator to the start of the bezier point list.
enditerator beyond the end of the bezier point list.
Returns
a vector of bezier point that include all the anchor and control points.

Friends And Related Symbol Documentation

◆ operator*

constexpr friend bezier_point operator* ( transformer2 auto const & lhs,
bezier_point const & rhs )
friend

Transform the point.


The documentation for this struct was generated from the following file: