FastUIDraw
Classes | Enumerations | Functions
fastuidraw::StrokedPointPacking Namespace Reference

Namespace to encompass packing values and functions of path data for stroking using StrokedPoint. More...

Classes

class  packing_size
 Template class taking as argument a PainterEnums::join_style or cap_type_t which defines two enumerations: More...
 

Enumerations

enum  cap_type_t { flat_cap, square_cap, adjustable_cap, rounded_cap }
 

Functions

enum cap_type_t cap_type (enum PainterEnums::cap_style cp, bool for_dashed_stroking)
 
void pack_cap (enum cap_type_t cp, const TessellatedPath::cap &cap, unsigned int depth, c_array< PainterAttribute > dst_attribs, c_array< PainterIndex > dst_indices, unsigned int index_adjust)
 
void pack_join (enum PainterEnums::join_style js, const TessellatedPath::join &join, unsigned int depth, c_array< PainterAttribute > dst_attribs, c_array< PainterIndex > dst_indices, unsigned int index_adjust)
 
void pack_rounded_cap_size (float thresh, unsigned int *num_attributes, unsigned int *num_indices)
 
void pack_rounded_join_size (const TessellatedPath::join &join, float thresh, unsigned int *num_attributes, unsigned int *num_indices)
 
void pack_segment_chain (c_array< const TessellatedPath::segment_chain > chains, unsigned int depth_start, c_array< PainterAttribute > dst_attribs, c_array< PainterIndex > dst_indices, unsigned int index_adjust)
 
void pack_segment_chain (const TessellatedPath::segment_chain &chain, unsigned int depth_start, c_array< PainterAttribute > dst_attribs, c_array< PainterIndex > dst_indices, unsigned int index_adjust)
 
void pack_segment_chain_size (c_array< const TessellatedPath::segment_chain > chains, unsigned int *depth_range_size, unsigned int *num_attributes, unsigned int *num_indices)
 
void pack_segment_chain_size (const TessellatedPath::segment_chain &chain, unsigned int *depth_range_size, unsigned int *num_attributes, unsigned int *num_indices)
 

Detailed Description

Namespace to encompass packing values and functions of path data for stroking using StrokedPoint.

Enumeration Type Documentation

◆ cap_type_t

Enumeration to specify how to pack attribute and index data for a cap.

Enumerator
flat_cap 

Pack cap for stroking cap with the style PainterEnums::flat_caps with non-dashed stroking.

square_cap 

Pack cap for stroking cap with the style PainterEnums::square_caps with non-dashed stroking.

adjustable_cap 

Pack cap for stroking cap with dashed stroking (regardless of PainterEnums::cap_style).

rounded_cap 

Pack cap for stroking cap with the style PainterEnums::rounded_caps with non-dashed stroking.

Definition at line 597 of file stroked_point.hpp.

Function Documentation

◆ cap_type()

enum cap_type_t fastuidraw::StrokedPointPacking::cap_type ( enum PainterEnums::cap_style  cp,
bool  for_dashed_stroking 
)

Returns the value for cap_type_t given a PainterEnums::cap_style value

Parameters
cpPainterEnums::cap_style value
for_dashed_strokingif true, return a cap-value suitable for dashed stroking.

◆ pack_cap()

void fastuidraw::StrokedPointPacking::pack_cap ( enum cap_type_t  cp,
const TessellatedPath::cap cap,
unsigned int  depth,
c_array< PainterAttribute dst_attribs,
c_array< PainterIndex dst_indices,
unsigned int  index_adjust 
)

Pack a cap into attribute data and index data realized with StrokedPoint.

Parameters
cpjoin style to pack for
capcap data to pack
depththe value for StrokedPoint::depth() of the packed StrokedPoint values
dst_attribslocation to which to place the attributes, when cp is rounded_cap, the size of dst_attribs must be as indicated by pack_rounded_cap_size().
dst_indiceslocation to which to place the indices, when cp is rounded_cap, the size of dst_indices must be as indicated by pack_rounded_cap_size().
index_adjustvalue by which to increment the written index values

◆ pack_join()

void fastuidraw::StrokedPointPacking::pack_join ( enum PainterEnums::join_style  js,
const TessellatedPath::join join,
unsigned int  depth,
c_array< PainterAttribute dst_attribs,
c_array< PainterIndex dst_indices,
unsigned int  index_adjust 
)

Pack a join into attribute data and index data realized with StrokedPoint.

Parameters
jsjoin style to pack for
joinjoin data to pack
depththe value for StrokedPoint::depth() of the packed StrokedPoint values
dst_attribslocation to which to place the attributes, when js is PainterEnums::rounded_joins, the size of dst_attribs must be as indicated by pack_rounded_join_size().
dst_indiceslocation to which to place the indices, when js is PainterEnums::rounded_joins, the size of dst_indices must be as indicated by pack_rounded_join_size().
index_adjustvalue by which to increment the written index values

