aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/lib/canvas/evas_object_image.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/lib/canvas/evas_object_image.c')
-rw-r--r--libraries/evas/src/lib/canvas/evas_object_image.c46
1 files changed, 39 insertions, 7 deletions
diff --git a/libraries/evas/src/lib/canvas/evas_object_image.c b/libraries/evas/src/lib/canvas/evas_object_image.c
index 7f757a6..d9f6378 100644
--- a/libraries/evas/src/lib/canvas/evas_object_image.c
+++ b/libraries/evas/src/lib/canvas/evas_object_image.c
@@ -1,7 +1,13 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h" /* so that EAPI in Evas.h is correctly defined */
3#endif
4
1#include <sys/types.h> 5#include <sys/types.h>
2#include <unistd.h> 6#include <unistd.h>
3#include <stdlib.h> 7#include <stdlib.h>
4#include <sys/mman.h> 8#ifdef HAVE_SYS_MMAN_H
9# include <sys/mman.h>
10#endif
5#include <math.h> 11#include <math.h>
6 12
7#include "evas_common.h" 13#include "evas_common.h"
@@ -192,8 +198,9 @@ evas_object_image_filled_add(Evas *e)
192static void 198static void
193_cleanup_tmpf(Evas_Object *obj) 199_cleanup_tmpf(Evas_Object *obj)
194{ 200{
201#ifdef HAVE_SYS_MMAN_H
195 Evas_Object_Image *o; 202 Evas_Object_Image *o;
196 203
197 o = (Evas_Object_Image *)(obj->object_data); 204 o = (Evas_Object_Image *)(obj->object_data);
198 if (!o->tmpf) return; 205 if (!o->tmpf) return;
199#ifdef __linux__ 206#ifdef __linux__
@@ -204,11 +211,15 @@ _cleanup_tmpf(Evas_Object *obj)
204 eina_stringshare_del(o->tmpf); 211 eina_stringshare_del(o->tmpf);
205 o->tmpf_fd = -1; 212 o->tmpf_fd = -1;
206 o->tmpf = NULL; 213 o->tmpf = NULL;
214#else
215 (void) obj;
216#endif
207} 217}
208 218
209static void 219static void
210_create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__) 220_create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__)
211{ 221{
222#ifdef HAVE_SYS_MMAN_H
212 Evas_Object_Image *o; 223 Evas_Object_Image *o;
213 char buf[4096]; 224 char buf[4096];
214 void *dst; 225 void *dst;
@@ -253,6 +264,12 @@ _create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__)
253 o->tmpf = eina_stringshare_add(buf); 264 o->tmpf = eina_stringshare_add(buf);
254 memcpy(dst, data, size); 265 memcpy(dst, data, size);
255 munmap(dst, size); 266 munmap(dst, size);
267#else
268 (void) obj;
269 (void) data;
270 (void) size;
271 (void) format;
272#endif
256} 273}
257 274
258EAPI void 275EAPI void
@@ -1917,6 +1934,24 @@ evas_object_image_content_hint_get(const Evas_Object *obj)
1917 return o->content_hint; 1934 return o->content_hint;
1918} 1935}
1919 1936
1937EAPI Eina_Bool
1938evas_object_image_region_support_get(const Evas_Object *obj)
1939{
1940 Evas_Object_Image *o;
1941
1942 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
1943 return EINA_FALSE;
1944 MAGIC_CHECK_END();
1945 o = (Evas_Object_Image *) (obj->object_data);
1946 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
1947 return EINA_FALSE;
1948 MAGIC_CHECK_END();
1949
1950 return obj->layer->evas->engine.func->image_can_region_get(
1951 obj->layer->evas->engine.data.output,
1952 o->engine_data);
1953}
1954
1920/* animated feature */ 1955/* animated feature */
1921EAPI Eina_Bool 1956EAPI Eina_Bool
1922evas_object_image_animated_get(const Evas_Object *obj) 1957evas_object_image_animated_get(const Evas_Object *obj)
@@ -3770,8 +3805,7 @@ evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_C
3770 to_cspace); 3805 to_cspace);
3771 break; 3806 break;
3772 case EVAS_COLORSPACE_YCBCR422601_PL: 3807 case EVAS_COLORSPACE_YCBCR422601_PL:
3773 fprintf(stderr, "EVAS_COLORSPACE_YCBCR422601_PL:\n"); 3808 out = evas_common_convert_yuv_422_601_to(data,
3774 out = evas_common_convert_yuv_422_601_to(data,
3775 o->cur.image.w, 3809 o->cur.image.w,
3776 o->cur.image.h, 3810 o->cur.image.h,
3777 to_cspace); 3811 to_cspace);
@@ -3795,7 +3829,7 @@ evas_object_image_data_convert_internal(Evas_Object_Image *o, void *data, Evas_C
3795 to_cspace); 3829 to_cspace);
3796 break; 3830 break;
3797 default: 3831 default:
3798 fprintf(stderr, "unknow colorspace: %i\n", o->cur.cspace); 3832 WRN("unknow colorspace: %i\n", o->cur.cspace);
3799 break; 3833 break;
3800 } 3834 }
3801 3835
@@ -3806,9 +3840,7 @@ static void
3806evas_object_image_filled_resize_listener(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *einfo __UNUSED__) 3840evas_object_image_filled_resize_listener(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *einfo __UNUSED__)
3807{ 3841{
3808 Evas_Coord w, h; 3842 Evas_Coord w, h;
3809 Evas_Object_Image *o;
3810 3843
3811 o = obj->object_data;
3812 evas_object_geometry_get(obj, NULL, NULL, &w, &h); 3844 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
3813 evas_object_image_fill_set(obj, 0, 0, w, h); 3845 evas_object_image_fill_set(obj, 0, 0, w, h);
3814} 3846}