Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CGUITexture Class Referenceabstract

#include <GUITexture.h>

Inheritance diagram for CGUITexture:
CGUITextureD3D CGUITextureGL CGUITextureGLES

Public Member Functions

virtual ~CGUITexture ()=default
 
virtual CGUITextureClone () const =0
 
bool Process (unsigned int currentTime)
 
void Render (int32_t depthOffset=0, int32_t overrideDepth=-1)
 
void DynamicResourceAlloc (bool bOnOff)
 
bool AllocResources ()
 
void FreeResources (bool immediately=false)
 
void SetInvalid ()
 
bool SetVisible (bool visible)
 
bool SetAlpha (unsigned char alpha)
 
bool SetDiffuseColor (UTILS::COLOR::Color color, const CGUIListItem *item=nullptr)
 
bool SetPosition (float x, float y)
 
bool SetWidth (float width)
 
bool SetHeight (float height)
 
bool SetFileName (const std::string &filename)
 
void SetUseCache (const bool useCache=true)
 
bool SetAspectRatio (const CAspectRatio &aspect)
 
const std::string & GetFileName () const
 
float GetTextureWidth () const
 
float GetTextureHeight () const
 
float GetWidth () const
 
float GetHeight () const
 
float GetXPosition () const
 
float GetYPosition () const
 
int GetOrientation () const
 
const CRectGetRenderRect () const
 
bool IsLazyLoaded () const
 
KODI::GUILIB::GUIINFO::CGUIInfoColor GetDiffuseColor () const
 Get the diffuse color (info color) associated to this texture.
 
bool HitTest (const CPoint &point) const
 
bool IsAllocated () const
 
bool FailedToAlloc () const
 
bool ReadyToRender () const
 

Static Public Member Functions

static void Register (const CreateGUITextureFunc &createFunction, const DrawQuadFunc &drawQuadFunction)
 
static CGUITextureCreateTexture (float posX, float posY, float width, float height, const CTextureInfo &texture)
 
static void DrawQuad (const CRect &coords, UTILS::COLOR::Color color, CTexture *texture=nullptr, const CRect *texCoords=nullptr, const float depth=1.0, const bool blending=true)
 

Protected Types

enum  ALLOCATE_TYPE {
  NO = 0 , NORMAL , LARGE , NORMAL_FAILED ,
  LARGE_FAILED
}
 

Protected Member Functions

 CGUITexture (float posX, float posY, float width, float height, const CTextureInfo &texture)
 
 CGUITexture (const CGUITexture &left)
 
bool CalculateSize ()
 
bool AllocateOnDemand ()
 
bool UpdateAnimFrame (unsigned int currentTime)
 
void Render (float left, float top, float right, float bottom, float u1, float v1, float u2, float v2, float u3, float v3)
 
void ResetAnimState ()
 
virtual void Allocate ()
 
virtual void Free ()
 called after our textures have been allocated
 
virtual void Begin (UTILS::COLOR::Color color)=0
 called after our textures have been freed
 
virtual void Draw (float *x, float *y, float *z, const CRect &texture, const CRect &diffuse, int orientation)=0
 
virtual void End ()=0
 

Static Protected Member Functions

static void OrientateTexture (CRect &rect, float width, float height, int orientation)
 

Protected Attributes

bool m_visible
 
UTILS::COLOR::Color m_diffuseColor
 
float m_posX
 
float m_posY
 
float m_width
 
float m_height
 
float m_depth {0}
 
CRect m_vertex
 
bool m_invalid
 
bool m_use_cache
 
unsigned char m_alpha
 
float m_frameWidth
 
float m_frameHeight
 
float m_texCoordsScaleU
 
float m_texCoordsScaleV
 
int m_currentLoop
 
unsigned int m_currentFrame
 
uint32_t m_lasttime
 
float m_diffuseU
 
float m_diffuseV
 
float m_diffuseScaleU
 
float m_diffuseScaleV
 
CPoint m_diffuseOffset
 
bool m_allocateDynamically
 
ALLOCATE_TYPE m_isAllocated
 
CTextureInfo m_info
 
CAspectRatio m_aspect
 
