Class for a text atlas.
#include <graphics/YiTextAtlas.h>
Public Member Functions | |
CYITextAtlas (CYIAssetTextureBase::Filtering textureFiltering=CYIAssetTextureBase::Filtering::Nearest) | |
virtual | ~CYITextAtlas () |
virtual bool | CreateNewFontAtlas (uint32_t width, uint32_t height) override |
virtual void | SetRegion (ssize_t id, void *pReference, YI_REGION region, GlyphData glyphData) override |
![]() | |
CYIAbstractTextAtlas () | |
virtual | ~CYIAbstractTextAtlas () |
virtual void | SetRegion (ssize_t id, void *pReference, YI_REGION region, const uint8_t *pData, const int32_t stride) override final |
virtual YI_TEXTURE_DETAILS * | GetTexture (ssize_t id, void *pReference) override |
int32_t | GetGlyphPadding () const |
bool | AddGlyph (const uint32_t glyphWidth, const uint32_t glyphHeight, YI_GLYPH_DETAILS *pGlyphDetails, GlyphData glyphData) |
![]() | |
CYITextureAtlas () | |
virtual | ~CYITextureAtlas () |
bool | CreateNewAtlas (uint32_t unWidth, uint32_t unHeight, size_t pages) |
YI_REGION | GetRegion (int32_t width, int32_t height) |
void | UpdateAtlas () |
const std::shared_ptr< CYIBitmap > | GetBitmap () const |
const std::vector< glm::ivec4 > * | GetNodes (size_t page) const |
virtual std::shared_ptr< CYIAssetTexture > | GetGLTexture () const |
const std::shared_ptr< CYIAssetTexture > | GetTextureAsset () |
YI_LOADED_TEXTURES * | GetLoadedTextures () |
void | SetTextureFilter (CYIAssetTexture::Filtering minificationFilter, CYIAssetTexture::Filtering magnificationFilter) |
void | SetTextureWrap (CYIAssetTexture::WrapMode wrapS, CYIAssetTexture::WrapMode wrapT) |
void | SetName (const CYIString &name) |
const CYIString & | GetName () const |
float | GetAtlasPercentageUsed () const |
bool | RenderAtlasToPng (const CYIString &filePath) const |
void | Reset () |
Additional Inherited Members | |
![]() | |
void | SetGlyphPadding (int32_t glyphPadding) |
virtual bool | CompareGlyphDetails (YI_GLYPH_DETAILS *pLeft, YI_GLYPH_DETAILS *pRight) const |
![]() | |
int32_t | Fit (size_t page, size_t unIndex, int32_t width, int32_t height) |
void | Merge (size_t page) |
![]() | |
CYIString | m_name |
std::shared_ptr< CYIBitmap > | m_Image |
std::vector< glm::ivec4 > | m_Nodes [4] |
std::shared_ptr< CYIAssetTexture > | m_pTextureAsset |
YI_LOADED_TEXTURES | m_Textures |
int32_t | m_width |
int32_t | m_height |
size_t | m_pages |
CYIAssetTexture::TextureConfig | m_textureConfiguration |
size_t | m_unPixelsUsed |
size_t | m_unLastUpdatedSize |
CYITextAtlas::CYITextAtlas | ( | CYIAssetTextureBase::Filtering | textureFiltering = CYIAssetTextureBase::Filtering::Nearest | ) |
|
virtual |
|
overridevirtual |
Should be implemented to do any internal initialization of the text atlas such as creating the atlas buffer. The width and height of the buffer are given as parameters.
Implements CYIAbstractTextAtlas.
|
overridevirtual |
Should be implemented to write the given data to the atlas buffer and store a reference to it as a YI_TEXTURE_DETAILS.
[in] | id | A user provided ID. The implementation can use this for whatever it wants |
[in] | pReference | A user provided pointer. The implementation can use this for whatever it wants |
[in] | region | The region in the atlas to write the data to |
[in] | glyphData | The glyph data to write into the atlas |
Implements CYIAbstractTextAtlas.