FastUIDraw
|
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>
Public Types | |
enum | attribute_values_t { glyph_size_xy, glyph_texel_data_offset } |
Public Member Functions | |
GlyphRenderDataTexels (void) | |
virtual c_array< const c_string > | render_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 |
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.
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.
fastuidraw::GlyphRenderDataTexels::GlyphRenderDataTexels | ( | void | ) |
Ctor, initialized the resolution as (0,0).
|
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.
void fastuidraw::GlyphRenderDataTexels::resize | ( | ivec2 | sz | ) |
Change the resolution
sz | new resolution |
ivec2 fastuidraw::GlyphRenderDataTexels::resolution | ( | void | ) | const |
Returns the resolution of the glyph.
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.
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.
|
virtual |
To be implemented by a derived class to upload data to a GlyphAtlas.
atlas_proxy | GlyphAtlasProxy 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.