CTextureArray m_diffuse
 
CTextureArray m_texture
 

Member Enumeration Documentation

◆ ALLOCATE_TYPE

Enumerator
NO 
NORMAL 
LARGE 
NORMAL_FAILED 
LARGE_FAILED 

Constructor & Destructor Documentation

◆ ~CGUITexture()

virtual CGUITexture::~CGUITexture ( )
virtualdefault

◆ CGUITexture() [1/2]

CGUITexture::CGUITexture ( float posX,
float posY,
float width,
float height,
const CTextureInfo & texture )
protected

◆ CGUITexture() [2/2]

CGUITexture::CGUITexture ( const CGUITexture & left)
protected

Member Function Documentation

◆ Allocate()

virtual void CGUITexture::Allocate ( )
inlineprotectedvirtual

◆ AllocateOnDemand()

bool CGUITexture::AllocateOnDemand ( )
protected

◆ AllocResources()

bool CGUITexture::AllocResources ( )

◆ Begin()

virtual void CGUITexture::Begin ( UTILS::COLOR::Color color)
protectedpure virtual

called after our textures have been freed

Implemented in CGUITextureD3D, CGUITextureGL, and CGUITextureGLES.

◆ CalculateSize()

bool CGUITexture::CalculateSize ( )
protected

◆ Clone()

virtual CGUITexture * CGUITexture::Clone ( ) const
pure virtual

◆ CreateTexture()

CGUITexture * CGUITexture::CreateTexture ( float posX,
float posY,
float width,
float height,
const CTextureInfo & texture )
static

◆ Draw()

virtual void CGUITexture::Draw ( float * x,
float * y,
float * z,
const CRect & texture,
const CRect & diffuse,
int orientation )
protectedpure virtual

◆ DrawQuad()

void CGUITexture::DrawQuad ( const CRect & coords,
UTILS::COLOR::Color color,
CTexture * texture = nullptr,
const CRect * texCoords = nullptr,
const float depth = 1.0,
const bool blending = true )
static

◆ DynamicResourceAlloc()

void CGUITexture::DynamicResourceAlloc ( bool bOnOff)

◆ End()

virtual void CGUITexture::End ( )
protectedpure virtual

◆ FailedToAlloc()

bool CGUITexture::FailedToAlloc ( ) const
inline

◆ Free()

virtual void CGUITexture::Free ( )
inlineprotectedvirtual

called after our textures have been allocated

◆ FreeResources()

void CGUITexture::FreeResources ( bool immediately = false)

◆ GetDiffuseColor()

KODI::GUILIB::GUIINFO::CGUIInfoColor CGUITexture::GetDiffuseColor ( ) const
inline

Get the diffuse color (info color) associated to this texture.

Returns
the infocolor associated to this texture

◆ GetFileName()

const std::string & CGUITexture::GetFileName ( ) const
inline

◆ GetHeight()

float CGUITexture::GetHeight ( ) const
inline

◆ GetOrientation()

int CGUITexture::GetOrientation ( ) const

◆ GetRenderRect()

const CRect & CGUITexture::GetRenderRect ( ) const
inline

◆ GetTextureHeight()

float CGUITexture::GetTextureHeight ( ) const
inline

◆ GetTextureWidth()

float CGUITexture::GetTextureWidth ( ) const
inline

◆ GetWidth()

float CGUITexture::GetWidth ( ) const
inline

◆ GetXPosition()

float CGUITexture::GetXPosition ( ) const
inline

◆ GetYPosition()

float CGUITexture::GetYPosition ( ) const
inline

◆ HitTest()

bool CGUITexture::HitTest ( const CPoint & point) const
inline

◆ IsAllocated()

bool CGUITexture::IsAllocated ( ) const
inline

◆ IsLazyLoaded()

bool CGUITexture::IsLazyLoaded ( ) const
inline

◆ OrientateTexture()

void CGUITexture::OrientateTexture ( CRect & rect,
float width,
float height,
int orientation )
staticprotected

◆ Process()

bool CGUITexture::Process ( unsigned int currentTime)

◆ ReadyToRender()

