summaryrefslogtreecommitdiff
path: root/imagecache.h
blob: 00ee007d1e6b587b84a6ce1f1546c9ede2a889eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include <vdr/osd.h>
#include <vdr/skins.h>
#include <string>

#define MAX_IMAGE_CACHE     999
#define LOGO_PRE_CACHE      200
// note MAX_LOGO_PRE_CACHE is used twice
// one for displaychannel and one for menu
// you must double the value for the real amount of pre cached logos

class cImageCache {
private:
    cImage *CacheImage[MAX_IMAGE_CACHE];
    std::string CacheName[MAX_IMAGE_CACHE];
    int CacheWidth[MAX_IMAGE_CACHE];
    int CacheHeight[MAX_IMAGE_CACHE];
    
    int InsertIndex;
    bool Overflow;
public:
    cImageCache();
    ~cImageCache();
    
    void Create(void);
    void Clear(void);

    int getCacheCount(void) { if(Overflow) return MAX_IMAGE_CACHE; return InsertIndex+1; }

    cImage *GetImage(std::string Name, int Width, int Height);
    void InsertImage(cImage *Image, std::string Name, int Width, int Height);
    
    void PreLoadImage(void);
};