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

#include <FFmpegImage.h>

Inheritance diagram for CFFmpegImage:
IImage

Public Member Functions

 CFFmpegImage (const std::string &strMimeType)
 
 ~CFFmpegImage () override
 
bool LoadImageFromMemory (unsigned char *buffer, unsigned int bufSize, unsigned int width, unsigned int height) override
 Load an image from memory with the format m_strMimeType to determine it's size and orientation.
 
bool Decode (unsigned char *const pixels, unsigned int width, unsigned int height, unsigned int pitch, unsigned int format) override
 Decodes the previously loaded image data to the output buffer in 32 bit raw bits.
 
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) override
 Encodes an thumbnail from raw bits of given memory location.
 
void ReleaseThumbnailBuffer () override
 Frees the output buffer allocated by CreateThumbnailFromSurface.
 
bool Initialize (unsigned char *buffer, size_t bufSize)
 
std::shared_ptr< FrameReadFrame ()
 
- Public Member Functions inherited from IImage
virtual ~IImage ()=default
 
unsigned int Width () const
 
unsigned int Height () const
 
unsigned int originalWidth () const
 
unsigned int originalHeight () const
 
unsigned int Orientation () const
 
bool hasAlpha () const
 

Additional Inherited Members

- Protected Attributes inherited from IImage
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

◆ CFFmpegImage()

CFFmpegImage::CFFmpegImage ( const std::string & strMimeType)
explicit

◆ ~CFFmpegImage()

CFFmpegImage::~CFFmpegImage ( )
override

Member Function Documentation

◆ CreateThumbnailFromSurface()

bool CFFmpegImage::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 )
overridevirtual

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

Implements IImage.

◆ Decode()

bool CFFmpegImage::Decode ( unsigned char *const pixels,
unsigned int width,
unsigned int height,
unsigned int pitch,
unsigned int format )
overridevirtual

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

Implements IImage.

◆ Initialize()

bool CFFmpegImage::Initialize ( unsigned char * buffer,
size_t bufSize )

◆ LoadImageFromMemory()

bool CFFmpegImage::LoadImageFromMemory ( unsigned char * buffer,
unsigned int bufSize,
unsigned int width,
unsigned int height )
overridevirtual

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

Implements IImage.

◆ ReadFrame()

std::shared_ptr< Frame > CFFmpegImage::ReadFrame ( )

◆ ReleaseThumbnailBuffer()

void CFFmpegImage::ReleaseThumbnailBuffer ( )
overridevirtual

Frees the output buffer allocated by CreateThumbnailFromSurface.

Reimplemented from IImage.


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