FastUIDraw
Public Member Functions | Static Public Member Functions | List of all members
fastuidraw::GlyphAttributePacker Class Referenceabstract

A GlyphAttributePacker provides an interface to customize how glyph attribute and index data is realized by a GlyphRun and GlyphSequence. More...

#include <glyph_attribute_packer.hpp>

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

Public Member Functions

virtual void compute_needed_room (GlyphRenderer glyph_renderer, c_array< const GlyphAttribute > glyph_attributes, unsigned int *out_num_indices, unsigned int *out_num_attributes) const =0
 
virtual void glyph_position (Glyph glyph, const vec2 position, float scale_factor, vec2 *p_bl, vec2 *p_tr) const =0
 
virtual void glyph_position_from_metrics (GlyphMetrics metrics, const vec2 position, float scale_factor, vec2 *p_bl, vec2 *p_tr) const =0
 
virtual void realize_attribute_data (GlyphRenderer glyph_renderer, c_array< const GlyphAttribute > glyph_attributes, c_array< PainterIndex > dst_indices, c_array< PainterAttribute > dst_attribs, const vec2 p_bl, const vec2 p_tr) const =0
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Static Public Member Functions

static const GlyphAttributePackerstandard_packer (enum PainterEnums::screen_orientation orientation, enum PainterEnums::glyph_layout_type layout)
 
- 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 GlyphAttributePacker provides an interface to customize how glyph attribute and index data is realized by a GlyphRun and GlyphSequence.

Definition at line 36 of file glyph_attribute_packer.hpp.

Member Function Documentation

◆ compute_needed_room()

virtual void fastuidraw::GlyphAttributePacker::compute_needed_room ( GlyphRenderer  glyph_renderer,
c_array< const GlyphAttribute glyph_attributes,
unsigned int *  out_num_indices,
unsigned int *  out_num_attributes 
) const
pure virtual

To be implemented by a derived class to return how many indices and attributes are needed to realize a single glyph.

Parameters
glyph_rendererGlyph::renderer() of Glyph to realize
glyph_attributesGlyph::attributes() of Glyph to realize
[out]out_num_indicesnumber of indices needed to realize the glyph
[out]out_num_attributesnumber of attributes needed to realize the glyph

◆ glyph_position()

virtual void fastuidraw::GlyphAttributePacker::glyph_position ( Glyph  glyph,
const vec2  position,
float  scale_factor,
vec2 p_bl,
vec2 p_tr 
) const
pure virtual

To be implemented by a derived class to return the positions of the bottom-left and top-right coordinates of a glyph at the named position.

Parameters
glyphGlyph to realize
positionposition of bottom left of glyph
scale_factorthe amount by which to scale from the Glyph object's coordinates
[out]p_bllocation to which to write the bottom-left coordinate of the glyph
[out]p_trlocation to which to write the top-right coordinate of the glyph

◆ glyph_position_from_metrics()

virtual void fastuidraw::GlyphAttributePacker::glyph_position_from_metrics ( GlyphMetrics  metrics,
const vec2  position,
float  scale_factor,
vec2 p_bl,
vec2 p_tr 
) const
pure virtual

To be implemented by a derived class to return the positions of the bottom-left and top-right coordinates of a glyph at the named position using only the information from GlyphMetrics.

Parameters
metricsGlyphMertics to use to compute the bounding box
positionposition of bottom left of glyph
scale_factorthe amount by which to scale from the Glyph object's coordinates
[out]p_bllocation to which to write the bottom-left coordinate of the glyph
[out]p_trlocation to which to write the top-right coordinate of the glyph

◆ realize_attribute_data()

virtual void fastuidraw::GlyphAttributePacker::realize_attribute_data ( GlyphRenderer  glyph_renderer,
c_array< const GlyphAttribute glyph_attributes,
c_array< PainterIndex dst_indices,
c_array< PainterAttribute dst_attribs,
const vec2  p_bl,
const vec2  p_tr 
) const
pure virtual

To be implemented by a derived class to provide the attributes and indices to realize a glyph.

Parameters
glyph_rendererGlyph::renderer() of Glyph to realize
glyph_attributesGlyph::attributes() of Glyph to realize
dst_indiceslocation to which to write the indices; the values are offsets into dst_attribs
dst_attribslocation to which to write the attributes
p_blposition of bottom left of glyph as emited by glyph_position()
p_trposition of top right of glyph as emited by glyph_position()

◆ standard_packer()

static const GlyphAttributePacker& fastuidraw::GlyphAttributePacker::standard_packer ( enum PainterEnums::screen_orientation  orientation,
enum PainterEnums::glyph_layout_type  layout 
)
static

Returns a GlyphAttributePacker suitable for the specified PainterEnums::screen_orientation and PainterEnums::glyph_layout_type that packs each single Glyph object as exactly 4 attributes and 6 indices as follows:


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