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

#include <GraphicContext.h>

Inheritance diagram for CGraphicContext:
CCriticalSection XbmcThreads::CountingLockable< XbmcThreads::CRecursiveMutex >

Classes

class  UITransform
 

Public Member Functions

 CGraphicContext (void)
 
virtual ~CGraphicContext ()
 
float GetFPS () const
 
void SetFPS (float fps)
 
float GetDisplayLatency () const
 
bool IsFullScreenRoot () const
 
void ToggleFullScreen ()
 
void SetFullScreenVideo (bool bOnOff)
 
bool IsFullScreenVideo () const
 
bool IsValidResolution (RESOLUTION res)
 
void SetVideoResolution (RESOLUTION res, bool forceUpdate)
 
void ApplyModeChange (RESOLUTION res)
 
void ApplyWindowResize (int newWidth, int newHeight)
 
RESOLUTION GetVideoResolution () const
 
const RESOLUTION_INFO GetResInfo () const
 
const RESOLUTION_INFO GetResInfo (RESOLUTION res) const
 
void SetResInfo (RESOLUTION res, const RESOLUTION_INFO &info)
 
void Flip (bool rendered, bool videoLayer)
 
int GetWidth () const
 
int GetHeight () const
 
bool SetViewPort (float fx, float fy, float fwidth, float fheight, bool intersectPrevious=false)
 
void RestoreViewPort ()
 
void SetScissors (const CRect &rect)
 
void ResetScissors ()
 
const CRectGetScissors () const
 
const CRect GetViewWindow () const
 
void SetViewWindow (float left, float top, float right, float bottom)
 
bool IsCalibrating () const
 
void SetCalibrating (bool bOnOff)
 
void ResetOverscan (RESOLUTION res, OVERSCAN &overscan)
 
void ResetOverscan (RESOLUTION_INFO &resinfo)
 
void ResetScreenParameters (RESOLUTION res)
 
void CaptureStateBlock ()
 
void ApplyStateBlock ()
 
void Clear (UTILS::Color color=0)
 
void GetAllowedResolutions (std::vector< RESOLUTION > &res)
 
void GetGUIScaling (const RESOLUTION_INFO &res, float &scaleX, float &scaleY, TransformMatrix *matrix=NULL)
 
void SetRenderingResolution (const RESOLUTION_INFO &res, bool needsScaling)
 Sets scaling up for rendering. More...
 
void SetScalingResolution (const RESOLUTION_INFO &res, bool needsScaling)
 Sets scaling up for skin loading etc. More...
 
float GetScalingPixelRatio () const
 
void InvertFinalCoords (float &x, float &y) const
 
float ScaleFinalXCoord (float x, float y) const
 
float ScaleFinalYCoord (float x, float y) const
 
float ScaleFinalZCoord (float x, float y) const
 
void ScaleFinalCoords (float &x, float &y, float &z) const
 
bool RectIsAngled (float x1, float y1, float x2, float y2) const
 
const TransformMatrixGetGUIMatrix () const
 
float GetGUIScaleX () const
 
float GetGUIScaleY () const
 
UTILS::Color MergeAlpha (UTILS::Color color) const
 
void SetOrigin (float x, float y)
 
void RestoreOrigin ()
 
void SetCameraPosition (const CPoint &camera)
 
void SetStereoView (RENDER_STEREO_VIEW view)
 
RENDER_STEREO_VIEW GetStereoView ()
 
void SetStereoMode (RENDER_STEREO_MODE mode)
 
RENDER_STEREO_MODE GetStereoMode ()
 
void RestoreCameraPosition ()
 
void SetStereoFactor (float factor)
 
void RestoreStereoFactor ()
 
bool SetClipRegion (float x, float y, float w, float h)
 Set a region in which to clip all rendering Anything that is rendered after setting a clip region will be clipped so that no part renders outside of the clip region. Successive calls to SetClipRegion intersect the clip region, which means the clip region may eventually become an empty set. In this case SetClipRegion returns false to indicate that no rendering need be performed. More...
 
void RestoreClipRegion ()
 
void ClipRect (CRect &vertex, CRect &texture, CRect *diffuse=NULL)
 
CRect GetClipRegion ()
 
void AddGUITransform ()
 
TransformMatrix AddTransform (const TransformMatrix &matrix)
 
void SetTransform (const TransformMatrix &matrix)
 
void SetTransform (const TransformMatrix &matrix, float scaleX, float scaleY)
 
void RemoveTransform ()
 
CRect StereoCorrection (const CRect &rect) const
 
CPoint StereoCorrection (const CPoint &point) const
 
CRect GenerateAABB (const CRect &rect) const
 
const std::string & GetMediaDir () const
 
