Class for a texture atlas.
#include <graphics/YiTextureAtlas.h>

Public Member Functions | |
| CYITextureAtlas () | |
| virtual | ~CYITextureAtlas () |
| bool | CreateNewAtlas (uint32_t unWidth, uint32_t unHeight, uint32_t unPages) |
| YI_REGION | GetRegion (int32_t nWidth, int32_t nHeight) |
| virtual void | SetRegion (ssize_t ID, void *pReference, YI_REGION Region, const uint8_t *data, const int32_t nStride) |
| virtual YI_TEXTURE_DETAILS * | GetTexture (ssize_t ID, void *pReference) |
| void | UpdateAtlas () |
| const std::shared_ptr< CYIBitmap > | GetBitmap () const |
| const std::vector< glm::ivec4 > * | GetNodes (uint32_t unPage) const |
| virtual std::shared_ptr< CYIAssetTexture > | GetGLTexture () const |
| const std::shared_ptr< CYIAssetTexture > | GetTextureAsset () |
| YI_LOADED_TEXTURES * | GetLoadedTextures () |
| void | SetTextureFilter (CYIAssetTexture::YI_MIN_MAG_FILTER minificationFilter, CYIAssetTexture::YI_MIN_MAG_FILTER magnificationFilter) |
| void | SetTextureWrap (CYIAssetTexture::YI_TEXTURE_WRAP wrapS, CYIAssetTexture::YI_TEXTURE_WRAP wrapT) |
| void | SetName (const CYIString &name) |
| const CYIString & | GetName () const |
| float | GetAtlasPercentageUsed () const |
| bool | RenderAtlasToPng (const CYIString &filePath) const |
| void | Reset () |
Protected Member Functions | |
| int32_t | Fit (uint32_t unPage, uint32_t unIndex, int32_t nWidth, int32_t nHeight) |
| void | Merge (uint32_t unPage) |
Protected Attributes | |
| 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_nWidth |
| int32_t | m_nHeight |
| uint32_t | m_unPages |
| CYIAssetTexture::YI_TEXTURE_CONFIG | m_textureConfiguration |
| uint32_t | m_unPixelsUsed |
| uint32_t | m_unLastUpdatedSize |
| CYITextureAtlas::CYITextureAtlas | ( | ) |
|
virtual |
| bool CYITextureAtlas::CreateNewAtlas | ( | uint32_t | unWidth, |
| uint32_t | unHeight, | ||
| uint32_t | unPages | ||
| ) |
|
protected |
| float CYITextureAtlas::GetAtlasPercentageUsed | ( | ) | const |
Returns the atlas usage as a percentage. The calculation is total pixels / used pixels. Note that this is the exact pixel usage of the atlas. If the packing method used isn't 100% efficient then the atlas will never reach 100% usage. This function returns a value in the range from 0.0 to 1.0.
| const std::shared_ptr<CYIBitmap> CYITextureAtlas::GetBitmap | ( | ) | const |
|
virtual |
| YI_LOADED_TEXTURES* CYITextureAtlas::GetLoadedTextures | ( | ) |
| const CYIString& CYITextureAtlas::GetName | ( | ) | const |
| const std::vector<glm::ivec4>* CYITextureAtlas::GetNodes | ( | uint32_t | unPage | ) | const |
| YI_REGION CYITextureAtlas::GetRegion | ( | int32_t | nWidth, |
| int32_t | nHeight | ||
| ) |
|
virtual |
Reimplemented in CYIAbstractTextAtlas.
|
inline |
|
protected |
| bool CYITextureAtlas::RenderAtlasToPng | ( | const CYIString & | filePath | ) | const |
Renders the current contents of the texture atlas to the given file path. Returns true if the image was successfully written.
| void CYITextureAtlas::Reset | ( | ) |
Resets all regions in the atlas and clears the contents of the underlying texture.
| void CYITextureAtlas::SetName | ( | const CYIString & | name | ) |
|
virtual |
Reimplemented in CYIAbstractTextAtlas, CYISDFTextAtlas, and CYITextAtlas.
| void CYITextureAtlas::SetTextureFilter | ( | CYIAssetTexture::YI_MIN_MAG_FILTER | minificationFilter, |
| CYIAssetTexture::YI_MIN_MAG_FILTER | magnificationFilter | ||
| ) |
| void CYITextureAtlas::SetTextureWrap | ( | CYIAssetTexture::YI_TEXTURE_WRAP | wrapS, |
| CYIAssetTexture::YI_TEXTURE_WRAP | wrapT | ||
| ) |
| void CYITextureAtlas::UpdateAtlas | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |