Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::ADDONS::CImageDecoder Class Reference

#include <ImageDecoder.h>

Inheritance diagram for KODI::ADDONS::CImageDecoder:
ADDON::IAddonInstanceHandler KODI::ADDONS::IAddonSupportCheck IImage

Public Member Functions

 CImageDecoder (const ADDON::AddonInfoPtr &addonInfo, const std::string &mimetype)
 
 ~CImageDecoder () override
 
bool IsCreated () const
 
bool CreateThumbnailFromSurface (unsigned char *, unsigned int, unsigned int, unsigned int, unsigned int, const std::string &, unsigned char *&, unsigned int &) 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 LoadInfoTag (const std::string &fileName, CPictureInfoTag *tag)
 
bool SupportsFile (const std::string &filename) override
 
- Public Member Functions inherited from ADDON::IAddonInstanceHandler
 IAddonInstanceHandler (ADDON_TYPE type, const AddonInfoPtr &addonInfo, AddonInstanceId instanceId=ADDON_INSTANCE_ID_UNUSED, KODI_HANDLE parentInstance=nullptr, const std::string &uniqueWorkID="")
 Class constructor for handling add-on instance processes, allowing an add-on to handle multiple work simultaneously and independently.
 
virtual ~IAddonInstanceHandler ()
 
ADDON_TYPE UsedType () const
 
AddonInstanceId InstanceId () const
 
const std::string & UniqueWorkID ()
 
std::string ID () const
 
std::string Name () const
 
std::string Author () const
 
std::string Icon () const
 
std::string Path () const
 
std::string Profile () const
 
CAddonVersion Version () const
 
ADDON_STATUS CreateInstance ()
 
void DestroyInstance ()
 
const AddonDllPtrAddon () const
 
AddonInfoPtr GetAddonInfo () const
 
virtual void OnPreInstall ()
 
virtual void OnPostInstall (bool update, bool modal)
 
virtual void OnPreUnInstall ()
 
virtual void OnPostUnInstall ()
 
- Public Member Functions inherited from KODI::ADDONS::IAddonSupportCheck
 IAddonSupportCheck ()=default
 
virtual ~IAddonSupportCheck ()=default
 
- Public Member Functions inherited from IImage
virtual ~IImage ()=default
 
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
 

Additional Inherited Members

- Protected Attributes inherited from ADDON::IAddonInstanceHandler
KODI_ADDON_INSTANCE_INFO m_info {}
 
KODI_ADDON_INSTANCE_STRUCT m_ifc {}
 
- 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

◆ CImageDecoder()

CImageDecoder::CImageDecoder ( const ADDON::AddonInfoPtr & addonInfo,
const std::string & mimetype )
explicit

◆ ~CImageDecoder()

CImageDecoder::~CImageDecoder ( )
override

Member Function Documentation

◆ CreateThumbnailFromSurface()

bool KODI::ADDONS::CImageDecoder::CreateThumbnailFromSurface ( unsigned char * ,
unsigned int ,
unsigned int ,
unsigned int ,
unsigned int ,
const std::string & ,
unsigned char *& ,
unsigned int &  )
inlineoverridevirtual

IImage related functions

Implements IImage.

◆ Decode()

bool CImageDecoder::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.

◆ IsCreated()

bool KODI::ADDONS::CImageDecoder::IsCreated ( ) const
inline

◆ LoadImageFromMemory()

bool CImageDecoder::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.

◆ LoadInfoTag()

bool CImageDecoder::LoadInfoTag ( const std::string & fileName,
CPictureInfoTag * tag )

From CPictureInfoTag used function to get information from addon

List of values currently not used on addon interface.

struct ExifInfo:

  • int Process{};
  • float CCDWidth{};
  • int Whitebalance{};
  • int CommentsCharset{};
  • int XPCommentsCharset{};
  • std::string Comments;
  • std::string FileComment;
  • std::string XPComment;
  • unsigned ThumbnailOffset{};
  • unsigned ThumbnailSize{};
  • unsigned LargestExifOffset{};
  • char ThumbnailAtEnd{};
  • int ThumbnailSizeOffset{};
  • std::vector<int> DateTimeOffsets;

struct IPTCInfo:

  • std::string RecordVersion;
  • std::string SupplementalCategories;
  • std::string Keywords;
  • std::string Caption;
  • std::string Headline;
  • std::string SpecialInstructions;
  • std::string Category;
  • std::string Byline;
  • std::string BylineTitle;
  • std::string Credit;
  • std::string Source;
  • std::string ObjectName;
  • std::string City;
  • std::string State;
  • std::string Country;
  • std::string TransmissionReference;
  • std::string Date;
  • std::string Urgency;
  • std::string ReferenceService;
  • std::string CountryCode;
  • std::string SubLocation;
  • std::string ImageType;
Todo
Rework CPictureInfoTag to not limit on fixed structures ExifInfo & IPTCInfo.

◆ SupportsFile()

bool CImageDecoder::SupportsFile ( const std::string & filename)
overridevirtual

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