Kodi Docs 20.0
Kodi is an open source media player and entertainment hub.
CTextureBundle Class Reference

#include <TextureBundle.h>

Public Member Functions

 CTextureBundle ()
 
 CTextureBundle (bool useXBT)
 
 ~CTextureBundle ()=default
 
void SetThemeBundle (bool themeBundle)
 
bool HasFile (const std::string &Filename)
 
std::vector< std::string > GetTexturesFromPath (const std::string &path)
 
bool LoadTexture (const std::string &filename, std::unique_ptr< CTexture > &texture, int &width, int &height)
 Load texture from bundle. More...
 
bool LoadAnim (const std::string &filename, std::vector< std::pair< std::unique_ptr< CTexture >, int > > &textures, int &width, int &height, int &nLoops)
 Load animation from bundle. More...
 
void Close ()
 

Static Public Member Functions

static std::string Normalize (std::string name)
 

Constructor & Destructor Documentation

◆ CTextureBundle() [1/2]

CTextureBundle::CTextureBundle ( )

◆ CTextureBundle() [2/2]

CTextureBundle::CTextureBundle ( bool  useXBT)
explicit

◆ ~CTextureBundle()

CTextureBundle::~CTextureBundle ( )
default

Member Function Documentation

◆ Close()

void CTextureBundle::Close ( )

◆ GetTexturesFromPath()

std::vector< std::string > CTextureBundle::GetTexturesFromPath ( const std::string &  path)

◆ HasFile()

bool CTextureBundle::HasFile ( const std::string &  Filename)

◆ LoadAnim()

bool CTextureBundle::LoadAnim ( const std::string &  filename,
std::vector< std::pair< std::unique_ptr< CTexture >, int > > &  textures,
int width,
int height,
int nLoops 
)

Load animation from bundle.

Parameters
[in]filenamename of the animation to load
[out]texturevector of frames. Each frame is pair of a texture and the duration the frame
[out]widthwidth of the loaded textures
[out]heightheight of the loaded textures
Returns
true if animation was loaded
Todo:
With c++17 this should be changed to return a std::optional that's wrapping a struct containing the output values. Same for CTextureBundleXBT::LoadAnim.

◆ LoadTexture()

bool CTextureBundle::LoadTexture ( const std::string &  filename,
std::unique_ptr< CTexture > &  texture,
int width,
int height 
)

Load texture from bundle.

Parameters
[in]filenamename of the texture to load
[out]textureholds the pointer to the texture after successful loading
[out]widthwidth of the loaded texture
[out]heightheight of the loaded texture
Returns
true if texture was loaded
Todo:
With c++17 this should be changed to return a std::optional that's wrapping a struct containing the output values. Same for CTextureBundleXBT::LoadTexture.

◆ Normalize()

std::string CTextureBundle::Normalize ( std::string  name)
static

◆ SetThemeBundle()

void CTextureBundle::SetThemeBundle ( bool  themeBundle)

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