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

#include <Picture.h>

Static Public Member Functions

static bool GetThumbnailFromSurface (const unsigned char *buffer, int width, int height, int stride, const std::string &thumbFile, uint8_t *&result, size_t &result_size)
 
static bool CreateThumbnailFromSurface (const unsigned char *buffer, int width, int height, int stride, const std::string &thumbFile)
 
static std::unique_ptr< CTextureCreateTiledThumb (const std::vector< std::string > &files)
 
static bool ResizeTexture (const std::string &image, CTexture *texture, uint32_t &dest_width, uint32_t &dest_height, uint8_t *&result, size_t &result_size, CPictureScalingAlgorithm::Algorithm scalingAlgorithm=CPictureScalingAlgorithm::NoAlgorithm)
 
static bool ResizeTexture (const std::string &image, uint8_t *pixels, uint32_t width, uint32_t height, uint32_t pitch, uint32_t &dest_width, uint32_t &dest_height, uint8_t *&result, size_t &result_size, CPictureScalingAlgorithm::Algorithm scalingAlgorithm=CPictureScalingAlgorithm::NoAlgorithm)
 
static bool CacheTexture (CTexture *texture, uint32_t &dest_width, uint32_t &dest_height, const std::string &dest, CPictureScalingAlgorithm::Algorithm scalingAlgorithm=CPictureScalingAlgorithm::NoAlgorithm)
 Cache a texture, resizing, rotating and flipping as needed, and saving as a JPG or PNG.
 
static bool CacheTexture (uint8_t *pixels, uint32_t width, uint32_t height, uint32_t pitch, int orientation, uint32_t &dest_width, uint32_t &dest_height, const std::string &dest, CPictureScalingAlgorithm::Algorithm scalingAlgorithm=CPictureScalingAlgorithm::NoAlgorithm)
 
static void GetScale (unsigned int width, unsigned int height, unsigned int &out_width, unsigned int &out_height)
 
static bool ScaleImage (uint8_t *in_pixels, unsigned int in_width, unsigned int in_height, unsigned int in_pitch, AVPixelFormat in_format, uint8_t *out_pixels, unsigned int out_width, unsigned int out_height, unsigned int out_pitch, AVPixelFormat out_format, CPictureScalingAlgorithm::Algorithm scalingAlgorithm=CPictureScalingAlgorithm::NoAlgorithm)
 

Member Function Documentation

◆ CacheTexture() [1/2]

bool CPicture::CacheTexture ( CTexture * texture,
uint32_t & dest_width,
uint32_t & dest_height,
const std::string & dest,
CPictureScalingAlgorithm::Algorithm scalingAlgorithm = CPictureScalingAlgorithm::NoAlgorithm )
static

Cache a texture, resizing, rotating and flipping as needed, and saving as a JPG or PNG.

Parameters
texturea pointer to a CTexture
dest_width[in/out] maximum width in pixels of cached version - replaced with actual cached width
dest_height[in/out] maximum height in pixels of cached version - replaced with actual cached height
destthe output cache file
Returns
true if successful, false otherwise

◆ CacheTexture() [2/2]

bool CPicture::CacheTexture ( uint8_t * pixels,
uint32_t width,
uint32_t height,
uint32_t pitch,
int orientation,
uint32_t & dest_width,
uint32_t & dest_height,
const std::string & dest,
CPictureScalingAlgorithm::Algorithm scalingAlgorithm = CPictureScalingAlgorithm::NoAlgorithm )
static

◆ CreateThumbnailFromSurface()

bool CPicture::CreateThumbnailFromSurface ( const unsigned char * buffer,
int width,
int height,
int stride,
const std::string & thumbFile )
static

◆ CreateTiledThumb()

std::unique_ptr< CTexture > CPicture::CreateTiledThumb ( const std::vector< std::string > & files)
static

◆ GetScale()

void CPicture::GetScale ( unsigned int width,
unsigned int height,
unsigned int & out_width,
unsigned int & out_height )
static

◆ GetThumbnailFromSurface()

bool CPicture::GetThumbnailFromSurface ( const unsigned char * buffer,
int width,
int height,
int stride,
const std::string & thumbFile,
uint8_t *& result,
size_t & result_size )
static

◆ ResizeTexture() [1/2]

bool CPicture::ResizeTexture ( const std::string & image,
CTexture * texture,
uint32_t & dest_width,
uint32_t & dest_height,
uint8_t *& result,
size_t & result_size,
CPictureScalingAlgorithm::Algorithm scalingAlgorithm = CPictureScalingAlgorithm::NoAlgorithm )
static

◆ ResizeTexture() [2/2]

bool CPicture::ResizeTexture ( const std::string & image,
uint8_t * pixels,
uint32_t width,
uint32_t height,
uint32_t pitch,
uint32_t & dest_width,
uint32_t & dest_height,
uint8_t *& result,
size_t & result_size,
CPictureScalingAlgorithm::Algorithm scalingAlgorithm = CPictureScalingAlgorithm::NoAlgorithm )
static

◆ ScaleImage()

bool CPicture::ScaleImage ( uint8_t * in_pixels,
unsigned int in_width,
unsigned int in_height,
unsigned int in_pitch,
AVPixelFormat in_format,
uint8_t * out_pixels,
unsigned int out_width,
unsigned int out_height,
unsigned int out_pitch,
AVPixelFormat out_format,
CPictureScalingAlgorithm::Algorithm scalingAlgorithm = CPictureScalingAlgorithm::NoAlgorithm )
static

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