kodi
ImageDecoder.h
1 /*
2  * Copyright (C) 2013 Arne Morten Kvarving
3  *
4  * SPDX-License-Identifier: GPL-2.0-or-later
5  * See LICENSES/README.md for more information.
6  */
7 
8 #pragma once
9 
10 #include "addons/IAddonSupportCheck.h"
11 #include "addons/binary-addons/AddonInstanceHandler.h"
12 #include "addons/kodi-dev-kit/include/kodi/addon-instance/ImageDecoder.h"
13 #include "guilib/iimage.h"
14 
15 class CPictureInfoTag;
16 
17 namespace KODI
18 {
19 namespace ADDONS
20 {
21 
24  public IImage
25 {
26 public:
27  explicit CImageDecoder(const ADDON::AddonInfoPtr& addonInfo, const std::string& mimetype);
28  ~CImageDecoder() override;
29 
30  bool IsCreated() const { return m_created; }
31 
33  bool CreateThumbnailFromSurface(unsigned char*,
35  unsigned int,
36  unsigned int,
37  unsigned int,
38  unsigned int,
39  const std::string&,
40  unsigned char*&,
41  unsigned int&) override
42  {
43  return false;
44  }
45  bool LoadImageFromMemory(unsigned char* buffer,
46  unsigned int bufSize,
47  unsigned int width,
48  unsigned int height) override;
49  bool Decode(unsigned char* const pixels,
50  unsigned int width,
51  unsigned int height,
52  unsigned int pitch,
53  unsigned int format) override;
55 
57  bool LoadInfoTag(const std::string& fileName, CPictureInfoTag* tag);
60 
62  bool SupportsFile(const std::string& filename) override;
65 
66 private:
68  const std::string m_mimetype;
69  bool m_created{false};
70 };
71 
72 } /* namespace ADDONS */
73 } /* namespace KODI */
Definition: ImageDecoder.h:22
Definition: AddonInstanceHandler.h:33
Definition: iimage.h:13
bool CreateThumbnailFromSurface(unsigned char *, unsigned int, unsigned int, unsigned int, unsigned int, const std::string &, unsigned char *&, unsigned int &) override
Definition: ImageDecoder.h:34
Definition: AudioDecoder.h:18
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. ...
Definition: ImageDecoder.cpp:194
bool LoadInfoTag(const std::string &fileName, CPictureInfoTag *tag)
Definition: ImageDecoder.cpp:61
Parent class to ask addons for support.
Definition: IAddonSupportCheck.h:25
Definition: PictureInfoTag.h:30
bool SupportsFile(const std::string &filename) override
Definition: ImageDecoder.cpp:52
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...
Definition: ImageDecoder.cpp:180