summaryrefslogtreecommitdiff
path: root/libcore/imageloader.h
diff options
context:
space:
mode:
authorManuel Reimer <manuel.reimer@gmx.de>2014-10-30 16:41:06 +0100
committerManuel Reimer <manuel.reimer@gmx.de>2014-10-30 16:41:06 +0100
commit94542945595f39866f868181f79583d20a019d1f (patch)
treed33a90022c2d4ea4aedb2af0fb3043012d8865b7 /libcore/imageloader.h
parent9609e183f26f2335cc282f8e3424a7bd9d0f25b4 (diff)
downloadvdr-plugin-skindesigner-94542945595f39866f868181f79583d20a019d1f.tar.gz
vdr-plugin-skindesigner-94542945595f39866f868181f79583d20a019d1f.tar.bz2
Removed ImageMagick dependency. Final class names for Cairo backend
Diffstat (limited to 'libcore/imageloader.h')
-rw-r--r--libcore/imageloader.h53
1 files changed, 44 insertions, 9 deletions
diff --git a/libcore/imageloader.h b/libcore/imageloader.h
index b2966c9..30e47b7 100644
--- a/libcore/imageloader.h
+++ b/libcore/imageloader.h
@@ -3,21 +3,56 @@
#define X_DISPLAY_MISSING
+#include <cairo.h>
#include <vdr/osd.h>
-#include <vdr/skins.h>
-#include <Magick++.h>
-#include "imagemagickwrapper.h"
+#include <vdr/tools.h>
-using namespace Magick;
+//
+// Image importers
+//
+class cImageImporter {
+public:
+ cImageImporter() {};
+ virtual ~cImageImporter() {};
+ virtual bool LoadImage(const char *path) {};
+ virtual void DrawToCairo(cairo_t *cr) {};
+ virtual void GetImageSize(int &width, int &height) {};
+};
-class cImageLoader : public cImageMagickWrapper {
+// Image importer for PNG
+class cImageImporterPNG : public cImageImporter {
public:
- cImageLoader();
- ~cImageLoader();
- cImage *GetImage(int width, int height);
+ cImageImporterPNG();
+ ~cImageImporterPNG();
bool LoadImage(const char *path);
- void DeterminateChannelLogoSize(int &width, int &height);
+ void DrawToCairo(cairo_t *cr);
+ void GetImageSize(int &width, int &height);
+private:
+ cairo_surface_t *surface;
+};
+
+// Image importer for SVG
+/*
+class cImageImporterSVG : public cImageImporter {
+public:
+ ~cImageImporterSVG();
+ bool LoadImage(const char *path);
+ bool RenderToCairo(cairo_t *cr);
+ void GetImageSize(int &width, int &height);
+private:
+ RsvgHandle *handle = NULL;
+}*/
+
+class cImageLoader {
private:
+ cImageImporter *importer = NULL;
+public:
+ cImageLoader();
+ virtual ~cImageLoader();
+ cImage *CreateImage(int width, int height, bool preserveAspect = true);
+ bool LoadImage(std::string FileName, std::string Path, std::string Extension);
+ bool LoadImage(const char *fullpath);
+ void DeterminateChannelLogoSize(int &width, int &height);
};
#endif //__NOPACITY_IMAGELOADER_H