FastUIDraw
glyph_render_data_texels.hpp
Go to the documentation of this file.
1 /*!
2  * \file glyph_render_data_texels.hpp
3  * \brief file glyph_render_data_texels.hpp
4  *
5  * Copyright 2016 by Intel.
6  *
7  * Contact: kevin.rogovin@gmail.com
8  *
9  * This Source Code Form is subject to the
10  * terms of the Mozilla Public License, v. 2.0.
11  * If a copy of the MPL was not distributed with
12  * this file, You can obtain one at
13  * http://mozilla.org/MPL/2.0/.
14  *
15  * \author Kevin Rogovin <kevin.rogovin@gmail.com>
16  *
17  */
18 
19 
20 #ifndef FASTUIDRAW_GLYPH_RENDER_DATA_TEXELS_HPP
21 #define FASTUIDRAW_GLYPH_RENDER_DATA_TEXELS_HPP
22 
24 
25 namespace fastuidraw
26 {
27 /*!\addtogroup Glyph
28  * @{
29  */
30 
31  /*!
32  * \brief
33  * A GlyphRenderDataTexels holds texel data for
34  * rendering a glyph. Such texel data can be for
35  * both distance field and coverage glyph rendeding.
36  */
38  {
39  public:
40  /*!
41  * This enumeration describes the meaning of the
42  * attributes.
43  */
45  {
46  /*!
47  * Dimensions of the glyph as packed by
48  * \ref GlyphAttribute::rect_glyph_layout
49  */
51 
52  /*!
53  * Location of the texel data within the
54  * \ref GlyphAtlas
55  */
57  };
58 
59  /*!
60  * Ctor, initialized the resolution as (0,0).
61  */
63 
65 
66  /*!
67  * Returns the resolution of the glyph.
68  */
69  ivec2
70  resolution(void) const;
71 
72  /*!
73  * Returns the texel data for rendering.
74  * The texel (x,y) is located at I where I is
75  * given by I = x + y * resolution().x(). Value
76  * is an 8-bit value.
77  */
79  texel_data(void) const;
80 
81  /*!
82  * Returns the coverage values for rendering.
83  * The texel (x,y) is located at I where I is
84  * given by I = x + y * resolution().x(). Value
85  * is an 8-bit value.
86  */
88  texel_data(void);
89 
90  /*!
91  * Change the resolution
92  * \param sz new resolution
93  */
94  void
95  resize(ivec2 sz);
96 
97  virtual
99  render_info_labels(void) const;
100 
101  virtual
103  upload_to_atlas(GlyphAtlasProxy &atlas_proxy,
104  GlyphAttribute::Array &attributes,
105  c_array<float> render_costs) const;
106 
107  private:
108  void *m_d;
109  };
110 /*! @} */
111 }
112 
113 #endif
Represents an opaque array of GlyphAttribute values.
GlyphRenderData provides an interface to specify data used for rendering glyphs and to pack that data...
c_array< const uint8_t > texel_data(void) const
file glyph_render_data.hpp
all classes and functions of FastUIDraw are in the namespace fastuidraw.
Definition: colorstop.hpp:28
virtual enum fastuidraw::return_code upload_to_atlas(GlyphAtlasProxy &atlas_proxy, GlyphAttribute::Array &attributes, c_array< float > render_costs) const
return_code
Enumeration for simple return codes for functions for success or failure.
Definition: util.hpp:142
An GlyphAtlasProxy is a proxy for a GlyphAtlas; one can allocate through it. Internally it tracks all...
virtual c_array< const c_string > render_info_labels(void) const
A GlyphRenderDataTexels holds texel data for rendering a glyph. Such texel data can be for both dista...