void SetMediaDir (const std::string &strMediaDir)
 
- Public Member Functions inherited from XbmcThreads::CountingLockable< XbmcThreads::CRecursiveMutex >
 CountingLockable ()=default
 
void lock ()
 
bool try_lock ()
 
void unlock ()
 
unsigned int exit (unsigned int leave=0)
 
void restore (unsigned int restoreCount)
 
XbmcThreads::CRecursiveMutex & get_underlying ()
 

Protected Member Functions

void UpdateCameraPosition (const CPoint &camera, const float &factor)
 
void SetVideoResolutionInternal (RESOLUTION res, bool forceUpdate)
 
void ApplyVideoResolution (RESOLUTION res)
 
void UpdateInternalStateWithResolution (RESOLUTION res)
 

Protected Attributes

int m_iScreenHeight = 576
 
int m_iScreenWidth = 720
 
std::string m_strMediaDir
 
CRect m_videoRect
 
bool m_bFullScreenRoot = true
 
bool m_bFullScreenVideo = false
 
bool m_bCalibrating = false
 
RESOLUTION m_Resolution = RES_INVALID
 
float m_fFPSOverride = 0.0f
 
RESOLUTION_INFO m_windowResolution
 
std::stack< CPointm_cameras
 
std::stack< CPointm_origins
 
std::stack< CRectm_clipRegions
 
std::stack< float > m_stereoFactors
 
std::stack< CRectm_viewStack
 
CRect m_scissors
 
UITransform m_guiTransform
 
UITransform m_finalTransform
 
std::stack< UITransformm_transforms
 
RENDER_STEREO_VIEW m_stereoView = RENDER_STEREO_VIEW_OFF
 
RENDER_STEREO_MODE m_stereoMode = RENDER_STEREO_MODE_OFF
 
RENDER_STEREO_MODE m_nextStereoMode = RENDER_STEREO_MODE_OFF
 
- Protected Attributes inherited from XbmcThreads::CountingLockable< XbmcThreads::CRecursiveMutex >
XbmcThreads::CRecursiveMutex mutex
 
unsigned int count
 

Constructor & Destructor Documentation

◆ CGraphicContext()

CGraphicContext::CGraphicContext ( void  )
default

◆ ~CGraphicContext()

CGraphicContext::~CGraphicContext ( )
virtualdefault

Member Function Documentation

◆ AddGUITransform()

void CGraphicContext::AddGUITransform ( )

◆ AddTransform()

TransformMatrix CGraphicContext::AddTransform ( const TransformMatrix matrix)

◆ ApplyModeChange()

void CGraphicContext::ApplyModeChange ( RESOLUTION  res)

◆ ApplyStateBlock()

void CGraphicContext::ApplyStateBlock ( )

◆ ApplyVideoResolution()

void CGraphicContext::ApplyVideoResolution ( RESOLUTION  res)
protected

◆ ApplyWindowResize()

void CGraphicContext::ApplyWindowResize ( int  newWidth,
int  newHeight 
)

◆ CaptureStateBlock()

void CGraphicContext::CaptureStateBlock ( )

◆ Clear()

void CGraphicContext::Clear ( UTILS::Color  color = 0)

◆ ClipRect()

void CGraphicContext::ClipRect ( CRect vertex,
CRect texture,
CRect diffuse = NULL 
)

◆ Flip()

void CGraphicContext::Flip ( bool  rendered,
bool  videoLayer 
)

◆ GenerateAABB()

CRect CGraphicContext::GenerateAABB ( const CRect rect) const

◆ GetAllowedResolutions()

void CGraphicContext::GetAllowedResolutions ( std::vector< RESOLUTION > &  res)

◆ GetClipRegion()

CRect CGraphicContext::GetClipRegion ( )

◆ GetDisplayLatency()

float CGraphicContext::GetDisplayLatency ( ) const

◆ GetFPS()

float CGraphicContext::GetFPS ( ) const

◆ GetGUIMatrix()

const TransformMatrix & CGraphicContext::GetGUIMatrix ( ) const

◆ GetGUIScaleX()

float CGraphicContext::GetGUIScaleX ( ) const

◆ GetGUIScaleY()

float CGraphicContext::GetGUIScaleY ( ) const

◆ GetGUIScaling()

void CGraphicContext::GetGUIScaling ( const RESOLUTION_INFO res,
float &  scaleX,
float &  scaleY,
TransformMatrix matrix = NULL 
)

◆ GetHeight()

int CGraphicContext::GetHeight ( ) const

◆ GetMediaDir()

const std::string & CGraphicContext::GetMediaDir ( ) const

◆ GetResInfo() [1/2]

const RESOLUTION_INFO CGraphicContext::GetResInfo ( ) const

