Kanzi 4.0.0-beta2
kanzi::FontFile::GlyphData Class Reference

GlyphData contains the metrics for an individual rendered glyph and its bitmap. More...

#include <kanzi/core.ui/font/font_file.hpp>

Inheritance diagram for kanzi::FontFile::GlyphData:
[legend]

Public Types

enum class  DataFormat { ALPHA8 , B8G8R8A8 , R8G8B8A8_VerticallyFlipped }
 Specifies the data format of the glyph. More...
 

Public Member Functions

const byte * getBitmapData () const
 Returns the pointer to bitmap data.
 
GraphicsFormat getColorFormat () const
 Returns the color format of the glyph bitmap data.
 
DataFormat getDataFormat () const
 Returns the data format of the glyph bitmap.
 
size_t getHeight () const
 Returns the height of a bitmap.
 
size_t getWidth () const
 Returns the width of a bitmap.
 
 GlyphData (size_t width, size_t height, const byte *bitmap)
 Constructor.
 
 GlyphData (size_t width, size_t height, const byte *bitmap, DataFormat dataFormat)
 Constructor.
 
virtual ~GlyphData ()
 Destructor.
 

Detailed Description

GlyphData contains the metrics for an individual rendered glyph and its bitmap.

On destruction the derived GlyphData classes release the data resources held by their rasterizer.

Member Enumeration Documentation

◆ DataFormat

Specifies the data format of the glyph.

Since
Kanzi 4.0.0
Enumerator
ALPHA8 

Glyph data encoded with GraphicsFormatALPHA8_UNORM.

B8G8R8A8 

Glyph data encoded with GraphicsFormatB8G8R8A8_UNORM.

R8G8B8A8_VerticallyFlipped 

Glyph data encoded with GraphicsFormatR8G8B8A8_UNORM and vertically flipped.

Constructor & Destructor Documentation

◆ GlyphData() [1/2]

kanzi::FontFile::GlyphData::GlyphData ( size_t width,
size_t height,
const byte * bitmap )
explicit

Constructor.

Parameters
widthWidth of the bitmap.
heightHeight of the bitmap.
bitmapPointer to the bitmap data.
Since
Kanzi 4.0.0 changed the type of the width and height parameters to size_t.

◆ GlyphData() [2/2]

kanzi::FontFile::GlyphData::GlyphData ( size_t width,
size_t height,
const byte * bitmap,
DataFormat dataFormat )
explicit

Constructor.

Parameters
widthWidth of the bitmap.
heightHeight of the bitmap.
bitmapPointer to the bitmap data.
dataFormatData format of the glyph bitmap.
Since
Kanzi 4.0.0

◆ ~GlyphData()

virtual kanzi::FontFile::GlyphData::~GlyphData ( )
virtual

Destructor.

Member Function Documentation

◆ getWidth()

size_t kanzi::FontFile::GlyphData::getWidth ( ) const

Returns the width of a bitmap.

Returns
Width of the bitmap.

◆ getHeight()

size_t kanzi::FontFile::GlyphData::getHeight ( ) const

Returns the height of a bitmap.

Returns
Height of the bitmap.

◆ getBitmapData()

const byte * kanzi::FontFile::GlyphData::getBitmapData ( ) const

Returns the pointer to bitmap data.

Returns
Pointer to the bitmap data.

◆ getDataFormat()

DataFormat kanzi::FontFile::GlyphData::getDataFormat ( ) const

Returns the data format of the glyph bitmap.

Returns
Data format of the glyph bitmap.
Since
Kanzi 4.0.0

◆ getColorFormat()

GraphicsFormat kanzi::FontFile::GlyphData::getColorFormat ( ) const

Returns the color format of the glyph bitmap data.

Returns
Color format of the glyph bitmap data.
Since
Kanzi 4.0.0

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