◆ pack_rounded_cap_size()

void fastuidraw::StrokedPointPacking::pack_rounded_cap_size ( float  thresh,
unsigned int *  num_attributes,
unsigned int *  num_indices 
)

Returns the number of attributes realized with StrokedPoint needed to pack a rounded cap.

Parameters
threshthe maximum distance allowed from the approximation of the rounded cap realized as triangles when the cap is stroked with a stroking width of one.
num_attributeslocation to which to write the needed number of attributes
num_indiceslocation to which to write the needed number of indices

◆ pack_rounded_join_size()

void fastuidraw::StrokedPointPacking::pack_rounded_join_size ( const TessellatedPath::join join,
float  thresh,
unsigned int *  num_attributes,
unsigned int *  num_indices 
)

Returns the number of attributes realized with StrokedPoint needed to pack a rounded join.

Parameters
joinjoin to realize a packed data
threshthe maximum distance allowed from the approximation of the rounded join realized as triangles when the join is stroked with a stroking width of one.
num_attributeslocation to which to write the needed number of attributes
num_indiceslocation to which to write the needed number of indices

◆ pack_segment_chain() [1/2]

void fastuidraw::StrokedPointPacking::pack_segment_chain ( c_array< const TessellatedPath::segment_chain chains,
unsigned int  depth_start,
c_array< PainterAttribute dst_attribs,
c_array< PainterIndex dst_indices,
unsigned int  index_adjust 
)

Pack an array of segments chains realized as StrokedPoint

Parameters
chainssegment chain to pack
depth_startvalue the lowest depth value for the attributes; the packed StrokedPoint values will have depth_start <= StrokedPoint::depth() and StrokedPoint::depth() < depth_start + depth_range_size where depth_range_size is as indicated by pack_segment_chain_size().
dst_attribslocation to which to place the attributes, the size of dst_attribs must be as indicated by pack_segment_chain_size().
dst_indiceslocation to which to place the indices, the size of dst_indices must be as indicated by pack_segment_chain_size().
index_adjustvalue by which to increment the written index values

◆ pack_segment_chain() [2/2]

void fastuidraw::StrokedPointPacking::pack_segment_chain ( const TessellatedPath::segment_chain chain,
unsigned int  depth_start,
c_array< PainterAttribute dst_attribs,
c_array< PainterIndex dst_indices,
unsigned int  index_adjust 
)

Pack a single segment chain realized as StrokedPoint

Parameters
chainsegment chain to pack
depth_startvalue the lowest depth value for the attributes; the packed StrokedPoint values will have depth_start <= StrokedPoint::depth() and StrokedPoint::depth() < depth_start + depth_range_size where depth_range_size is as indicated by pack_segment_chain_size().
dst_attribslocation to which to place the attributes, the size of dst_attribs must be as indicated by pack_segment_chain_size().
dst_indiceslocation to which to place the indices, the size of dst_indices must be as indicated by pack_segment_chain_size().
index_adjustvalue by which to increment the written index values

◆ pack_segment_chain_size() [1/2]

void fastuidraw::StrokedPointPacking::pack_segment_chain_size ( c_array< const TessellatedPath::segment_chain chains,
unsigned int *  depth_range_size,
unsigned int *  num_attributes,
unsigned int *  num_indices 
)

Computes the number of indices and attributes necessary to pack an array of TessellatedPath::segment_chain values. Each TessellatedPath::segment of each TessellatedPath::segment_chain must have that TessellatedPath::segment::m_type is the value TessellatedPath::line_segment.

Parameters
chainssegment chain to query amount room needed to pack realized by StrokedPoint
depth_range_sizelocation to which to write the depth range needed to pack the segment chain.
num_attributeslocation to which to write the needed number of attributes
num_indiceslocation to which to write the needed number of indices

◆ pack_segment_chain_size() [2/2]

void fastuidraw::StrokedPointPacking::pack_segment_chain_size ( const TessellatedPath::segment_chain chain,
unsigned int *  depth_range_size,
unsigned int *  num_attributes,
unsigned int *  num_indices 
)

Computes the number of indices and attributes necessary to pack a single TessellatedPath::segment_chain value. The TessellatedPath::segment of the TessellatedPath::segment_chain must have that TessellatedPath::segment::m_type is the value TessellatedPath::line_segment.

Parameters
chainsegment chain to query amount room needed to pack realized by StrokedPoint
depth_range_sizelocation to which to write the depth range needed to pack the segment chain.
num_attributeslocation to which to write the needed number of attributes
num_indiceslocation to which to write the needed number of indices