FastUIDraw
Public Member Functions | List of all members
fastuidraw::PathContour::bezier Class Reference

Derived class of interpolator_base to indicate a Bezier curve. Supports Bezier curves of any degree. More...

#include <path.hpp>

Inheritance diagram for fastuidraw::PathContour::bezier:
Inheritance graph
[legend]

Public Member Functions

 bezier (PathContour &contour, const vec2 &ct, const vec2 &end, enum PathEnums::edge_type_t tp)
 
 bezier (PathContour &contour, const vec2 &ct1, const vec2 &ct2, const vec2 &end, enum PathEnums::edge_type_t tp)
 
 bezier (PathContour &contour, c_array< const vec2 > control_pts, const vec2 &end, enum PathEnums::edge_type_t tp)
 
virtual enum return_code add_to_builder (ShaderFilledPath::Builder *builder, float tol) const
 
virtual void approximate_bounding_box (Rect *out_bb) const
 
virtual reference_counted_ptr< interpolator_basedeep_copy (PathContour &contour) const
 
virtual bool is_flat (void) const
 
virtual unsigned int minimum_tessellation_recursion (void) const
 
c_array< const vec2pts (void) const
 
virtual void tessellate (reference_counted_ptr< tessellated_region > in_region, reference_counted_ptr< tessellated_region > *out_regionA, reference_counted_ptr< tessellated_region > *out_regionB, vec2 *out_p) const
 
- Public Member Functions inherited from fastuidraw::PathContour::interpolator_generic
 interpolator_generic (PathContour &contour, const vec2 &end, enum PathEnums::edge_type_t tp)
 
virtual reference_counted_ptr< tessellation_stateproduce_tessellation (const TessellatedPath::TessellationParams &tess_params, TessellatedPath::SegmentStorage *out_data, float *out_max_distance) const
 
- Public Member Functions inherited from fastuidraw::PathContour::interpolator_base
 interpolator_base (PathContour &contour, const vec2 &end, enum PathEnums::edge_type_t tp)
 
enum PathEnums::edge_type_t edge_type (void) const
 
const vec2end_pt (void) const
 
const vec2start_pt (void) const
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
static void add_reference (const reference_counted_base< T, Counter > *p)
 
static void remove_reference (const reference_counted_base< T, Counter > *p)
 

Detailed Description

Derived class of interpolator_base to indicate a Bezier curve. Supports Bezier curves of any degree.

Definition at line 336 of file path.hpp.

Constructor & Destructor Documentation

◆ bezier() [1/3]

fastuidraw::PathContour::bezier::bezier ( PathContour contour,
const vec2 ct,
const vec2 end,
enum PathEnums::edge_type_t  tp 
)

Ctor. One control point, thus interpolation is a quadratic curve.

Parameters
contourPathContour to which to add the interpolator. The interpolator is added to the contour at the interpolator's construction. The start point is computed from the current state of the PathContour
ctcontrol point
endend of curve
tpnature the edge represented by this interpolator_base

◆ bezier() [2/3]

fastuidraw::PathContour::bezier::bezier ( PathContour contour,
const vec2 ct1,
const vec2 ct2,
const vec2 end,
enum PathEnums::edge_type_t  tp 
)

Ctor. Two control points, thus interpolation is a cubic curve.

Parameters
contourPathContour to which to add the interpolator. The interpolator is added to the contour at the interpolator's construction. The start point is computed from the current state of the PathContour
ct11st control point
ct22nd control point
endend point of curve
tpnature the edge represented by this interpolator_base

◆ bezier() [3/3]

fastuidraw::PathContour::bezier::bezier ( PathContour contour,
c_array< const vec2 control_pts,
const vec2 end,
enum PathEnums::edge_type_t  tp 
)

Ctor. Iterator range defines the control points of the bezier curve.

Parameters
contourPathContour to which to add the interpolator. The interpolator is added to the contour at the interpolator's construction. The start point is computed from the current state of the PathContour
control_ptscontrol points of the bezier curve created, can be any size allowing bezier curves of arbitrary degree
endend point of curve
tpnature the edge represented by this interpolator_base

Member Function Documentation

◆ add_to_builder()

virtual enum return_code fastuidraw::PathContour::bezier::add_to_builder ( ShaderFilledPath::Builder builder,
float  tol 
) const
virtual

To be optionally implemented by a derived class to add this interpolator to a ShaderFilledPath::Builder. A return code of routine_fail means that the interpolator cannot be realized in such a way to be added and a Path that includes such an interpolator in a closed contour will be unable to realized a ShaderFilledPath value and Path::shader_filled_path() will return a null handle. Default implementation is to return routine_fail.

Parameters
builderobject to which to add interpolator.
tolerror goal between the interpolator and how it is realized on the ShaderFilledPath::Builder

Reimplemented from fastuidraw::PathContour::interpolator_base.

◆ approximate_bounding_box()

virtual void fastuidraw::PathContour::bezier::approximate_bounding_box ( Rect out_bb) const
virtual

To be implemented by a derived class to return a fast (and approximate) bounding box for the interpolator.

Parameters
out_bb(output) location to which to write the bounding box value

Implements fastuidraw::PathContour::interpolator_base.

◆ deep_copy()

virtual reference_counted_ptr<interpolator_base> fastuidraw::PathContour::bezier::deep_copy ( PathContour contour) const
virtual

To be implemented by a derived class to create and return a deep copy of the interpolator object.

Implements fastuidraw::PathContour::interpolator_base.

◆ is_flat()

virtual bool fastuidraw::PathContour::bezier::is_flat ( void  ) const
virtual

To be implemented by a derived class to return true if the interpolator is flat, i.e. is just a line segment connecting start_pt() to end_pt().

Implements fastuidraw::PathContour::interpolator_base.

◆ minimum_tessellation_recursion()

virtual unsigned int fastuidraw::PathContour::bezier::minimum_tessellation_recursion ( void  ) const
virtual

To be implemented by a derived class to return a reasonable lower bound on the needed number of times the edge should be cut in half in order to capture its shape.

Implements fastuidraw::PathContour::interpolator_generic.

◆ pts()

c_array<const vec2> fastuidraw::PathContour::bezier::pts ( void  ) const

Returns the control points of the Bezier curve with c_array<const vec2>::front() having the same value as start_pt() and c_array<const vec2>::back() having the same value as end_pt().

◆ tessellate()

virtual void fastuidraw::PathContour::bezier::tessellate ( reference_counted_ptr< tessellated_region in_region,
reference_counted_ptr< tessellated_region > *  out_regionA,
reference_counted_ptr< tessellated_region > *  out_regionB,
vec2 out_p 
) const
virtual

To be implemented by a derived to assist in recursive tessellation.

Parameters
in_regionregion to divide in half, a nullptr value indicates that the region is the entire interpolator.
out_regionAlocation to which to write the first half
out_regionBlocation to which to write the second half
out_plocation to which to write the position of the point on the curve in the middle (with repsect to time) of in_region

Implements fastuidraw::PathContour::interpolator_generic.


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