| 
    Kodi Documentation 22.0
    
   Kodi is an open source media player and entertainment hub. 
   | 
 
Base texture class, which holds the state of the texture, as well as all conversion functions. More...
#include <TextureBase.h>
  
Public Member Functions | |
| CTextureBase ()=default | |
| ~CTextureBase ()=default | |
| bool | HasAlpha () const | 
| void | SetAlpha (bool hasAlpha) | 
| void | SetMipmapping () | 
| sets mipmapping. do not use in new code. will be replaced with proper scaling.   | |
| bool | IsMipmapped () const | 
| return true if we want to mipmap   | |
| void | SetScalingMethod (TEXTURE_SCALING scalingMethod) | 
| sets the scaling method. scanout systems might support more than NN/linear.   | |
| TEXTURE_SCALING | GetScalingMethod () const | 
| returns the scaling method.   | |
| int32_t | GetOrientation () const | 
| void | SetOrientation (int orientation) | 
| void | SetCacheMemory (bool bCacheMemory) | 
| retains a shadow copy of the texture on the CPU side.   | |
| bool | GetCacheMemory () const | 
| returns true if a shadow copy is kept on the CPU side.   | |
| uint8_t * | GetPixels () const | 
| returns a pointer to the staging texture.   | |
| uint32_t | GetPitch () const | 
| return the size of one row in bytes.   | |
| uint32_t | GetRows () const | 
| return the number of rows (number of blocks in the Y direction).   | |
| uint32_t | GetTextureWidth () const | 
| return the total width of the texture, which might be scaled to fit its displayed size.   | |
| uint32_t | GetTextureHeight () const | 
| return the total height of the texture, which might be scaled to fit its displayed size.   | |
| uint32_t | GetWidth () const | 
| return the total width of "active" area, which might be equal or lower than the texture width due to alignment.   | |
| uint32_t | GetHeight () const | 
| return the total height of "active" area, which might be equal or lower than the texture height due to alignment.   | |
| uint32_t | GetOriginalWidth () const | 
| return the original width of the image, before scaling/cropping   | |
| uint32_t | GetOriginalHeight () const | 
| return the original height of the image, before scaling/cropping   | |
| KD_TEX_SWIZ | GetSwizzle () const | 
| return the texture swizzle   | |
| void | Allocate (uint32_t width, uint32_t height, XB_FMT format) | 
| void | ClampToEdge () | 
Static Public Member Functions | |
| static uint32_t | PadPow2 (uint32_t x) | 
| rounds to power of two. deprecated.   | |
| static bool | SwapBlueRed (uint8_t *pixels, uint32_t height, uint32_t pitch, uint32_t elements=4, uint32_t offset=0) | 
| swaps the blue/red channel. deprecated in this form.   | |
Protected Member Functions | |
| uint32_t | GetPitch (uint32_t width) const | 
| uint32_t | GetRows (uint32_t height) const | 
| uint32_t | GetBlockWidth () const | 
| uint32_t | GetBlockHeight () const | 
| uint32_t | GetBlockSize () const | 
| return the size of a compression block (tile) in bytes.   | |
| void | SetKDFormat (XB_FMT xbFMT) | 
| bool | ConvertToLegacy (uint32_t width, uint32_t height, uint8_t *src) | 
| Textures might be in a single/dual channel format with L/A/I/LA swizzle. DX and GLES 2.0 don't handle some/all at the moment. This function can convert the texture into a traditional BGRA format.   | |
Protected Attributes | |
| uint32_t | m_imageWidth {0} | 
| uint32_t | m_imageHeight {0} | 
| uint32_t | m_textureWidth {0} | 
| uint32_t | m_textureHeight {0} | 
| uint32_t | m_originalWidth {0} | 
| original image width before scaling or cropping   | |
| uint32_t | m_originalHeight {0} | 
| original image height before scaling or cropping   | |
| uint8_t * | m_pixels {nullptr} | 
| bool | m_loadedToGPU {false} | 
| KD_TEX_FMT | m_textureFormat {KD_TEX_FMT_UNKNOWN} | 
| KD_TEX_SWIZ | m_textureSwizzle {KD_TEX_SWIZ_RGBA} | 
| KD_TEX_COL | m_textureColorspace {KD_TEX_COL_REC709} | 
| KD_TEX_TRANSFER | m_textureTransfer {KD_TEX_TRANSFER_SRGB} | 
| KD_TEX_ALPHA | m_textureAlpha {KD_TEX_ALPHA_STRAIGHT} | 
| XB_FMT | m_format {XB_FMT_UNKNOWN} | 
| int32_t | m_orientation {0} | 
| bool | m_mipmapping {false} | 
| TEXTURE_SCALING | m_scalingMethod {TEXTURE_SCALING::LINEAR} | 
| bool | m_bCacheMemory {false} | 
Base texture class, which holds the state of the texture, as well as all conversion functions.
      
  | 
  default | 
      
  | 
  default | 
| void CTextureBase::ClampToEdge | ( | ) | 
Textures might be in a single/dual channel format with L/A/I/LA swizzle. DX and GLES 2.0 don't handle some/all at the moment. This function can convert the texture into a traditional BGRA format.
      
  | 
  protected | 
      
  | 
  protected | 
return the size of a compression block (tile) in bytes.
      
  | 
  protected | 
      
  | 
  inline | 
returns true if a shadow copy is kept on the CPU side.
      
  | 
  inline | 
return the total height of "active" area, which might be equal or lower than the texture height due to alignment.
      
  | 
  inline | 
      
  | 
  inline | 
return the original height of the image, before scaling/cropping
      
  | 
  inline | 
return the original width of the image, before scaling/cropping
      
  | 
  inline | 
return the size of one row in bytes.
      
  | 
  protected | 
      
  | 
  inline | 
returns a pointer to the staging texture.
      
  | 
  inline | 
return the number of rows (number of blocks in the Y direction).
      
  | 
  protected | 
      
  | 
  inline | 
returns the scaling method.
      
  | 
  inline | 
return the texture swizzle
      
  | 
  inline | 
return the total height of the texture, which might be scaled to fit its displayed size.
      
  | 
  inline | 
return the total width of the texture, which might be scaled to fit its displayed size.
      
  | 
  inline | 
return the total width of "active" area, which might be equal or lower than the texture width due to alignment.
      
  | 
  inline | 
      
  | 
  inline | 
return true if we want to mipmap
      
  | 
  static | 
rounds to power of two. deprecated.
retains a shadow copy of the texture on the CPU side.
      
  | 
  inline | 
sets mipmapping. do not use in new code. will be replaced with proper scaling.
      
  | 
  inline | 
sets the scaling method. scanout systems might support more than NN/linear.
      
  | 
  static | 
swaps the blue/red channel. deprecated in this form.
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
original image height before scaling or cropping
      
  | 
  protected | 
original image width before scaling or cropping
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected | 
      
  | 
  protected |