summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_image_private.h
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-03-14 19:10:54 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-03-15 11:11:59 +0900
commit68beccd1a957724aa03f788a96128ac25cef85be (patch)
tree6a332d5750a77183d0e5a5b933547e3baaf3c164 /src/lib/evas/canvas/evas_image_private.h
parent0fc0db0020fd9dc8bc155f8e46ad79cecb84cc2f (diff)
Evas.Image: Add new classes Snapshot and Proxy
Efl.Canvas.Snapshot and Efl.Canvas.Proxy are specialized classes previously implemented as features of Evas.Image. Note: this half of the work, as I suffered from a bad merge and rebase with my work branch on top of master.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_image_private.h145
1 files changed, 145 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
new file mode 100644
index 0000000000..dfbfc09537
--- /dev/null
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -0,0 +1,145 @@
1#ifndef EVAS_IMAGE_PRIVATE_H
2#define EVAS_IMAGE_PRIVATE_H
3
4/* Those functions are shared between legacy evas_object_image.c and the
5 * new efl_canvas classes (image, snapshot, proxy, ...)
6 */
7
8#define EVAS_FILTER_PROTECTED
9#define EVAS_OBJECT_PROTECTED
10
11#include "evas_common_private.h"
12
13#include <sys/types.h>
14#include <unistd.h>
15#ifdef HAVE_SYS_MMAN_H
16# include <sys/mman.h>
17#endif
18#include <math.h>
19
20#include "evas_private.h"
21#ifdef EVAS_CSERVE2
22#include "../cserve2/evas_cs2_private.h"
23#endif
24#include "../common/evas_convert_color.h"
25#include "../common/evas_convert_colorspace.h"
26#include "../common/evas_convert_yuv.h"
27
28#include "evas_filter.eo.h"
29#include "evas_filter.h"
30
31/* private struct for rectangle object internal data */
32typedef struct _Evas_Image_Data Evas_Image_Data;
33typedef struct _Evas_Object_Image_Load_Opts Evas_Object_Image_Load_Opts;
34typedef struct _Evas_Object_Image_Pixels Evas_Object_Image_Pixels;
35typedef struct _Evas_Object_Image_State Evas_Object_Image_State;
36
37struct _Evas_Object_Image_Load_Opts
38{
39 unsigned char scale_down_by;
40 double dpi;
41 short w, h;
42 struct {
43 short x, y, w, h;
44 } region;
45 struct {
46 int src_x, src_y, src_w, src_h;
47 int dst_w, dst_h;
48 int smooth;
49 int scale_hint;
50 } scale_load;
51 Eina_Bool orientation : 1;
52};
53
54struct _Evas_Object_Image_Pixels
55{
56 Eina_List *pixel_updates;
57 struct {
58 /* FIXME: no good match for eo */
59 Evas_Object_Image_Pixels_Get_Cb get_pixels;
60 void *get_pixels_data;
61 } func;
62
63 Evas_Video_Surface video;
64 unsigned int video_caps;
65};
66
67struct _Evas_Object_Image_State
68{
69 Evas_Coord_Rectangle fill;
70 struct {
71 short w, h, stride;
72 } image;
73 struct {
74 double scale;
75 short l, r, t, b;
76 unsigned char fill;
77 } border;
78
79 Evas_Object *source;
80 Evas_Map *defmap;
81 Evas_Canvas3D_Scene *scene;
82
83 union {
84 const char *file;
85 Eina_File *f;
86 } u;
87 const char *key;
88 int frame;
89
90 Evas_Colorspace cspace;
91 Evas_Image_Orient orient;
92
93 Eina_Bool smooth_scale : 1;
94 Eina_Bool has_alpha :1;
95 Eina_Bool opaque_valid : 1;
96 Eina_Bool opaque : 1;
97 Eina_Bool mmaped_source : 1;
98};
99
100struct _Evas_Image_Data
101{
102 const Evas_Object_Image_State *cur;
103 const Evas_Object_Image_State *prev;
104 const Evas_Object_Image_Load_Opts *load_opts;
105 const Evas_Object_Image_Pixels *pixels;
106
107 void *engine_data;
108
109 int pixels_checked_out;
110 int load_error;
111
112 Evas_Image_Scale_Hint scale_hint;
113 Evas_Image_Content_Hint content_hint;
114
115 Eina_Bool changed : 1;
116 Eina_Bool dirty_pixels : 1;
117 Eina_Bool filled : 1;
118 Eina_Bool filled_set : 1;
119 Eina_Bool proxyrendering : 1;
120 Eina_Bool preloading : 1;
121 Eina_Bool video_surface : 1;
122 Eina_Bool video_visible : 1;
123 Eina_Bool created : 1;
124 Eina_Bool proxyerror : 1;
125 Eina_Bool proxy_src_clip : 1;
126 Eina_Bool written : 1;
127 Eina_Bool direct_render : 1;
128 Eina_Bool has_filter : 1;
129 struct
130 {
131 Eina_Bool video_move : 1;
132 Eina_Bool video_resize : 1;
133 Eina_Bool video_show : 1;
134 Eina_Bool video_hide : 1;
135 } delayed;
136 Eina_Bool legacy_type : 1;
137};
138
139/* shared functions between legacy and new eo classes */
140void _evas_object_image_cleanup(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o);
141void _proxy_unset(Evas_Object *proxy, Evas_Object_Protected_Data *obj, Evas_Image_Data *o);
142void _proxy_set(Evas_Object *proxy, Evas_Object *src);
143void _proxy_error(Evas_Object *proxy, void *context, void *output, void *surface, int x, int y, Eina_Bool do_async);
144
145#endif // EVAS_IMAGE_PRIVATE_H