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

#include <iimage.h>

Inheritance diagram for IImage:
CFFmpegImage KODI::ADDONS::CImageDecoder

Public Member Functions

virtual ~IImage ()=default
 
virtual bool LoadImageFromMemory (unsigned char *buffer, unsigned int bufSize, unsigned int width, unsigned int height)=0
 Load an image from memory with the format m_strMimeType to determine it's size and orientation.
 
virtual bool Decode (unsigned char *const pixels, unsigned int width, unsigned int height, unsigned int pitch, unsigned int format)=0
 Decodes the previously loaded image data to the output buffer in 32 bit raw bits.
 
virtual bool CreateThumbnailFromSurface (unsigned char *bufferin, unsigned int width, unsigned int height, unsigned int format, unsigned int pitch, const std::string &destFile, unsigned char *&bufferout, unsigned int &bufferoutSize)=0
 Encodes an thumbnail from raw bits of given memory location.
 
virtual void ReleaseThumbnailBuffer ()
 Frees the output buffer allocated by CreateThumbnailFromSurface.
 
unsigned int Width () const
 
unsigned int Height () const
 
unsigned int originalWidth () const
 
unsigned int originalHeight () const
 
unsigned int Orientation () const
 
bool hasAlpha () const
 

Protected Attributes

unsigned int m_width = 0
 
unsigned int m_height = 0
 
unsigned int m_originalWidth = 0
 original image width before scaling or cropping
 
unsigned int m_originalHeight = 0
 original image height before scaling or cropping
 
unsigned int m_orientation = 0
 
bool m_hasAlpha = false
 

Constructor & Destructor Documentation

◆ ~IImage()

virtual IImage::~IImage ( )
virtualdefault

Member Function Documentation

◆ CreateThumbnailFromSurface()

virtual bool IImage::CreateThumbnailFromSurface ( unsigned char * bufferin,
unsigned int width,
unsigned int height,
unsigned int format,
unsigned int pitch,
const std::string & destFile,
unsigned char *& bufferout,
unsigned int & bufferoutSize )
pure virtual

Encodes an thumbnail from raw bits of given memory location.

Remarks
Caller need to call ReleaseThumbnailBuffer() afterwards to free the output buffer
Parameters
bufferinThe memory location where the image data can be found
widthThe width of the thumbnail
heightThe height of the thumbnail
formatThe format of the input buffer (JpegIO only)
pitchThe pitch of the input texture stored in bufferin
destFileThe destination path of the thumbnail to determine the image format from the extension
bufferoutThe output buffer (will be allocated inside the method)
bufferoutSizeThe output buffer size
Returns
true if the thumbnail was successfully created

Implemented in CFFmpegImage, and KODI::ADDONS::CImageDecoder.

◆ Decode()

virtual bool IImage::Decode ( unsigned char *const pixels,
unsigned int width,
unsigned int height,
unsigned int pitch,
unsigned int format )
pure virtual

Decodes the previously loaded image data to the output buffer in 32 bit raw bits.

Parameters
pixelsThe output buffer
widthThe width of the image
heightThe height of the image
pitchThe pitch of the output buffer
formatThe format of the output buffer (JpegIO only)
Returns
true if the image data could be decoded to the output buffer

Implemented in CFFmpegImage, and KODI::ADDONS::CImageDecoder.

◆ hasAlpha()

bool IImage::hasAlpha ( ) const
inline

◆ Height()

unsigned int IImage::Height ( ) const
inline

◆ LoadImageFromMemory()

virtual bool IImage::LoadImageFromMemory ( unsigned char * buffer,
unsigned int bufSize,
unsigned int width,
unsigned int height )
pure virtual

Load an image from memory with the format m_strMimeType to determine it's size and orientation.

Parameters
bufferThe memory location where the image data can be found
bufSizeThe size of the buffer
widthThe ideal width of the texture
heightThe ideal height of the texture
Returns
true if the image could be loaded

Implemented in CFFmpegImage, and KODI::ADDONS::CImageDecoder.

◆ Orientation()

unsigned int IImage::Orientation ( ) const
inline

◆ originalHeight()

unsigned int IImage::originalHeight ( ) const
inline

◆ originalWidth()

unsigned int IImage::originalWidth ( ) const
inline

◆ ReleaseThumbnailBuffer()

virtual void IImage::ReleaseThumbnailBuffer ( )
inlinevirtual

Frees the output buffer allocated by CreateThumbnailFromSurface.

Reimplemented in CFFmpegImage.

◆ Width()

unsigned int IImage::Width ( ) const
inline

Member Data Documentation

◆ m_hasAlpha

bool IImage::m_hasAlpha = false
protected

◆ m_height

unsigned int IImage::m_height = 0
protected

◆ m_orientation

unsigned int IImage::m_orientation = 0
protected

◆ m_originalHeight

unsigned int IImage::m_originalHeight = 0
protected

original image height before scaling or cropping

◆ m_originalWidth

unsigned int IImage::m_originalWidth = 0
protected

original image width before scaling or cropping

◆ m_width

unsigned int IImage::m_width = 0
protected

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