File: image_cache.h

package info (click to toggle)
literki 0.0.0+20100113.git1da40724-1.2
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 3,444 kB
  • ctags: 1,153
  • sloc: cpp: 5,263; makefile: 72
file content (32 lines) | stat: -rw-r--r-- 539 bytes parent folder | download | duplicates (2)
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
#ifndef _IMAGE_CACHE_H
#define _IMAGE_CACHE_H

#include <string>
#include <vector>

#include <png++/image.hpp>
#include <png++/rgb_pixel.hpp>


typedef png::image<png::rgb_pixel> PngImage;

class ImageCache {
  public:
    PngImage& GetImage(const std::string& name);
    void SetImagesPath(const std::string& path);

  private:

    struct Image {
	std::string name;
	PngImage png;
	Image(std::string n, PngImage p):name(n), png(p){}
    };

    std::string path;
    std::vector<Image> images;
};

extern ImageCache image_cache;

#endif