◆ GetResInfo() [2/2]

const RESOLUTION_INFO CGraphicContext::GetResInfo ( RESOLUTION  res) const

◆ GetScalingPixelRatio()

float CGraphicContext::GetScalingPixelRatio ( ) const

◆ GetScissors()

const CRect & CGraphicContext::GetScissors ( ) const

◆ GetStereoMode()

RENDER_STEREO_MODE CGraphicContext::GetStereoMode ( )
inline

◆ GetStereoView()

RENDER_STEREO_VIEW CGraphicContext::GetStereoView ( )
inline

◆ GetVideoResolution()

RESOLUTION CGraphicContext::GetVideoResolution ( ) const

◆ GetViewWindow()

const CRect CGraphicContext::GetViewWindow ( ) const

◆ GetWidth()

int CGraphicContext::GetWidth ( ) const

◆ InvertFinalCoords()

void CGraphicContext::InvertFinalCoords ( float &  x,
float &  y 
) const

◆ IsCalibrating()

bool CGraphicContext::IsCalibrating ( ) const

◆ IsFullScreenRoot()

bool CGraphicContext::IsFullScreenRoot ( ) const

◆ IsFullScreenVideo()

bool CGraphicContext::IsFullScreenVideo ( ) const

◆ IsValidResolution()

bool CGraphicContext::IsValidResolution ( RESOLUTION  res)

◆ MergeAlpha()

UTILS::Color CGraphicContext::MergeAlpha ( UTILS::Color  color) const

◆ RectIsAngled()

bool CGraphicContext::RectIsAngled ( float  x1,
float  y1,
float  x2,
float  y2 
) const

◆ RemoveTransform()

void CGraphicContext::RemoveTransform ( )

◆ ResetOverscan() [1/2]

void CGraphicContext::ResetOverscan ( RESOLUTION  res,
OVERSCAN overscan 
)

◆ ResetOverscan() [2/2]

void CGraphicContext::ResetOverscan ( RESOLUTION_INFO resinfo)

◆ ResetScissors()

void CGraphicContext::ResetScissors ( )

◆ ResetScreenParameters()

void CGraphicContext::ResetScreenParameters ( RESOLUTION  res)

◆ RestoreCameraPosition()

void CGraphicContext::RestoreCameraPosition ( )

◆ RestoreClipRegion()

void CGraphicContext::RestoreClipRegion ( )

◆ RestoreOrigin()

void CGraphicContext::RestoreOrigin ( )

◆ RestoreStereoFactor()

void CGraphicContext::RestoreStereoFactor ( )

◆ RestoreViewPort()

void CGraphicContext::RestoreViewPort ( )

◆ ScaleFinalCoords()

void CGraphicContext::ScaleFinalCoords ( float &  x,
float &  y,
float &  z 
) const

◆ ScaleFinalXCoord()

float CGraphicContext::ScaleFinalXCoord ( float  x,
float  y 
) const

◆ ScaleFinalYCoord()

float CGraphicContext::ScaleFinalYCoord ( float  x,
float  y 
) const

◆ ScaleFinalZCoord()

float CGraphicContext::ScaleFinalZCoord ( float  x,
float  y 
) const

◆ SetCalibrating()

void CGraphicContext::SetCalibrating ( bool  bOnOff)

◆ SetCameraPosition()

void CGraphicContext::SetCameraPosition ( const CPoint camera)

◆ SetClipRegion()

bool CGraphicContext::SetClipRegion ( float  x,
float  y,
float  w,
float  h 
)

Set a region in which to clip all rendering Anything that is rendered after setting a clip region will be clipped so that no part renders outside of the clip region. Successive calls to SetClipRegion intersect the clip region, which means the clip region may eventually become an empty set. In this case SetClipRegion returns false to indicate that no rendering need be performed.

This call must be matched with a RestoreClipRegion call unless SetClipRegion returns false.

Usage should be of the form:

if (SetClipRegion(x, y, w, h)) { ... perform rendering ... RestoreClipRegion(); }

Parameters
xthe left-most coordinate of the clip region
ythe top-most coordinate of the clip region
wthe width of the clip region
hthe height of the clip region
Returns
true if the region is set and the result is non-empty. Returns false if the resulting region is empty.
See also
RestoreClipRegion

◆ SetFPS()

void CGraphicContext::SetFPS ( float  fps)

◆ SetFullScreenVideo()

void CGraphicContext::SetFullScreenVideo ( bool  bOnOff)

◆ SetMediaDir()

void CGraphicContext::SetMediaDir ( const std::string &  strMediaDir)

◆ SetOrigin()

void CGraphicContext::SetOrigin ( float  x,
float  y 
)

◆ SetRenderingResolution()

