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

#include <TTauri/Foundation/BezierPoint.hpp>

Public Types

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

Public Member Functions

 BezierPoint (vec const p, Type const type) noexcept
 
 BezierPoint (float const x, float const y, Type const type) noexcept
 
template<typename M , std::enable_if_t< is_mat_v< M >, int > = 0>
BezierPointoperator*= (M const &rhs) noexcept
 Transform the point.
 

Static Public Member Functions

static std::vector< BezierPointnormalizePoints (std::vector< BezierPoint >::const_iterator const begin, std::vector< BezierPoint >::const_iterator const end) noexcept
 

Data Fields

Type type
 
vec p
 

Friends

bool operator== (BezierPoint const &lhs, BezierPoint const &rhs) noexcept
 
template<typename M , std::enable_if_t< is_mat_v< M >, int > = 0>
BezierPoint operator* (M const &lhs, BezierPoint 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 std::vector< BezierPoint > tt::BezierPoint::normalizePoints ( std::vector< BezierPoint >::const_iterator const begin,
std::vector< BezierPoint >::const_iterator const end )
inlinestaticnoexcept

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.

◆ operator*=()

template<typename M , std::enable_if_t< is_mat_v< M >, int > = 0>
BezierPoint & tt::BezierPoint::operator*= ( M const & rhs)
inlinenoexcept

Transform the point.

Friends And Related Symbol Documentation

◆ operator*

template<typename M , std::enable_if_t< is_mat_v< M >, int > = 0>
BezierPoint operator* ( M const & lhs,
BezierPoint const & rhs )
friend

Transform the point.


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