diff options
| author | louis <louis.braun@gmx.de> | 2014-09-27 09:25:14 +0200 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2014-09-27 09:25:14 +0200 |
| commit | b0509b5182b6e0d04f05e6b3d5676b0d21f51966 (patch) | |
| tree | 22b302342f22843e0815eb5f516c85f1478cbf0b /libcore/imagecache.h | |
| download | vdr-plugin-skindesigner-b0509b5182b6e0d04f05e6b3d5676b0d21f51966.tar.gz vdr-plugin-skindesigner-b0509b5182b6e0d04f05e6b3d5676b0d21f51966.tar.bz2 | |
initial commit version 0.0.10.0.1
Diffstat (limited to 'libcore/imagecache.h')
| -rw-r--r-- | libcore/imagecache.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libcore/imagecache.h b/libcore/imagecache.h new file mode 100644 index 0000000..9e700bf --- /dev/null +++ b/libcore/imagecache.h @@ -0,0 +1,53 @@ +#ifndef __NOPACITY_IMAGECACHE_H +#define __NOPACITY_IMAGECACHE_H + +#define X_DISPLAY_MISSING + +#include <vdr/osd.h> +#include <vdr/skins.h> +#include <Magick++.h> +#include <vector> +#include "imagemagickwrapper.h" +#include "../libtemplate/templatefunction.h" + +using namespace Magick; + +class cImageCache : public cImageMagickWrapper { +public: + cImageCache(); + ~cImageCache(); + void Lock(void) { mutex.Lock(); } + void Unlock(void) { mutex.Unlock(); } + //channel logos + void CacheLogo(int width, int height); + cImage *GetLogo(string channelID, int width, int height); + bool LogoExists(string channelID); + cImage *GetSeparatorLogo(string name, int width, int height); + bool SeparatorLogoExists(string name); + //icons + void CacheIcon(eImageType type, string path, int width, int height); + cImage *GetIcon(eImageType type, string name, int width, int height); + string GetIconName(string label); + //skinparts + void CacheSkinpart(string path, int width, int height); + cImage *GetSkinpart(string name, int width, int height); + //helpers + void Clear(void); + void Debug(bool full); + void GetIconCacheSize(int &num, int &size); + void GetLogoCacheSize(int &num, int &size); + void GetSkinpartsCacheSize(int &num, int &size); +private: + static cMutex mutex; + static string items[16]; + cImage *tempStaticLogo; + map<string, cImage*> iconCache; + map<string, cImage*> channelLogoCache; + map<string, cImage*> skinPartsCache; + bool LoadIcon(eImageType type, string name); + bool LoadLogo(const cChannel *channel); + bool LoadSeparatorLogo(string name); + bool LoadSkinpart(string name); +}; + +#endif //__NOPACITY_IMAGECACHE_H |