void CGraphicContext::SetRenderingResolution ( const RESOLUTION_INFO res,
bool  needsScaling 
)

Sets scaling up for rendering.

◆ SetResInfo()

void CGraphicContext::SetResInfo ( RESOLUTION  res,
const RESOLUTION_INFO info 
)

◆ SetScalingResolution()

void CGraphicContext::SetScalingResolution ( const RESOLUTION_INFO res,
bool  needsScaling 
)

Sets scaling up for skin loading etc.

◆ SetScissors()

void CGraphicContext::SetScissors ( const CRect rect)

◆ SetStereoFactor()

void CGraphicContext::SetStereoFactor ( float  factor)

◆ SetStereoMode()

void CGraphicContext::SetStereoMode ( RENDER_STEREO_MODE  mode)
inline

◆ SetStereoView()

void CGraphicContext::SetStereoView ( RENDER_STEREO_VIEW  view)

◆ SetTransform() [1/2]

void CGraphicContext::SetTransform ( const TransformMatrix matrix)

◆ SetTransform() [2/2]

void CGraphicContext::SetTransform ( const TransformMatrix matrix,
float  scaleX,
float  scaleY 
)

◆ SetVideoResolution()

void CGraphicContext::SetVideoResolution ( RESOLUTION  res,
bool  forceUpdate 
)

◆ SetVideoResolutionInternal()

void CGraphicContext::SetVideoResolutionInternal ( RESOLUTION  res,
bool  forceUpdate 
)
protected

◆ SetViewPort()

bool CGraphicContext::SetViewPort ( float  fx,
float  fy,
float  fwidth,
float  fheight,
bool  intersectPrevious = false 
)

◆ SetViewWindow()

void CGraphicContext::SetViewWindow ( float  left,
float  top,
float  right,
float  bottom 
)

◆ StereoCorrection() [1/2]

CPoint CGraphicContext::StereoCorrection ( const CPoint point) const

◆ StereoCorrection() [2/2]

CRect CGraphicContext::StereoCorrection ( const CRect rect) const

◆ ToggleFullScreen()

void CGraphicContext::ToggleFullScreen ( )

◆ UpdateCameraPosition()

void CGraphicContext::UpdateCameraPosition ( const CPoint camera,
const float &  factor 
)
protected

◆ UpdateInternalStateWithResolution()

void CGraphicContext::UpdateInternalStateWithResolution ( RESOLUTION  res)
protected

Member Data Documentation

◆ m_bCalibrating

bool CGraphicContext::m_bCalibrating = false
protected

◆ m_bFullScreenRoot

bool CGraphicContext::m_bFullScreenRoot = true
protected

◆ m_bFullScreenVideo

bool CGraphicContext::m_bFullScreenVideo = false
protected

◆ m_cameras

std::stack<CPoint> CGraphicContext::m_cameras
protected

◆ m_clipRegions

std::stack<CRect> CGraphicContext::m_clipRegions
protected

◆ m_fFPSOverride

float CGraphicContext::m_fFPSOverride = 0.0f
protected

◆ m_finalTransform

UITransform CGraphicContext::m_finalTransform
protected

◆ m_guiTransform

UITransform CGraphicContext::m_guiTransform
protected

◆ m_iScreenHeight

int CGraphicContext::m_iScreenHeight = 576
protected

◆ m_iScreenWidth

int CGraphicContext::m_iScreenWidth = 720
protected

◆ m_nextStereoMode

RENDER_STEREO_MODE CGraphicContext::m_nextStereoMode = RENDER_STEREO_MODE_OFF
protected

◆ m_origins

std::stack<CPoint> CGraphicContext::m_origins
protected

◆ m_Resolution

RESOLUTION CGraphicContext::m_Resolution = RES_INVALID
protected

◆ m_scissors

CRect CGraphicContext::m_scissors
protected

◆ m_stereoFactors

std::stack<float> CGraphicContext::m_stereoFactors
protected

◆ m_stereoMode

RENDER_STEREO_MODE CGraphicContext::m_stereoMode = RENDER_STEREO_MODE_OFF
protected

◆ m_stereoView

RENDER_STEREO_VIEW CGraphicContext::m_stereoView = RENDER_STEREO_VIEW_OFF
protected

◆ m_strMediaDir

std::string CGraphicContext::m_strMediaDir
protected

◆ m_transforms

std::stack<UITransform> CGraphicContext::m_transforms
protected

◆ m_videoRect

CRect CGraphicContext::m_videoRect
protected

◆ m_viewStack

std::stack<CRect> CGraphicContext::m_viewStack
protected

◆ m_windowResolution

RESOLUTION_INFO CGraphicContext::m_windowResolution
protected

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