4 * Copyright (C) 2005-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
23 #include "DynamicDll.h"
30 typedef struct tagRGBQUAD {
38 #define EXIF_MAX_COMMENT 1000
40 typedef struct tag_ExifInfo {
43 char CameraModel [40];
52 float ApertureFNumber;
63 float FocalplaneUnits;
68 char Comments[EXIF_MAX_COMMENT];
70 unsigned char * ThumbnailPointer; /* Pointer at the thumbnail */
71 unsigned ThumbnailSize; /* Size of thumbnail. */
80 unsigned int originalwidth;
81 unsigned int originalheight;
88 class DllImageLibInterface
91 virtual ~DllImageLibInterface() {}
92 virtual bool ReleaseImage(ImageInfo *)=0;
93 virtual bool LoadImage(const char *, unsigned int, unsigned int, ImageInfo *)=0;
94 virtual bool LoadImageFromMemory(const uint8_t*, unsigned int, const char *, unsigned int, unsigned int, ImageInfo *)=0;
95 virtual bool CreateThumbnailFromSurface(BYTE *, unsigned int, unsigned int, unsigned int, const char *)=0;
96 virtual bool CreateThumbnailFromSurface2(BYTE *, unsigned int, unsigned int, unsigned int, const char *, BYTE * &, unsigned int&)=0;
97 virtual void FreeMemory(void*)=0;
100 class DllImageLib : public DllDynamic, DllImageLibInterface
102 DECLARE_DLL_WRAPPER(DllImageLib, DLL_PATH_IMAGELIB)
103 DEFINE_METHOD1(bool, ReleaseImage, (ImageInfo *p1))
104 DEFINE_METHOD4(bool, LoadImage, (const char * p1, unsigned int p2, unsigned int p3, ImageInfo * p4))
105 DEFINE_METHOD6(bool, LoadImageFromMemory, (const uint8_t * p1, unsigned int p2, const char *p3, unsigned int p4, unsigned int p5, ImageInfo * p6))
106 DEFINE_METHOD5(bool, CreateThumbnailFromSurface, (BYTE * p1, unsigned int p2, unsigned int p3, unsigned int p4, const char * p5))
107 DEFINE_METHOD7(bool, CreateThumbnailFromSurface2, (BYTE * p1, unsigned int p2, unsigned int p3, unsigned int p4, const char * p5, BYTE * &p6, unsigned int &p7))
108 DEFINE_METHOD1(void, FreeMemory, (void *p1))
109 BEGIN_METHOD_RESOLVE()
110 RESOLVE_METHOD(ReleaseImage)
111 RESOLVE_METHOD(LoadImage)
112 RESOLVE_METHOD(LoadImageFromMemory)
113 RESOLVE_METHOD(CreateThumbnailFromSurface)
114 RESOLVE_METHOD(CreateThumbnailFromSurface2)
115 RESOLVE_METHOD(FreeMemory)