diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/modules/savers/eet/evas_image_save_eet.c | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/libraries/evas/src/modules/savers/eet/evas_image_save_eet.c b/libraries/evas/src/modules/savers/eet/evas_image_save_eet.c deleted file mode 100644 index 4eb7176..0000000 --- a/libraries/evas/src/modules/savers/eet/evas_image_save_eet.c +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" /* so that EAPI in Eet.h is correctly defined */ | ||
3 | #endif | ||
4 | |||
5 | #include <Eet.h> | ||
6 | |||
7 | #include "evas_common.h" | ||
8 | #include "evas_private.h" | ||
9 | |||
10 | static int evas_image_save_file_eet(RGBA_Image *im, const char *file, const char *key, int quality, int compress); | ||
11 | |||
12 | static Evas_Image_Save_Func evas_image_save_eet_func = | ||
13 | { | ||
14 | evas_image_save_file_eet | ||
15 | }; | ||
16 | |||
17 | static int | ||
18 | evas_image_save_file_eet(RGBA_Image *im, const char *file, const char *key, int quality, int compress) | ||
19 | { | ||
20 | Eet_File *ef; | ||
21 | int alpha = 0, lossy = 0, ok = 0; | ||
22 | DATA32 *data; | ||
23 | |||
24 | if (!im || !im->image.data || !file) | ||
25 | return 0; | ||
26 | |||
27 | ef = eet_open((char *)file, EET_FILE_MODE_READ_WRITE); | ||
28 | if (!ef) ef = eet_open((char *)file, EET_FILE_MODE_WRITE); | ||
29 | if (!ef) return 0; | ||
30 | if ((quality <= 100) || (compress < 0)) lossy = 1; | ||
31 | if (im->cache_entry.flags.alpha) alpha = 1; | ||
32 | // if (alpha) | ||
33 | // { | ||
34 | // data = malloc(im->image->w * im->image->h * sizeof(DATA32)); | ||
35 | // if (!data) | ||
36 | // { | ||
37 | // eet_close(ef); | ||
38 | // return 0; | ||
39 | // } | ||
40 | // memcpy(data, im->image->data, im->image->w * im->image->h * sizeof(DATA32)); | ||
41 | // evas_common_convert_argb_unpremul(data, im->image->w * im->image->h); | ||
42 | // } | ||
43 | // else | ||
44 | data = im->image.data; | ||
45 | ok = eet_data_image_write(ef, (char *)key, data, | ||
46 | im->cache_entry.w, im->cache_entry.h, alpha, compress, | ||
47 | quality, lossy); | ||
48 | // if (alpha) | ||
49 | // free(data); | ||
50 | eet_close(ef); | ||
51 | return ok; | ||
52 | } | ||
53 | |||
54 | static int | ||
55 | module_open(Evas_Module *em) | ||
56 | { | ||
57 | if (!em) return 0; | ||
58 | em->functions = (void *)(&evas_image_save_eet_func); | ||
59 | return 1; | ||
60 | } | ||
61 | |||
62 | static void | ||
63 | module_close(Evas_Module *em __UNUSED__) | ||
64 | { | ||
65 | } | ||
66 | |||
67 | static Evas_Module_Api evas_modapi = | ||
68 | { | ||
69 | EVAS_MODULE_API_VERSION, | ||
70 | "eet", | ||
71 | "none", | ||
72 | { | ||
73 | module_open, | ||
74 | module_close | ||
75 | } | ||
76 | }; | ||
77 | |||
78 | EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_IMAGE_SAVER, image_saver, eet); | ||
79 | |||
80 | #ifndef EVAS_STATIC_BUILD_EET | ||
81 | EVAS_EINA_MODULE_DEFINE(image_saver, eet); | ||
82 | #endif | ||
83 | |||