FastUIDraw
Classes | Public Member Functions | Friends | List of all members
fastuidraw::StrokedPath Class Reference

A StrokedPath represents the data needed to draw a path stroked. It contains -all- the data needed to stroke a path regardless of stroking style. In particular, for a given TessellatedPath, one only needs to construct a StrokedPath once regardless of how one strokes the original path for drawing. More...

#include <stroked_path.hpp>

Inheritance diagram for fastuidraw::StrokedPath:
Inheritance graph
[legend]

Classes

class  Subset
 A Subset represents a handle to a portion of a StrokedPath. The handle is invalid once the StrokedPath from which it comes goes out of scope. Do not save these handle values without also saving a handle of the StrokedPath from which they come. The region of a Subset is the exact same region as a PartitionedTessellatedPath::Subset object. Also, the ID() value for a Subset is the same value as PartitionedTessellatedPath::Subset::ID() as well. More...
 
class  SubsetSelection
 

Public Member Functions

const PainterAttributeDataadjustable_caps (void) const
 
const PainterAttributeDataarc_rounded_caps (void) const
 
const PainterAttributeDataarc_rounded_joins (void) const
 
const PainterAttributeDatabevel_joins (void) const
 
const PainterAttributeDataflat_caps (void) const
 
bool has_arcs (void) const
 
const PainterAttributeDatamiter_bevel_joins (void) const
 
const PainterAttributeDatamiter_clip_joins (void) const
 
const PainterAttributeDatamiter_joins (void) const
 
unsigned int number_subsets (void) const
 
const PartitionedTessellatedPathpartitioned_path (void) const
 
Subset root_subset (void) const
 
const PainterAttributeDatarounded_caps (float thresh) const
 
const PainterAttributeDatarounded_joins (float thresh) const
 
void select_subsets (c_array< const vec3 > clip_equations, const float3x3 &clip_matrix_local, const vec2 &one_pixel_width, c_array< const float > geometry_inflation, unsigned int max_attribute_cnt, unsigned int max_index_cnt, bool select_miter_joins, SubsetSelection &dst) const
 
void select_subsets_no_culling (unsigned int max_attribute_cnt, unsigned int max_index_cnt, SubsetSelection &dst) const
 
const PainterAttributeDatasquare_caps (void) const
 
Subset subset (unsigned int I) const
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Friends

class TessellatedPath
 

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

A StrokedPath represents the data needed to draw a path stroked. It contains -all- the data needed to stroke a path regardless of stroking style. In particular, for a given TessellatedPath, one only needs to construct a StrokedPath once regardless of how one strokes the original path for drawing.

Definition at line 46 of file stroked_path.hpp.

Member Function Documentation

◆ adjustable_caps()

const PainterAttributeData& fastuidraw::StrokedPath::adjustable_caps ( void  ) const

Returns the data to draw the caps of a stroked path used when stroking with a dash pattern. The attribute data is packed StrokedPoint data.

◆ arc_rounded_caps()

const PainterAttributeData& fastuidraw::StrokedPath::arc_rounded_caps ( void  ) const

Returns the data to draw rounded caps of a stroked path using the fragment shader to provide per-pixel coverage computation. The attribute data is packed ArcStrokedPoint data.

◆ arc_rounded_joins()

const PainterAttributeData& fastuidraw::StrokedPath::arc_rounded_joins ( void  ) const

Returns the data to draw rounded joins of a stroked path using the fragment shader to provide per-pixel coverage computation. The attribute data is packed ArcStrokedPoint data.

◆ bevel_joins()

const PainterAttributeData& fastuidraw::StrokedPath::bevel_joins ( void  ) const

Returns the data to draw the bevel joins of a stroked path. The attribute data is packed StrokedPoint data.

◆ flat_caps()

const PainterAttributeData& fastuidraw::StrokedPath::flat_caps ( void  ) const

Returns the data to draw the flat caps of a stroked path. The attribute data is packed StrokedPoint data.

◆ has_arcs()

bool fastuidraw::StrokedPath::has_arcs ( void  ) const

Returns true if the StrokedPath has arc. If the stroked path has arcs, ALL of the attribute data is packed ArcStrokedPoint data, if it has no arcs then ALL of the data is packed StrokedPoint data.

◆ miter_bevel_joins()

