Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
CPiTexture Class Reference

#include <TexturePi.h>

Inheritance diagram for CPiTexture:
CGLTexture CBaseTexture

Public Member Functions

 CPiTexture (unsigned int width=0, unsigned int height=0, unsigned int format=XB_FMT_A8R8G8B8)
 
virtual ~CPiTexture ()
 
void CreateTextureObject ()
 
void LoadToGPU ()
 
void Update (unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, const unsigned char *pixels, bool loadToGPU)
 
void Allocate (unsigned int width, unsigned int height, unsigned int format)
 
bool LoadFromFileInternal (const std::string &texturePath, unsigned int maxWidth, unsigned int maxHeight, bool requirePixels, const std::string &strMimeType="")
 
- Public Member Functions inherited from CGLTexture
 CGLTexture (unsigned int width=0, unsigned int height=0, unsigned int format=XB_FMT_A8R8G8B8)
 
 ~CGLTexture () override
 
void DestroyTextureObject () override
 
void BindToUnit (unsigned int unit) override
 
- Public Member Functions inherited from CBaseTexture
 CBaseTexture (unsigned int width=0, unsigned int height=0, unsigned int format=XB_FMT_A8R8G8B8)
 
virtual ~CBaseTexture ()
 
bool LoadFromMemory (unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, bool hasAlpha, const unsigned char *pixels)
 
bool LoadPaletted (unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, const unsigned char *pixels, const COLOR *palette)
 
bool HasAlpha () const
 
void SetMipmapping ()
 
bool IsMipmapped () const
 
void SetScalingMethod (TEXTURE_SCALING scalingMethod)
 
TEXTURE_SCALING GetScalingMethod () const
 
void SetCacheMemory (bool bCacheMemory)
 
bool GetCacheMemory () const
 
unsigned char * GetPixels () const
 
unsigned int GetPitch () const
 
unsigned int GetRows () const
 
unsigned int GetTextureWidth () const
 
unsigned int GetTextureHeight () const
 
unsigned int GetWidth () const
 
unsigned int GetHeight () const
 
unsigned int GetOriginalWidth () const
 return the original width of the image, before scaling/cropping More...
 
unsigned int GetOriginalHeight () const
 return the original height of the image, before scaling/cropping More...
 
int GetOrientation () const
 
void SetOrientation (int orientation)
 
void Update (unsigned int width, unsigned int height, unsigned int pitch, unsigned int format, const unsigned char *pixels, bool loadToGPU)
 
void Allocate (unsigned int width, unsigned int height, unsigned int format)
 
void ClampToEdge ()
 

Additional Inherited Members

- Static Public Member Functions inherited from CBaseTexture
static CBaseTextureLoadFromFile (const std::string &texturePath, unsigned int idealWidth=0, unsigned int idealHeight=0, bool requirePixels=false, const std::string &strMimeType="")
 Load a texture from a file Loads a texture from a file, restricting in size if needed based on maxHeight and maxWidth. Note that these are the ideal size to load at - the returned texture may be smaller or larger than these. More...
 
static CBaseTextureLoadFromFileInMemory (unsigned char *buffer, size_t bufferSize, const std::string &mimeType, unsigned int idealWidth=0, unsigned int idealHeight=0)
 Load a texture from a file in memory Loads a texture from a file in memory, restricting in size if needed based on maxHeight and maxWidth. Note that these are the ideal size to load at - the returned texture may be smaller or larger than these. More...
 
static unsigned int PadPow2 (unsigned int x)
 
static bool SwapBlueRed (unsigned char *pixels, unsigned int height, unsigned int pitch, unsigned int elements=4, unsigned int offset=0)
 
- Protected Member Functions inherited from CBaseTexture
bool LoadFromFileInMem (unsigned char *buffer, size_t size, const std::string &mimeType, unsigned int maxWidth, unsigned int maxHeight)
 
bool LoadFromFileInternal (const std::string &texturePath, unsigned int maxWidth, unsigned int maxHeight, bool requirePixels, const std::string &strMimeType="")
 
bool LoadIImage (IImage *pImage, unsigned char *buffer, unsigned int bufSize, unsigned int width, unsigned int height)
 
unsigned int GetPitch (unsigned int width) const
 
unsigned int GetRows (unsigned int height) const
 
unsigned int GetBlockSize () const
 
- Protected Attributes inherited from CGLTexture
GLuint m_texture = 0
 
bool m_isOglVersion3orNewer = false
 
- Protected Attributes inherited from CBaseTexture
unsigned int m_imageWidth
 
unsigned int m_imageHeight
 
unsigned int m_textureWidth
 
unsigned int m_textureHeight
 
unsigned int m_originalWidth
 original image width before scaling or cropping More...
 
unsigned int m_originalHeight
 original image height before scaling or cropping More...
 
unsigned char * m_pixels
 
bool m_loadedToGPU
 
unsigned int m_format
 
int m_orientation
 
bool m_hasAlpha = true
 
bool m_mipmapping = false
 
TEXTURE_SCALING m_scalingMethod = TEXTURE_SCALING::LINEAR
 
bool m_bCacheMemory = false
 

Constructor & Destructor Documentation

◆ CPiTexture()

CPiTexture::CPiTexture ( unsigned int  width = 0,
unsigned int  height = 0,
unsigned int  format = XB_FMT_A8R8G8B8 
)

◆ ~CPiTexture()

CPiTexture::~CPiTexture ( )
virtual

Member Function Documentation

◆ Allocate()

void CPiTexture::Allocate ( unsigned int  width,
unsigned int  height,
unsigned int  format 
)

◆ CreateTextureObject()

void CPiTexture::CreateTextureObject ( )
virtual

Reimplemented from CGLTexture.

◆ LoadFromFileInternal()

bool CPiTexture::LoadFromFileInternal ( const std::string &  texturePath,
unsigned int  maxWidth,
unsigned int  maxHeight,
bool  requirePixels,
const std::string &  strMimeType = "" 
)

◆ LoadToGPU()

void CPiTexture::LoadToGPU ( )
virtual

Reimplemented from CGLTexture.

◆ Update()

void CPiTexture::Update ( unsigned int  width,
unsigned int  height,
unsigned int  pitch,
unsigned int  format,
const unsigned char *  pixels,
bool  loadToGPU 
)

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