bool CGUITexture::ReadyToRender ( ) const

◆ Register()

void CGUITexture::Register ( const CreateGUITextureFunc & createFunction,
const DrawQuadFunc & drawQuadFunction )
static

◆ Render() [1/2]

void CGUITexture::Render ( float left,
float top,
float right,
float bottom,
float u1,
float v1,
float u2,
float v2,
float u3,
float v3 )
protected

◆ Render() [2/2]

void CGUITexture::Render ( int32_t depthOffset = 0,
int32_t overrideDepth = -1 )
Todo
The diffuse coloring applies to all vertices, which will look weird for stuff with borders, as will the -ve height/width for flipping

◆ ResetAnimState()

void CGUITexture::ResetAnimState ( )
protected

◆ SetAlpha()

bool CGUITexture::SetAlpha ( unsigned char alpha)

◆ SetAspectRatio()

bool CGUITexture::SetAspectRatio ( const CAspectRatio & aspect)

◆ SetDiffuseColor()

bool CGUITexture::SetDiffuseColor ( UTILS::COLOR::Color color,
const CGUIListItem * item = nullptr )

◆ SetFileName()

bool CGUITexture::SetFileName ( const std::string & filename)

◆ SetHeight()

bool CGUITexture::SetHeight ( float height)

◆ SetInvalid()

void CGUITexture::SetInvalid ( )

◆ SetPosition()

bool CGUITexture::SetPosition ( float x,
float y )

◆ SetUseCache()

void CGUITexture::SetUseCache ( const bool useCache = true)

◆ SetVisible()

bool CGUITexture::SetVisible ( bool visible)

◆ SetWidth()

bool CGUITexture::SetWidth ( float width)

◆ UpdateAnimFrame()

bool CGUITexture::UpdateAnimFrame ( unsigned int currentTime)
protected

Member Data Documentation

◆ m_allocateDynamically

bool CGUITexture::m_allocateDynamically
protected

◆ m_alpha

unsigned char CGUITexture::m_alpha
protected

◆ m_aspect

CAspectRatio CGUITexture::m_aspect
protected

◆ m_currentFrame

unsigned int CGUITexture::m_currentFrame
protected

◆ m_currentLoop

int CGUITexture::m_currentLoop
protected

◆ m_depth

float CGUITexture::m_depth {0}
protected

◆ m_diffuse

CTextureArray CGUITexture::m_diffuse
protected

◆ m_diffuseColor

UTILS::COLOR::Color CGUITexture::m_diffuseColor
protected

◆ m_diffuseOffset

CPoint CGUITexture::m_diffuseOffset
protected

◆ m_diffuseScaleU

float CGUITexture::m_diffuseScaleU
protected

◆ m_diffuseScaleV

float CGUITexture::m_diffuseScaleV
protected

◆ m_diffuseU

float CGUITexture::m_diffuseU
protected

◆ m_diffuseV

float CGUITexture::m_diffuseV
protected

◆ m_frameHeight

float CGUITexture::m_frameHeight
protected

◆ m_frameWidth

float CGUITexture::m_frameWidth
protected

◆ m_height

float CGUITexture::m_height
protected

◆ m_info

CTextureInfo CGUITexture::m_info
protected

◆ m_invalid

bool CGUITexture::m_invalid
protected

◆ m_isAllocated

ALLOCATE_TYPE CGUITexture::m_isAllocated
protected

◆ m_lasttime

uint32_t CGUITexture::m_lasttime
protected

◆ m_posX

float CGUITexture::m_posX
protected

◆ m_posY

float CGUITexture::m_posY
protected

◆ m_texCoordsScaleU

float CGUITexture::m_texCoordsScaleU
protected

◆ m_texCoordsScaleV

float CGUITexture::m_texCoordsScaleV
protected

◆ m_texture

CTextureArray CGUITexture::m_texture
protected

◆ m_use_cache

bool CGUITexture::m_use_cache
protected

◆ m_vertex

CRect CGUITexture::m_vertex
protected

◆ m_visible

bool CGUITexture::m_visible
protected

◆ m_width

float CGUITexture::m_width
protected

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