summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile_Evas.am3
-rw-r--r--src/lib/evas/Evas_Loader.h77
-rw-r--r--src/lib/evas/cache/evas_cache.h6
-rw-r--r--src/lib/evas/cache/evas_cache_engine_image.c2
-rw-r--r--src/lib/evas/cache/evas_cache_image.c4
-rw-r--r--src/lib/evas/cache2/evas_cache2.c15
-rw-r--r--src/lib/evas/cache2/evas_cache2.h2
-rw-r--r--src/lib/evas/common/evas_image.h2
-rw-r--r--src/lib/evas/common/evas_image_main.c2
-rw-r--r--src/lib/evas/cserve2/evas_cs2_client.c4
-rw-r--r--src/lib/evas/cserve2/evas_cs2_private.h2
-rw-r--r--src/lib/evas/include/evas_common.h51
-rw-r--r--src/lib/evas/include/evas_private.h26
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h2
-rw-r--r--src/modules/evas/loaders/bmp/evas_image_load_bmp.c2
-rw-r--r--src/modules/evas/loaders/eet/evas_image_load_eet.c2
-rw-r--r--src/modules/evas/loaders/generic/evas_image_load_generic.c2
-rw-r--r--src/modules/evas/loaders/gif/evas_image_load_gif.c2
-rw-r--r--src/modules/evas/loaders/ico/evas_image_load_ico.c2
-rw-r--r--src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c2
-rw-r--r--src/modules/evas/loaders/pmaps/evas_image_load_pmaps.c2
-rw-r--r--src/modules/evas/loaders/png/evas_image_load_png.c2
-rw-r--r--src/modules/evas/loaders/psd/evas_image_load_psd.c2
-rw-r--r--src/modules/evas/loaders/tga/evas_image_load_tga.c2
-rw-r--r--src/modules/evas/loaders/tiff/evas_image_load_tiff.c2
-rw-r--r--src/modules/evas/loaders/wbmp/evas_image_load_wbmp.c2
-rw-r--r--src/modules/evas/loaders/webp/evas_image_load_webp.c2
-rw-r--r--src/modules/evas/loaders/xpm/evas_image_load_xpm.c2
28 files changed, 118 insertions, 108 deletions
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 878e0d910b..afdc1bbc57 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -10,7 +10,8 @@ lib/evas/Evas.h \
10lib/evas/Evas_Common_Header.h \ 10lib/evas/Evas_Common_Header.h \
11lib/evas/Evas_Eo.h \ 11lib/evas/Evas_Eo.h \
12lib/evas/Evas_Legacy.h \ 12lib/evas/Evas_Legacy.h \
13lib/evas/Evas_GL.h 13lib/evas/Evas_GL.h \
14lib/evas/Evas_Loader.h
14 15
15noinst_HEADERS = \ 16noinst_HEADERS = \
16lib/evas/include/evas_inline.x \ 17lib/evas/include/evas_inline.x \
diff --git a/src/lib/evas/Evas_Loader.h b/src/lib/evas/Evas_Loader.h
new file mode 100644
index 0000000000..4f53b7ddb1
--- /dev/null
+++ b/src/lib/evas/Evas_Loader.h
@@ -0,0 +1,77 @@
1#ifndef _EVAS_LOADER_H
2#define _EVAS_LOADER_H
3
4#include <Eina.h>
5
6typedef struct _Evas_Image_Load_Opts Evas_Image_Load_Opts;
7typedef struct _Evas_Image_Animated Evas_Image_Animated;
8typedef struct _Evas_Image_Property Evas_Image_Property;
9typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func;
10
11struct _Evas_Image_Property
12{
13 unsigned int w;
14 unsigned int h;
15
16 unsigned char scale;
17
18 Eina_Bool rotated;
19 Eina_Bool alpha;
20 Eina_Bool premul;
21 Eina_Bool alpha_sparse;
22};
23
24struct _Evas_Image_Animated
25{
26 Eina_List *frames;
27
28 Evas_Image_Animated_Loop_Hint loop_hint;
29
30 int frame_count;
31 int loop_count;
32 int cur_frame;
33
34 Eina_Bool animated;
35};
36
37struct _Evas_Image_Load_Opts
38{
39 struct {
40 unsigned int x, y, w, h;
41 } region;
42 struct {
43 int src_x, src_y, src_w, src_h;
44 int dst_w, dst_h;
45 int smooth;
46 Evas_Image_Scale_Hint scale_hint;
47 } scale_load;
48 double dpi; // if > 0.0 use this
49 unsigned int w, h; // if > 0 use this
50 unsigned int degree;//if>0 there is some info related with rotation
51 int scale_down_by; // if > 1 then use this
52
53 Eina_Bool orientation; // if EINA_TRUE => should honor orientation information provided by file (like jpeg exif info)
54};
55
56struct _Evas_Image_Load_Func
57{
58 void *(*file_open) (Eina_File *f, const char *key,
59 Evas_Image_Load_Opts *opts,
60 Evas_Image_Animated *animated,
61 int *error);
62 void (*file_close) (void *loader_data);
63
64 Eina_Bool (*file_head) (void *loader_data,
65 Evas_Image_Property *prop,
66 int *error);
67 Eina_Bool (*file_data) (void *loader_data,
68 Evas_Image_Property *prop,
69 void *pixels, int *error);
70 double (*frame_duration) (void *loader_data,
71 int start, int frame_num);
72
73 Eina_Bool threadable;
74 Eina_Bool do_region;
75};
76
77#endif
diff --git a/src/lib/evas/cache/evas_cache.h b/src/lib/evas/cache/evas_cache.h
index 8b851c33e3..8fca866f1f 100644
--- a/src/lib/evas/cache/evas_cache.h
+++ b/src/lib/evas/cache/evas_cache.h
@@ -65,7 +65,7 @@ struct _Evas_Cache_Image
65struct _Evas_Cache_Engine_Image_Func 65struct _Evas_Cache_Engine_Image_Func
66{ 66{
67 /* Must return a char* allocated with eina_stringshare_add. */ 67 /* Must return a char* allocated with eina_stringshare_add. */
68 char* (*key)(Image_Entry *im, const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error); 68 char* (*key)(Image_Entry *im, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
69 69
70 Engine_Image_Entry* (*alloc)(void); 70 Engine_Image_Entry* (*alloc)(void);
71 void (*dealloc)(Engine_Image_Entry *eim); 71 void (*dealloc)(Engine_Image_Entry *eim);
@@ -113,7 +113,7 @@ extern "C" {
113 113
114EAPI Evas_Cache_Image* evas_cache_image_init(const Evas_Cache_Image_Func *cb); 114EAPI Evas_Cache_Image* evas_cache_image_init(const Evas_Cache_Image_Func *cb);
115EAPI void evas_cache_image_shutdown(Evas_Cache_Image *cache); 115EAPI void evas_cache_image_shutdown(Evas_Cache_Image *cache);
116EAPI Image_Entry* evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error); 116EAPI Image_Entry* evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
117EAPI void evas_cache_image_ref(Image_Entry *im); 117EAPI void evas_cache_image_ref(Image_Entry *im);
118EAPI void evas_cache_image_drop(Image_Entry *im); 118EAPI void evas_cache_image_drop(Image_Entry *im);
119EAPI void evas_cache_image_data_not_needed(Image_Entry *im); 119EAPI void evas_cache_image_data_not_needed(Image_Entry *im);
@@ -147,7 +147,7 @@ EAPI int evas_cache_engine_image_usage_get(Evas_Cache_Engin
147EAPI int evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache); 147EAPI int evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache);
148EAPI void evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit); 148EAPI void evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit);
149 149
150EAPI Engine_Image_Entry* evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache, const char *file, const char *key, RGBA_Image_Loadopts *lo, void *engine_data, int *error); 150EAPI Engine_Image_Entry* evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache, const char *file, const char *key, Evas_Image_Load_Opts *lo, void *engine_data, int *error);
151EAPI void evas_cache_engine_parent_not_needed(Engine_Image_Entry *eim); 151EAPI void evas_cache_engine_parent_not_needed(Engine_Image_Entry *eim);
152EAPI Engine_Image_Entry* evas_cache_engine_image_engine(Evas_Cache_Engine_Image *cache, void *engine_data); 152EAPI Engine_Image_Entry* evas_cache_engine_image_engine(Evas_Cache_Engine_Image *cache, void *engine_data);
153EAPI void evas_cache_engine_image_drop(Engine_Image_Entry *eim); 153EAPI void evas_cache_engine_image_drop(Engine_Image_Entry *eim);
diff --git a/src/lib/evas/cache/evas_cache_engine_image.c b/src/lib/evas/cache/evas_cache_engine_image.c
index a7a9905e9d..c0c4a6e6db 100644
--- a/src/lib/evas/cache/evas_cache_engine_image.c
+++ b/src/lib/evas/cache/evas_cache_engine_image.c
@@ -301,7 +301,7 @@ evas_cache_engine_image_shutdown(Evas_Cache_Engine_Image *cache)
301EAPI Engine_Image_Entry * 301EAPI Engine_Image_Entry *
302evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache, 302evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache,
303 const char *file, const char *key, 303 const char *file, const char *key,
304 RGBA_Image_Loadopts *lo, void *data, int *error) 304 Evas_Image_Load_Opts *lo, void *data, int *error)
305{ 305{
306 Engine_Image_Entry *eim; 306 Engine_Image_Entry *eim;
307 Image_Entry *im; 307 Image_Entry *im;
diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c
index 42afdf8f6d..6765f6ba8a 100644
--- a/src/lib/evas/cache/evas_cache_image.c
+++ b/src/lib/evas/cache/evas_cache_image.c
@@ -215,7 +215,7 @@ _evas_cache_image_entry_new(Evas_Cache_Image *cache,
215 Image_Timestamp *tstamp, 215 Image_Timestamp *tstamp,
216 const char *file, 216 const char *file,
217 const char *key, 217 const char *key,
218 RGBA_Image_Loadopts *lo, 218 Evas_Image_Load_Opts *lo,
219 int *error) 219 int *error)
220{ 220{
221 Image_Entry *ie; 221 Image_Entry *ie;
@@ -565,7 +565,7 @@ evas_cache_image_shutdown(Evas_Cache_Image *cache)
565 565
566EAPI Image_Entry * 566EAPI Image_Entry *
567evas_cache_image_request(Evas_Cache_Image *cache, const char *file, 567evas_cache_image_request(Evas_Cache_Image *cache, const char *file,
568 const char *key, RGBA_Image_Loadopts *lo, int *error) 568 const char *key, Evas_Image_Load_Opts *lo, int *error)
569{ 569{
570 const char *ckey = "(null)"; 570 const char *ckey = "(null)";
571 char *hkey; 571 char *hkey;
diff --git a/src/lib/evas/cache2/evas_cache2.c b/src/lib/evas/cache2/evas_cache2.c
index e16c5cb880..a819e385ea 100644
--- a/src/lib/evas/cache2/evas_cache2.c
+++ b/src/lib/evas/cache2/evas_cache2.c
@@ -222,7 +222,7 @@ _evas_cache_image_entry_new(Evas_Cache2 *cache,
222 Image_Timestamp *tstamp, 222 Image_Timestamp *tstamp,
223 const char *file, 223 const char *file,
224 const char *key, 224 const char *key,
225 RGBA_Image_Loadopts *lo, 225 Evas_Image_Load_Opts *lo,
226 int *error) 226 int *error)
227{ 227{
228 Image_Entry *ie; 228 Image_Entry *ie;
@@ -534,7 +534,7 @@ evas_cache2_shutdown(Evas_Cache2 *cache)
534} 534}
535 535
536static void 536static void
537_create_hash_key(char *hkey, const char *path, size_t pathlen, const char *key, size_t keylen, RGBA_Image_Loadopts *lo) 537_create_hash_key(char *hkey, const char *path, size_t pathlen, const char *key, size_t keylen, Evas_Image_Load_Opts *lo)
538{ 538{
539 const char *ckey = "(null)"; 539 const char *ckey = "(null)";
540 size_t size; 540 size_t size;
@@ -618,7 +618,7 @@ _create_hash_key(char *hkey, const char *path, size_t pathlen, const char *key,
618} 618}
619 619
620EAPI Image_Entry * 620EAPI Image_Entry *
621evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key, RGBA_Image_Loadopts *lo, int *error) 621evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key, Evas_Image_Load_Opts *lo, int *error)
622{ 622{
623 size_t size; 623 size_t size;
624 size_t pathlen; 624 size_t pathlen;
@@ -628,8 +628,7 @@ evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key, RG
628 int stat_done = 0, stat_failed = 0; 628 int stat_done = 0, stat_failed = 0;
629 struct stat st; 629 struct stat st;
630 Image_Timestamp tstamp; 630 Image_Timestamp tstamp;
631 Evas_Image_Load_Opts prevent = { 0, 0.0, 0, 0, 0, { 0, 0, 0, 0 }, 631 Evas_Image_Load_Opts prevent;
632 { 0, 0, 0, 0, 0, 0, 0, 0 }, EINA_FALSE };
633 632
634 if ((!path) || ((!path) && (!key))) 633 if ((!path) || ((!path) && (!key)))
635 { 634 {
@@ -637,6 +636,8 @@ evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key, RG
637 return NULL; 636 return NULL;
638 } 637 }
639 638
639 memset(&prevent, 0, sizeof (Evas_Image_Load_Opts));
640
640 pathlen = strlen(path); 641 pathlen = strlen(path);
641 keylen = key ? strlen(key) : 6; 642 keylen = key ? strlen(key) : 6;
642 size = pathlen + keylen + HKEY_LOAD_OPTS_STR_LEN; 643 size = pathlen + keylen + HKEY_LOAD_OPTS_STR_LEN;
@@ -775,7 +776,7 @@ _scaled_image_find(Image_Entry *im, int src_x, int src_y, int src_w, int src_h,
775{ 776{
776 size_t pathlen, keylen, size; 777 size_t pathlen, keylen, size;
777 char *hkey; 778 char *hkey;
778 RGBA_Image_Loadopts lo; 779 Evas_Image_Load_Opts lo;
779 Image_Entry *ret; 780 Image_Entry *ret;
780 781
781 if (((!im->file) || ((!im->file) && (!im->key))) || (!im->data1) || 782 if (((!im->file) || ((!im->file) && (!im->key))) || (!im->data1) ||
@@ -837,7 +838,7 @@ evas_cache2_image_scale_load(Image_Entry *im, int src_x, int src_y, int src_w, i
837{ 838{
838 size_t pathlen, keylen, size; 839 size_t pathlen, keylen, size;
839 char *hkey; 840 char *hkey;
840 RGBA_Image_Loadopts lo; 841 Evas_Image_Load_Opts lo;
841 int error = EVAS_LOAD_ERROR_NONE; 842 int error = EVAS_LOAD_ERROR_NONE;
842 Image_Entry *ret; 843 Image_Entry *ret;
843 844
diff --git a/src/lib/evas/cache2/evas_cache2.h b/src/lib/evas/cache2/evas_cache2.h
index 5fddd1708e..f6ba8f881e 100644
--- a/src/lib/evas/cache2/evas_cache2.h
+++ b/src/lib/evas/cache2/evas_cache2.h
@@ -58,7 +58,7 @@ extern "C" {
58 58
59EAPI Evas_Cache2* evas_cache2_init(const Evas_Cache2_Image_Func *cb); 59EAPI Evas_Cache2* evas_cache2_init(const Evas_Cache2_Image_Func *cb);
60EAPI void evas_cache2_shutdown(Evas_Cache2 *cache); 60EAPI void evas_cache2_shutdown(Evas_Cache2 *cache);
61EAPI Image_Entry * evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key, RGBA_Image_Loadopts *lo, int *error); 61EAPI Image_Entry * evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key, Evas_Image_Load_Opts *lo, int *error);
62EAPI Image_Entry *evas_cache2_image_scale_load(Image_Entry *im, int src_x, int src_y, int src_w, int src_h, int dst_w, int dst_h, int smooth); 62EAPI Image_Entry *evas_cache2_image_scale_load(Image_Entry *im, int src_x, int src_y, int src_w, int src_h, int dst_w, int dst_h, int smooth);
63EAPI int evas_cache2_image_open_wait(Image_Entry *im); 63EAPI int evas_cache2_image_open_wait(Image_Entry *im);
64EAPI void evas_cache2_image_ref(Image_Entry *im); 64EAPI void evas_cache2_image_ref(Image_Entry *im);
diff --git a/src/lib/evas/common/evas_image.h b/src/lib/evas/common/evas_image.h
index d9ca581818..79f1a29c33 100644
--- a/src/lib/evas/common/evas_image.h
+++ b/src/lib/evas/common/evas_image.h
@@ -32,7 +32,7 @@ EAPI RGBA_Image *evas_common_image_alpha_line_buffer_obtain (int len);
32EAPI void evas_common_image_alpha_line_buffer_release (RGBA_Image *im); 32EAPI void evas_common_image_alpha_line_buffer_release (RGBA_Image *im);
33EAPI void evas_common_image_alpha_line_buffer_free (RGBA_Image *im); 33EAPI void evas_common_image_alpha_line_buffer_free (RGBA_Image *im);
34 34
35EAPI RGBA_Image *evas_common_load_image_from_file (const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error); 35EAPI RGBA_Image *evas_common_load_image_from_file (const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
36EAPI int evas_common_save_image_to_file (RGBA_Image *im, const char *file, const char *key, int quality, int compress); 36EAPI int evas_common_save_image_to_file (RGBA_Image *im, const char *file, const char *key, int quality, int compress);
37 37
38EAPI void evas_common_rgba_image_scalecache_init(Image_Entry *ie); 38EAPI void evas_common_rgba_image_scalecache_init(Image_Entry *ie);
diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c
index d8e3559ac2..8a7e21fd59 100644
--- a/src/lib/evas/common/evas_image_main.c
+++ b/src/lib/evas/common/evas_image_main.c
@@ -755,7 +755,7 @@ evas_common_image_get_cache(void)
755} 755}
756 756
757EAPI RGBA_Image * 757EAPI RGBA_Image *
758evas_common_load_image_from_file(const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error) 758evas_common_load_image_from_file(const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error)
759{ 759{
760 if (!file) 760 if (!file)
761 { 761 {
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c
index d3e41d52ca..b1997a8e6b 100644
--- a/src/lib/evas/cserve2/evas_cs2_client.c
+++ b/src/lib/evas/cserve2/evas_cs2_client.c
@@ -483,7 +483,7 @@ _build_absolute_path(const char *path, char buf[], int size)
483} 483}
484 484
485static unsigned int 485static unsigned int
486_image_open_server_send(Image_Entry *ie, const char *file, const char *key, RGBA_Image_Loadopts *lopt EINA_UNUSED) 486_image_open_server_send(Image_Entry *ie, const char *file, const char *key, Evas_Image_Load_Opts *lopt EINA_UNUSED)
487{ 487{
488 int flen, klen; 488 int flen, klen;
489 int size; 489 int size;
@@ -727,7 +727,7 @@ _image_unload_server_send(Image_Entry *ie)
727} 727}
728 728
729Eina_Bool 729Eina_Bool
730evas_cserve2_image_load(Image_Entry *ie, const char *file, const char *key, RGBA_Image_Loadopts *lopt) 730evas_cserve2_image_load(Image_Entry *ie, const char *file, const char *key, Evas_Image_Load_Opts *lopt)
731{ 731{
732 unsigned int rid; 732 unsigned int rid;
733 733
diff --git a/src/lib/evas/cserve2/evas_cs2_private.h b/src/lib/evas/cserve2/evas_cs2_private.h
index ab9b432d01..5ffbff3b93 100644
--- a/src/lib/evas/cserve2/evas_cs2_private.h
+++ b/src/lib/evas/cserve2/evas_cs2_private.h
@@ -23,7 +23,7 @@ typedef struct _Font_Entry Font_Entry;
23int evas_cserve2_init(void); 23int evas_cserve2_init(void);
24int evas_cserve2_shutdown(void); 24int evas_cserve2_shutdown(void);
25EAPI int evas_cserve2_use_get(void); 25EAPI int evas_cserve2_use_get(void);
26Eina_Bool evas_cserve2_image_load(Image_Entry *ie, const char *file, const char *key, RGBA_Image_Loadopts *lopt); 26Eina_Bool evas_cserve2_image_load(Image_Entry *ie, const char *file, const char *key, Evas_Image_Load_Opts *lopt);
27int evas_cserve2_image_load_wait(Image_Entry *ie); 27int evas_cserve2_image_load_wait(Image_Entry *ie);
28Eina_Bool evas_cserve2_image_data_load(Image_Entry *ie); 28Eina_Bool evas_cserve2_image_data_load(Image_Entry *ie);
29void evas_cserve2_image_load_data_wait(Image_Entry *ie); 29void evas_cserve2_image_load_data_wait(Image_Entry *ie);
diff --git a/src/lib/evas/include/evas_common.h b/src/lib/evas/include/evas_common.h
index a1b94fcc20..03a2777d58 100644
--- a/src/lib/evas/include/evas_common.h
+++ b/src/lib/evas/include/evas_common.h
@@ -50,6 +50,7 @@
50#include <Eina.h> 50#include <Eina.h>
51#include "Evas.h" 51#include "Evas.h"
52//#include "Evas_GL.h" 52//#include "Evas_GL.h"
53#include "Evas_Loader.h"
53 54
54#ifndef HAVE_LROUND 55#ifndef HAVE_LROUND
55/* right now i dont care about rendering bugs on platforms without lround 56/* right now i dont care about rendering bugs on platforms without lround
@@ -352,8 +353,6 @@ typedef unsigned short DATA16;
352typedef unsigned char DATA8; 353typedef unsigned char DATA8;
353 354
354typedef struct _Image_Entry Image_Entry; 355typedef struct _Image_Entry Image_Entry;
355typedef struct _Image_Entry_Property Image_Entry_Property;
356typedef struct _Image_Entry_Animated Image_Entry_Animated;
357typedef struct _Image_Entry_Flags Image_Entry_Flags; 356typedef struct _Image_Entry_Flags Image_Entry_Flags;
358typedef struct _Image_Entry_Frame Image_Entry_Frame; 357typedef struct _Image_Entry_Frame Image_Entry_Frame;
359typedef struct _Image_Timestamp Image_Timestamp; 358typedef struct _Image_Timestamp Image_Timestamp;
@@ -361,7 +360,6 @@ typedef struct _Engine_Image_Entry Engine_Image_Entry;
361typedef struct _Evas_Cache_Target Evas_Cache_Target; 360typedef struct _Evas_Cache_Target Evas_Cache_Target;
362typedef struct _Evas_Preload_Pthread Evas_Preload_Pthread; 361typedef struct _Evas_Preload_Pthread Evas_Preload_Pthread;
363 362
364typedef struct _RGBA_Image_Loadopts RGBA_Image_Loadopts;
365#ifdef BUILD_PIPE_RENDER 363#ifdef BUILD_PIPE_RENDER
366typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op; 364typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op;
367typedef struct _RGBA_Pipe RGBA_Pipe; 365typedef struct _RGBA_Pipe RGBA_Pipe;
@@ -495,25 +493,6 @@ typedef enum _Font_Rend_Flags
495 493
496/*****************************************************************************/ 494/*****************************************************************************/
497 495
498struct _RGBA_Image_Loadopts
499{
500 int scale_down_by; // if > 1 then use this
501 double dpi; // if > 0.0 use this
502 unsigned int w, h; // if > 0 use this
503 unsigned int degree;//if>0 there is some info related with rotation
504 struct {
505 unsigned int x, y, w, h;
506 } region;
507 struct {
508 int src_x, src_y, src_w, src_h;
509 int dst_w, dst_h;
510 int smooth;
511 Evas_Image_Scale_Hint scale_hint;
512 } scale_load;
513
514 Eina_Bool orientation; // if EINA_TRUE => should honor orientation information provided by file (like jpeg exif info)
515};
516
517struct _Image_Entry_Flags 496struct _Image_Entry_Flags
518{ 497{
519 Eina_Bool loaded : 1; 498 Eina_Bool loaded : 1;
@@ -544,17 +523,6 @@ struct _Image_Entry_Frame
544 Eina_Bool loaded : 1; 523 Eina_Bool loaded : 1;
545}; 524};
546 525
547struct _Image_Entry_Animated
548{
549 Eina_List *frames;
550 Evas_Image_Animated_Loop_Hint loop_hint;
551 int frame_count;
552 int loop_count;
553 int cur_frame;
554
555 Eina_Bool animated : 1;
556};
557
558struct _Evas_Cache_Target 526struct _Evas_Cache_Target
559{ 527{
560 EINA_INLIST; 528 EINA_INLIST;
@@ -572,19 +540,6 @@ struct _Image_Timestamp
572#endif 540#endif
573}; 541};
574 542
575struct _Image_Entry_Property
576{
577 unsigned int w;
578 unsigned int h;
579
580 unsigned char scale;
581
582 Eina_Bool rotated;
583 Eina_Bool alpha;
584 Eina_Bool premul;
585 Eina_Bool alpha_sparse;
586};
587
588struct _Image_Entry 543struct _Image_Entry
589{ 544{
590 EINA_INLIST; 545 EINA_INLIST;
@@ -610,7 +565,7 @@ struct _Image_Entry
610 RGBA_Pipe *pipe; 565 RGBA_Pipe *pipe;
611#endif 566#endif
612 567
613 RGBA_Image_Loadopts load_opts; 568 Evas_Image_Load_Opts load_opts;
614 int space; 569 int space;
615 570
616 unsigned int w; 571 unsigned int w;
@@ -634,7 +589,7 @@ struct _Image_Entry
634 LK(lock_cancel); 589 LK(lock_cancel);
635 590
636 /* for animation feature */ 591 /* for animation feature */
637 Image_Entry_Animated animated; 592 Evas_Image_Animated animated;
638 593
639 /* Reference to the file */ 594 /* Reference to the file */
640 Eina_File *f; 595 Eina_File *f;
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index bc3805e7cf..82a0211833 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -9,6 +9,7 @@
9#include <eina_safety_checks.h> 9#include <eina_safety_checks.h>
10 10
11#include "Evas.h" 11#include "Evas.h"
12#include "Evas_Loader.h"
12 13
13#include "../file/evas_module.h" 14#include "../file/evas_module.h"
14#include "../file/evas_path.h" 15#include "../file/evas_path.h"
@@ -32,11 +33,7 @@ typedef struct _Evas_Font Evas_Font;
32typedef struct _Evas_Font_Alias Evas_Font_Alias; 33typedef struct _Evas_Font_Alias Evas_Font_Alias;
33typedef struct _Evas_Font_Description Evas_Font_Description; 34typedef struct _Evas_Font_Description Evas_Font_Description;
34typedef struct _Evas_Data_Node Evas_Data_Node; 35typedef struct _Evas_Data_Node Evas_Data_Node;
35typedef RGBA_Image_Loadopts Evas_Image_Load_Opts;
36typedef Image_Entry_Animated Evas_Image_Animated;
37typedef Image_Entry_Property Evas_Image_Property;
38typedef struct _Evas_Func Evas_Func; 36typedef struct _Evas_Func Evas_Func;
39typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func;
40typedef struct _Evas_Image_Save_Func Evas_Image_Save_Func; 37typedef struct _Evas_Image_Save_Func Evas_Image_Save_Func;
41typedef struct _Evas_Object_Func Evas_Object_Func; 38typedef struct _Evas_Object_Func Evas_Object_Func;
42typedef struct _Evas_Intercept_Func Evas_Intercept_Func; 39typedef struct _Evas_Intercept_Func Evas_Intercept_Func;
@@ -900,27 +897,6 @@ struct _Evas_Func
900 Eina_Bool (*pixel_alpha_get) (void *image, int x, int y, DATA8 *alpha, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h); 897 Eina_Bool (*pixel_alpha_get) (void *image, int x, int y, DATA8 *alpha, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
901}; 898};
902 899
903struct _Evas_Image_Load_Func
904{
905 Eina_Bool threadable;
906 void *(*file_open) (Eina_File *f, const char *key,
907 Evas_Image_Load_Opts *opts,
908 Evas_Image_Animated *animated,
909 int *error);
910 void (*file_close) (void *loader_data);
911
912 Eina_Bool (*file_head) (void *loader_data,
913 Evas_Image_Property *prop,
914 int *error);
915 Eina_Bool (*file_data) (void *loader_data,
916 Evas_Image_Property *prop,
917 void *pixels, int *error);
918 double (*frame_duration) (void *loader_data,
919 int start, int frame_num);
920
921 Eina_Bool do_region;
922};
923
924struct _Evas_Image_Save_Func 900struct _Evas_Image_Save_Func
925{ 901{
926 int (*image_save) (RGBA_Image *im, const char *file, const char *key, int quality, int compress); 902 int (*image_save) (RGBA_Image *im, const char *file, const char *key, int quality, int compress);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h
index b3b8b24796..e7603203de 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -467,7 +467,7 @@ struct _Evas_GL_Image
467 Evas_Engine_GL_Context *gc; 467 Evas_Engine_GL_Context *gc;
468 RGBA_Image *im; 468 RGBA_Image *im;
469 Evas_GL_Texture *tex; 469 Evas_GL_Texture *tex;
470 RGBA_Image_Loadopts load_opts; 470 Evas_Image_Load_Opts load_opts;
471 int references; 471 int references;
472 // if im->im == NULL, it's a render-surface so these here are used 472 // if im->im == NULL, it's a render-surface so these here are used
473 int w, h; 473 int w, h;
diff --git a/src/modules/evas/loaders/bmp/evas_image_load_bmp.c b/src/modules/evas/loaders/bmp/evas_image_load_bmp.c
index 981937cab4..ea86238115 100644
--- a/src/modules/evas/loaders/bmp/evas_image_load_bmp.c
+++ b/src/modules/evas/loaders/bmp/evas_image_load_bmp.c
@@ -1371,12 +1371,12 @@ evas_image_load_file_data_bmp(void *loader_data,
1371 1371
1372static Evas_Image_Load_Func evas_image_load_bmp_func = 1372static Evas_Image_Load_Func evas_image_load_bmp_func =
1373{ 1373{
1374 EINA_TRUE,
1375 evas_image_load_file_open_bmp, 1374 evas_image_load_file_open_bmp,
1376 evas_image_load_file_close_bmp, 1375 evas_image_load_file_close_bmp,
1377 evas_image_load_file_head_bmp, 1376 evas_image_load_file_head_bmp,
1378 evas_image_load_file_data_bmp, 1377 evas_image_load_file_data_bmp,
1379 NULL, 1378 NULL,
1379 EINA_TRUE,
1380 EINA_FALSE 1380 EINA_FALSE
1381}; 1381};
1382 1382
diff --git a/src/modules/evas/loaders/eet/evas_image_load_eet.c b/src/modules/evas/loaders/eet/evas_image_load_eet.c
index ec1368cc59..bad82c69a8 100644
--- a/src/modules/evas/loaders/eet/evas_image_load_eet.c
+++ b/src/modules/evas/loaders/eet/evas_image_load_eet.c
@@ -135,12 +135,12 @@ evas_image_load_file_data_eet(void *loader_data,
135 135
136Evas_Image_Load_Func evas_image_load_eet_func = 136Evas_Image_Load_Func evas_image_load_eet_func =
137{ 137{
138 EINA_TRUE,
139 evas_image_load_file_open_eet, 138 evas_image_load_file_open_eet,
140 evas_image_load_file_close_eet, 139 evas_image_load_file_close_eet,
141 evas_image_load_file_head_eet, 140 evas_image_load_file_head_eet,
142 evas_image_load_file_data_eet, 141 evas_image_load_file_data_eet,
143 NULL, 142 NULL,
143 EINA_TRUE,
144 EINA_FALSE 144 EINA_FALSE
145}; 145};
146 146
diff --git a/src/modules/evas/loaders/generic/evas_image_load_generic.c b/src/modules/evas/loaders/generic/evas_image_load_generic.c
index d057741377..0ca7b41ae5 100644
--- a/src/modules/evas/loaders/generic/evas_image_load_generic.c
+++ b/src/modules/evas/loaders/generic/evas_image_load_generic.c
@@ -433,12 +433,12 @@ evas_image_load_file_data_generic(void *loader_data,
433 433
434Evas_Image_Load_Func evas_image_load_generic_func = 434Evas_Image_Load_Func evas_image_load_generic_func =
435{ 435{
436 EINA_TRUE,
437 evas_image_load_file_open_generic, 436 evas_image_load_file_open_generic,
438 evas_image_load_file_close_generic, 437 evas_image_load_file_close_generic,
439 evas_image_load_file_head_generic, 438 evas_image_load_file_head_generic,
440 evas_image_load_file_data_generic, 439 evas_image_load_file_data_generic,
441 NULL, 440 NULL,
441 EINA_TRUE,
442 EINA_FALSE 442 EINA_FALSE
443}; 443};
444 444
diff --git a/src/modules/evas/loaders/gif/evas_image_load_gif.c b/src/modules/evas/loaders/gif/evas_image_load_gif.c
index 0132b06a89..f3cfd9f24e 100644
--- a/src/modules/evas/loaders/gif/evas_image_load_gif.c
+++ b/src/modules/evas/loaders/gif/evas_image_load_gif.c
@@ -1113,12 +1113,12 @@ evas_image_load_frame_duration_gif(void *loader_data,
1113 1113
1114static Evas_Image_Load_Func evas_image_load_gif_func = 1114static Evas_Image_Load_Func evas_image_load_gif_func =
1115{ 1115{
1116 EINA_TRUE,
1117 evas_image_load_file_open_gif, 1116 evas_image_load_file_open_gif,
1118 evas_image_load_file_close_gif, 1117 evas_image_load_file_close_gif,
1119 evas_image_load_file_head_gif, 1118 evas_image_load_file_head_gif,
1120 evas_image_load_file_data_gif, 1119 evas_image_load_file_data_gif,
1121 evas_image_load_frame_duration_gif, 1120 evas_image_load_frame_duration_gif,
1121 EINA_TRUE,
1122 EINA_FALSE 1122 EINA_FALSE
1123}; 1123};
1124 1124
diff --git a/src/modules/evas/loaders/ico/evas_image_load_ico.c b/src/modules/evas/loaders/ico/evas_image_load_ico.c
index 121d3b6b84..993b5adcf6 100644
--- a/src/modules/evas/loaders/ico/evas_image_load_ico.c
+++ b/src/modules/evas/loaders/ico/evas_image_load_ico.c
@@ -805,12 +805,12 @@ evas_image_load_file_data_ico(void *loader_data,
805 805
806static Evas_Image_Load_Func evas_image_load_ico_func = 806static Evas_Image_Load_Func evas_image_load_ico_func =
807{ 807{
808 EINA_TRUE,
809 evas_image_load_file_open_ico, 808 evas_image_load_file_open_ico,
810 evas_image_load_file_close_ico, 809 evas_image_load_file_close_ico,
811 evas_image_load_file_head_ico, 810 evas_image_load_file_head_ico,
812 evas_image_load_file_data_ico, 811 evas_image_load_file_data_ico,
813 NULL, 812 NULL,
813 EINA_TRUE,
814 EINA_FALSE 814 EINA_FALSE
815}; 815};
816 816
diff --git a/src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c b/src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c
index 6a440842e5..4e95bf5843 100644
--- a/src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c
+++ b/src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c
@@ -1313,12 +1313,12 @@ evas_image_load_file_data_jpeg(void *loader_data,
1313 1313
1314static Evas_Image_Load_Func evas_image_load_jpeg_func = 1314static Evas_Image_Load_Func evas_image_load_jpeg_func =
1315{ 1315{
1316 EINA_TRUE,
1317 evas_image_load_file_open_jpeg, 1316 evas_image_load_file_open_jpeg,
1318 evas_image_load_file_close_jpeg, 1317 evas_image_load_file_close_jpeg,
1319 evas_image_load_file_head_jpeg, 1318 evas_image_load_file_head_jpeg,
1320 evas_image_load_file_data_jpeg, 1319 evas_image_load_file_data_jpeg,
1321 NULL, 1320 NULL,
1321 EINA_TRUE,
1322 EINA_TRUE 1322 EINA_TRUE
1323}; 1323};
1324 1324
diff --git a/src/modules/evas/loaders/pmaps/evas_image_load_pmaps.c b/src/modules/evas/loaders/pmaps/evas_image_load_pmaps.c
index 877b6ee5f7..2eb1ecd8f4 100644
--- a/src/modules/evas/loaders/pmaps/evas_image_load_pmaps.c
+++ b/src/modules/evas/loaders/pmaps/evas_image_load_pmaps.c
@@ -555,12 +555,12 @@ pmaps_buffer_plain_bw_get(Pmaps_Buffer *b, DATA32 *val)
555 555
556/* external functions */ 556/* external functions */
557Evas_Image_Load_Func evas_image_load_pmaps_func = { 557Evas_Image_Load_Func evas_image_load_pmaps_func = {
558 EINA_TRUE,
559 evas_image_load_file_open_pmaps, 558 evas_image_load_file_open_pmaps,
560 evas_image_load_file_close_pmaps, 559 evas_image_load_file_close_pmaps,
561 evas_image_load_file_head_pmaps, 560 evas_image_load_file_head_pmaps,
562 evas_image_load_file_data_pmaps, 561 evas_image_load_file_data_pmaps,
563 NULL, 562 NULL,
563 EINA_TRUE,
564 EINA_FALSE 564 EINA_FALSE
565}; 565};
566 566
diff --git a/src/modules/evas/loaders/png/evas_image_load_png.c b/src/modules/evas/loaders/png/evas_image_load_png.c
index 306a373011..08430e0a1b 100644
--- a/src/modules/evas/loaders/png/evas_image_load_png.c
+++ b/src/modules/evas/loaders/png/evas_image_load_png.c
@@ -351,12 +351,12 @@ evas_image_load_file_data_png(void *loader_data,
351 351
352static Evas_Image_Load_Func evas_image_load_png_func = 352static Evas_Image_Load_Func evas_image_load_png_func =
353{ 353{
354 EINA_TRUE,
355 evas_image_load_file_open_png, 354 evas_image_load_file_open_png,
356 evas_image_load_file_close_png, 355 evas_image_load_file_close_png,
357 evas_image_load_file_head_png, 356 evas_image_load_file_head_png,
358 evas_image_load_file_data_png, 357 evas_image_load_file_data_png,
359 NULL, 358 NULL,
359 EINA_TRUE,
360 EINA_FALSE 360 EINA_FALSE
361}; 361};
362 362
diff --git a/src/modules/evas/loaders/psd/evas_image_load_psd.c b/src/modules/evas/loaders/psd/evas_image_load_psd.c
index b064217290..ab9cc701a4 100644
--- a/src/modules/evas/loaders/psd/evas_image_load_psd.c
+++ b/src/modules/evas/loaders/psd/evas_image_load_psd.c
@@ -896,12 +896,12 @@ get_compressed_channels_length(PSD_Header *head,
896} 896}
897 897
898static const Evas_Image_Load_Func evas_image_load_psd_func = { 898static const Evas_Image_Load_Func evas_image_load_psd_func = {
899 EINA_TRUE,
900 evas_image_load_file_open_psd, 899 evas_image_load_file_open_psd,
901 evas_image_load_file_close_psd, 900 evas_image_load_file_close_psd,
902 evas_image_load_file_head_psd, 901 evas_image_load_file_head_psd,
903 evas_image_load_file_data_psd, 902 evas_image_load_file_data_psd,
904 NULL, 903 NULL,
904 EINA_TRUE,
905 EINA_FALSE 905 EINA_FALSE
906}; 906};
907 907
diff --git a/src/modules/evas/loaders/tga/evas_image_load_tga.c b/src/modules/evas/loaders/tga/evas_image_load_tga.c
index acc527d3b1..87294022f6 100644
--- a/src/modules/evas/loaders/tga/evas_image_load_tga.c
+++ b/src/modules/evas/loaders/tga/evas_image_load_tga.c
@@ -551,12 +551,12 @@ evas_image_load_file_data_tga(void *loader_data,
551 551
552static Evas_Image_Load_Func evas_image_load_tga_func = 552static Evas_Image_Load_Func evas_image_load_tga_func =
553{ 553{
554 EINA_TRUE,
555 evas_image_load_file_open_tga, 554 evas_image_load_file_open_tga,
556 evas_image_load_file_close_tga, 555 evas_image_load_file_close_tga,
557 evas_image_load_file_head_tga, 556 evas_image_load_file_head_tga,
558 evas_image_load_file_data_tga, 557 evas_image_load_file_data_tga,
559 NULL, 558 NULL,
559 EINA_TRUE,
560 EINA_FALSE 560 EINA_FALSE
561}; 561};
562 562
diff --git a/src/modules/evas/loaders/tiff/evas_image_load_tiff.c b/src/modules/evas/loaders/tiff/evas_image_load_tiff.c
index 03f253c051..29248f6a75 100644
--- a/src/modules/evas/loaders/tiff/evas_image_load_tiff.c
+++ b/src/modules/evas/loaders/tiff/evas_image_load_tiff.c
@@ -321,12 +321,12 @@ evas_image_load_file_data_tiff(void *loader_data,
321 321
322static Evas_Image_Load_Func evas_image_load_tiff_func = 322static Evas_Image_Load_Func evas_image_load_tiff_func =
323{ 323{
324 EINA_TRUE,
325 evas_image_load_file_open_tiff, 324 evas_image_load_file_open_tiff,
326 evas_image_load_file_close_tiff, 325 evas_image_load_file_close_tiff,
327 evas_image_load_file_head_tiff, 326 evas_image_load_file_head_tiff,
328 evas_image_load_file_data_tiff, 327 evas_image_load_file_data_tiff,
329 NULL, 328 NULL,
329 EINA_TRUE,
330 EINA_FALSE 330 EINA_FALSE
331}; 331};
332 332
diff --git a/src/modules/evas/loaders/wbmp/evas_image_load_wbmp.c b/src/modules/evas/loaders/wbmp/evas_image_load_wbmp.c
index 1f014a904d..a2dc24d973 100644
--- a/src/modules/evas/loaders/wbmp/evas_image_load_wbmp.c
+++ b/src/modules/evas/loaders/wbmp/evas_image_load_wbmp.c
@@ -168,12 +168,12 @@ evas_image_load_file_data_wbmp(void *loader_data,
168 168
169static Evas_Image_Load_Func evas_image_load_wbmp_func = 169static Evas_Image_Load_Func evas_image_load_wbmp_func =
170{ 170{
171 EINA_TRUE,
172 evas_image_load_file_open_wbmp, 171 evas_image_load_file_open_wbmp,
173 evas_image_load_file_close_wbmp, 172 evas_image_load_file_close_wbmp,
174 evas_image_load_file_head_wbmp, 173 evas_image_load_file_head_wbmp,
175 evas_image_load_file_data_wbmp, 174 evas_image_load_file_data_wbmp,
176 NULL, 175 NULL,
176 EINA_TRUE,
177 EINA_FALSE 177 EINA_FALSE
178}; 178};
179 179
diff --git a/src/modules/evas/loaders/webp/evas_image_load_webp.c b/src/modules/evas/loaders/webp/evas_image_load_webp.c
index 28a28a3b59..e6d66f8c74 100644
--- a/src/modules/evas/loaders/webp/evas_image_load_webp.c
+++ b/src/modules/evas/loaders/webp/evas_image_load_webp.c
@@ -116,12 +116,12 @@ evas_image_load_file_data_webp(void *loader_data,
116 116
117static Evas_Image_Load_Func evas_image_load_webp_func = 117static Evas_Image_Load_Func evas_image_load_webp_func =
118{ 118{
119 EINA_TRUE,
120 evas_image_load_file_open_webp, 119 evas_image_load_file_open_webp,
121 evas_image_load_file_close_webp, 120 evas_image_load_file_close_webp,
122 evas_image_load_file_head_webp, 121 evas_image_load_file_head_webp,
123 evas_image_load_file_data_webp, 122 evas_image_load_file_data_webp,
124 NULL, 123 NULL,
124 EINA_TRUE,
125 EINA_FALSE 125 EINA_FALSE
126}; 126};
127 127
diff --git a/src/modules/evas/loaders/xpm/evas_image_load_xpm.c b/src/modules/evas/loaders/xpm/evas_image_load_xpm.c
index 6a6be30ef8..cc94709aad 100644
--- a/src/modules/evas/loaders/xpm/evas_image_load_xpm.c
+++ b/src/modules/evas/loaders/xpm/evas_image_load_xpm.c
@@ -685,12 +685,12 @@ evas_image_load_file_data_xpm(void *loader_data,
685 685
686static Evas_Image_Load_Func evas_image_load_xpm_func = 686static Evas_Image_Load_Func evas_image_load_xpm_func =
687{ 687{
688 EINA_FALSE,
689 evas_image_load_file_open_xpm, 688 evas_image_load_file_open_xpm,
690 evas_image_load_file_close_xpm, 689 evas_image_load_file_close_xpm,
691 evas_image_load_file_head_xpm, 690 evas_image_load_file_head_xpm,
692 evas_image_load_file_data_xpm, 691 evas_image_load_file_data_xpm,
693 NULL, 692 NULL,
693 EINA_FALSE,
694 EINA_FALSE 694 EINA_FALSE
695}; 695};
696 696