FastUIDraw
Public Types | Public Member Functions | List of all members
fastuidraw::GlyphRenderDataTexels Class Reference

A GlyphRenderDataTexels holds texel data for rendering a glyph. Such texel data can be for both distance field and coverage glyph rendeding. More...

#include <glyph_render_data_texels.hpp>

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

Public Types

enum  attribute_values_t { glyph_size_xy, glyph_texel_data_offset }
 

Public Member Functions

 GlyphRenderDataTexels (void)
 
virtual c_array< const c_stringrender_info_labels (void) const
 
void resize (ivec2 sz)
 
ivec2 resolution (void) const
 
c_array< const uint8_t > texel_data (void) const
 
c_array< uint8_t > texel_data (void)
 
virtual enum fastuidraw::return_code upload_to_atlas (GlyphAtlasProxy &atlas_proxy, GlyphAttribute::Array &attributes, c_array< float > render_costs) const
 

Detailed Description

A GlyphRenderDataTexels holds texel data for rendering a glyph. Such texel data can be for both distance field and coverage glyph rendeding.

Definition at line 37 of file glyph_render_data_texels.hpp.

Member Enumeration Documentation

◆ attribute_values_t

This enumeration describes the meaning of the attributes.

Enumerator
glyph_size_xy 

Dimensions of the glyph as packed by GlyphAttribute::rect_glyph_layout

glyph_texel_data_offset 

Location of the texel data within the GlyphAtlas

Definition at line 44 of file glyph_render_data_texels.hpp.

Constructor & Destructor Documentation

◆ GlyphRenderDataTexels()

fastuidraw::GlyphRenderDataTexels::GlyphRenderDataTexels ( void  )

Ctor, initialized the resolution as (0,0).

Member Function Documentation

◆ render_info_labels()

virtual c_array<const c_string> fastuidraw::GlyphRenderDataTexels::render_info_labels ( void  ) const
virtual

To be implemented by a derived class to return the strings used in GlyphRenderCostInfo::m_value; The pointer behind each of the string in the return c_array returned are required to stay valid even after the GlyphRenderData is deleted. The expectation is that the returned c_array is just c_array wrapping over a static constant array of string.

Implements fastuidraw::GlyphRenderData.

◆ resize()

void fastuidraw::GlyphRenderDataTexels::resize ( ivec2  sz)

Change the resolution

Parameters
sznew resolution

◆ resolution()

ivec2 fastuidraw::GlyphRenderDataTexels::resolution ( void  ) const

Returns the resolution of the glyph.

◆ texel_data() [1/2]

c_array<const uint8_t> fastuidraw::GlyphRenderDataTexels::texel_data ( void  ) const

Returns the texel data for rendering. The texel (x,y) is located at I where I is given by I = x + y * resolution().x(). Value is an 8-bit value.

◆ texel_data() [2/2]

c_array<uint8_t> fastuidraw::GlyphRenderDataTexels::texel_data ( void  )

Returns the coverage values for rendering. The texel (x,y) is located at I where I is given by I = x + y * resolution().x(). Value is an 8-bit value.

◆ upload_to_atlas()

virtual enum fastuidraw::return_code fastuidraw::GlyphRenderDataTexels::upload_to_atlas ( GlyphAtlasProxy atlas_proxy,
GlyphAttribute::Array attributes,
c_array< float >  render_costs 
) const
virtual

To be implemented by a derived class to upload data to a GlyphAtlas.

Parameters
atlas_proxyGlyphAtlasProxy to which to upload data
attributes(output) glyph attributes (see Glyph::attributes())
render_costs(output) an array of size render_info().size() to which to write the render costs for each entry in render_info().

Implements fastuidraw::GlyphRenderData.


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