summaryrefslogtreecommitdiff
path: root/imagecache.h
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-12-21 11:25:03 +0100
committerlouis <louis.braun@gmx.de>2013-12-21 11:25:03 +0100
commit4c61104675de5f1fac7e7fa95fb5743e18defc02 (patch)
tree7a3ee90e3b28246e8d4595954d4559445fb7ebe7 /imagecache.h
parent8aa2c81d3165a0517115337362f1203ea4bdd899 (diff)
downloadvdr-plugin-tvguide-4c61104675de5f1fac7e7fa95fb5743e18defc02.tar.gz
vdr-plugin-tvguide-4c61104675de5f1fac7e7fa95fb5743e18defc02.tar.bz2
Version 1.2.0pre
Diffstat (limited to 'imagecache.h')
-rw-r--r--imagecache.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/imagecache.h b/imagecache.h
new file mode 100644
index 0000000..1fd86f2
--- /dev/null
+++ b/imagecache.h
@@ -0,0 +1,89 @@
+#ifndef __TVGUIDE_IMAGECACHE_H
+#define __TVGUIDE_IMAGECACHE_H
+
+#define X_DISPLAY_MISSING
+
+#include <map>
+#include <vector>
+#include "imagemagickwrapper.h"
+
+enum eCacheType {
+ ctOsdElement = 0,
+ ctGrid,
+ ctLogo,
+ ctChannelGroup,
+};
+
+enum eOsdElementType {
+ oeNone = -1,
+ oeStatusHeaderContentFull,
+ oeStatusHeaderContentWindowed,
+ oeStatusHeaderTVFrame,
+ oeButtonRed,
+ oeButtonGreen,
+ oeButtonYellow,
+ oeButtonBlue,
+ oeLogoBack,
+ oeTimeline1,
+ oeTimeline2,
+ oeDateViewer,
+ oeClock,
+ oeEpgHeader,
+};
+
+class cImageCache : public cImageMagickWrapper {
+public:
+ cImageCache();
+ ~cImageCache();
+ void CreateCache(void);
+ cImage *GetOsdElement(eOsdElementType type);
+ cImage *GetGrid(int width, int height, bool active);
+ cImage *GetChannelGroup(int width, int height);
+ cImage *GetLogo(const cChannel *channel);
+ std::string GetCacheSize(eCacheType type);
+ void Clear(void);
+private:
+ cImage *tempStaticLogo;
+ Image bufferGrid;
+ Image bufferGridActive;
+ bool gridsAvailable;
+ int cornerWidth;
+ int cornerHeight;
+ cImage *imgLeft;
+ cImage *imgLeftActive;
+ cImage *imgRight;
+ cImage *imgRightActive;
+ cImage *imgHead;
+ cImage *imgHeadActive;
+ cImage *imgBottom;
+ cImage *imgBottomActive;
+ cImage *imgChannelgroupHead;
+ cImage *imgChannelgroupBottom;
+ cImage *groupsHead;
+ cImage *groupsBottom;
+ cImage *groupsLeft;
+ cImage *groupsRight;
+ std::map<eOsdElementType, cImage*> osdElementCache;
+ std::map<std::string, cImage*> gridCache;
+ std::map<std::string, cImage*> groupsCache;
+ std::map<std::string, cImage*> logoCache;
+ void CreateOsdIconCache(void);
+ void PrepareGridIconCache(void);
+ void CreateGridIconCache(void);
+ void CreateChannelGroupCache(void);
+ void CreateLogoCache(void);
+ bool LoadIcon(std::string name);
+ void InsertIntoOsdElementCache(eOsdElementType type, int width=0, int height=0);
+ void InsertIntoGridCache(std::string name, int width, int height, bool active);
+ cImage *CreateGrid(int width, int height, bool active);
+ void AddCornersHorizontal(cImage *img, bool active);
+ void AddCornersVertical(cImage *img, bool active);
+ void InsertIntoGroupsCacheHorizontal(int size);
+ void InsertIntoGroupsCacheVertical(int size);
+ void AddCornersGroupHorizontal(cImage *img);
+ void AddCornersGroupVertical(cImage *img);
+ bool LoadLogo(const cChannel *channel);
+ void InsertIntoLogoCache(std::string channelID);
+};
+
+#endif //__TVGUIDE_IMAGECACHE_H \ No newline at end of file