const PainterAttributeData& fastuidraw::StrokedPath::miter_bevel_joins ( void  ) const

Returns the data to draw the miter joins of a stroked path, if the miter-limit is exceeded on stroking, the miter-join is to be drawn as a bevel join. The attribute data is packed StrokedPoint data.

◆ miter_clip_joins()

const PainterAttributeData& fastuidraw::StrokedPath::miter_clip_joins ( void  ) const

Returns the data to draw the miter joins of a stroked path, if the miter-limit is exceeded on stroking, the miter-join is clipped to the miter-limit. The attribute data is packed StrokedPoint data.

◆ miter_joins()

const PainterAttributeData& fastuidraw::StrokedPath::miter_joins ( void  ) const

Returns the data to draw the miter joins of a stroked path, if the miter-limit is exceeded on stroking, the miter-join end point is clamped to the miter-distance. The attribute data is packed StrokedPoint data.

◆ number_subsets()

unsigned int fastuidraw::StrokedPath::number_subsets ( void  ) const

Returns the number of Subset objects of the StrokedPath.

◆ partitioned_path()

const PartitionedTessellatedPath& fastuidraw::StrokedPath::partitioned_path ( void  ) const

Returns the source PartitionedTessellatedPath of this StrokedPath.

◆ root_subset()

Subset fastuidraw::StrokedPath::root_subset ( void  ) const

Returns the root-subset of the StrokedPath, this is the Subset that includes the entire StrokedPath.

◆ rounded_caps()

const PainterAttributeData& fastuidraw::StrokedPath::rounded_caps ( float  thresh) const

Returns the data to draw rounded caps of a stroked path. The attribute data is packed StrokedPoint data.

Parameters
threshwill return rounded caps so that the distance between the approximation of the round and the actual round is no more than thresh when the path is stroked with a stroking radius of one.

◆ rounded_joins()

const PainterAttributeData& fastuidraw::StrokedPath::rounded_joins ( float  thresh) const

Returns the data to draw rounded joins of a stroked path. The attribute data is packed StrokedPoint data.

Parameters
threshwill return rounded joins so that the distance between the approximation of the round and the actual round is no more than thresh when the path is stroked with a stroking radius of one.

◆ select_subsets()

void fastuidraw::StrokedPath::select_subsets ( c_array< const vec3 clip_equations,
const float3x3 clip_matrix_local,
const vec2 one_pixel_width,
c_array< const float >  geometry_inflation,
unsigned int  max_attribute_cnt,
unsigned int  max_index_cnt,
bool  select_miter_joins,
SubsetSelection dst 
) const

Given a set of clip equations in clip coordinates and a tranformation from local coordiante to clip coordinates, compute what Subset are not completely culled by the clip equations.

Parameters
clip_equationsarray of clip equations
clip_matrix_local3x3 transformation from local (x, y, 1) coordinates to clip coordinates.
one_pixel_widthholds the size of a single pixel in normalized device coordinates
geometry_inflationamount path geometry is inflated, array is indexed by the enumeration PathEnums::path_geometry_inflation_index_t
max_attribute_cntonly allow those chunks for which have no more than max_attribute_cnt attributes
max_index_cntonly allow those chunks for which have no more than max_index_cnt indices
select_miter_joinsif true, when selecting what joins are in the area, enlarge the join footprint for if the joins are stroked as a type of miter join.
[out]dstlocation to which to write the subset-selection.

◆ select_subsets_no_culling()

void fastuidraw::StrokedPath::select_subsets_no_culling ( unsigned int  max_attribute_cnt,
unsigned int  max_index_cnt,
SubsetSelection dst 
) const

In contrast to select_subsets() which performs hierarchical culling against a set of clip equations, this routine performs no culling and returns the subsets needed to draw all of the StrokedPath.

Parameters
max_attribute_cntonly allow those chunks for which have no more than max_attribute_cnt attributes
max_index_cntonly allow those chunks for which have no more than max_index_cnt indices
[out]dstlocation to which to write the Subset ID values

◆ square_caps()

const PainterAttributeData& fastuidraw::StrokedPath::square_caps ( void  ) const

Returns the data to draw the square caps of a stroked path. The attribute data is packed StrokedPoint data.

◆ subset()

Subset fastuidraw::StrokedPath::subset ( unsigned int  I) const

Return the named Subset object of the StrokedPath.


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