summaryrefslogtreecommitdiff
path: root/src/lib/evas/include/evas_filter.h
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-01-07 16:44:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-07 17:33:17 +0900
commitd9fb0cdc34dd13dade8378842988863c1156cf1f (patch)
treebcb0bed12d87c2409ad0a5a7964d5c477b9362aa /src/lib/evas/include/evas_filter.h
parent388a30950a64352be96f0d99c8c849a0f307d4b8 (diff)
Evas filters: Add transform filter
This is the simplest solution I can come up with for "mirror" effects. Displacement maps are HARD to generate and use properly, since the buffer size is unknown until runtime. Even if we align the map to the text itself (using the padding information), it's still hard to describe properly how to apply the displacement map, and to generate it... So let's just add a simple flip operation.
Diffstat (limited to 'src/lib/evas/include/evas_filter.h')
-rw-r--r--src/lib/evas/include/evas_filter.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/evas/include/evas_filter.h b/src/lib/evas/include/evas_filter.h
index 7496673789..1d1a171399 100644
--- a/src/lib/evas/include/evas_filter.h
+++ b/src/lib/evas/include/evas_filter.h
@@ -14,6 +14,7 @@ typedef enum _Evas_Filter_Channel Evas_Filter_Channel;
14typedef enum _Evas_Filter_Displacement_Flags Evas_Filter_Displacement_Flags; 14typedef enum _Evas_Filter_Displacement_Flags Evas_Filter_Displacement_Flags;
15typedef enum _Evas_Filter_Bump_Flags Evas_Filter_Bump_Flags; 15typedef enum _Evas_Filter_Bump_Flags Evas_Filter_Bump_Flags;
16typedef enum _Evas_Filter_Fill_Mode Evas_Filter_Fill_Mode; 16typedef enum _Evas_Filter_Fill_Mode Evas_Filter_Fill_Mode;
17typedef enum _Evas_Filter_Transform_Flags Evas_Filter_Transform_Flags;
17 18
18typedef Eina_Bool (* Evas_Filter_Apply_Func) (Evas_Filter_Command *cmd); 19typedef Eina_Bool (* Evas_Filter_Apply_Func) (Evas_Filter_Command *cmd);
19typedef void (* Evas_Filter_Cb) (Evas_Filter_Context *ctx, void *data); 20typedef void (* Evas_Filter_Cb) (Evas_Filter_Context *ctx, void *data);
@@ -30,6 +31,7 @@ enum _Evas_Filter_Mode
30 EVAS_FILTER_MODE_FILL, /**< Fill a buffer with a solid color */ 31 EVAS_FILTER_MODE_FILL, /**< Fill a buffer with a solid color */
31 EVAS_FILTER_MODE_MASK, /**< Apply Alpha or RGBA texture on image */ 32 EVAS_FILTER_MODE_MASK, /**< Apply Alpha or RGBA texture on image */
32 EVAS_FILTER_MODE_BUMP, /**< Apply bump mapping (light effect) */ 33 EVAS_FILTER_MODE_BUMP, /**< Apply bump mapping (light effect) */
34 EVAS_FILTER_MODE_TRANSFORM, /**< Apply a simple geometrical transformation */
33 EVAS_FILTER_MODE_LAST 35 EVAS_FILTER_MODE_LAST
34}; 36};
35 37
@@ -79,6 +81,11 @@ enum _Evas_Filter_Fill_Mode
79 EVAS_FILTER_FILL_MODE_STRETCH_XY = EVAS_FILTER_FILL_MODE_STRETCH_X | EVAS_FILTER_FILL_MODE_STRETCH_Y 81 EVAS_FILTER_FILL_MODE_STRETCH_XY = EVAS_FILTER_FILL_MODE_STRETCH_X | EVAS_FILTER_FILL_MODE_STRETCH_Y
80}; 82};
81 83
84enum _Evas_Filter_Transform_Flags
85{
86 EVAS_FILTER_TRANSFORM_VFLIP = 1
87};
88
82/* Parser stuff (high level API) */ 89/* Parser stuff (high level API) */
83Evas_Filter_Program *evas_filter_program_new(const char *name); 90Evas_Filter_Program *evas_filter_program_new(const char *name);
84Eina_Bool evas_filter_program_parse(Evas_Filter_Program *pgm, const char *str); 91Eina_Bool evas_filter_program_parse(Evas_Filter_Program *pgm, const char *str);
@@ -213,5 +220,16 @@ int evas_filter_command_mask_add(Evas_Filter_Context *ctx,
213 */ 220 */
214int evas_filter_command_bump_map_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int bumpbuf, int outbuf, float azimuth, float elevation, float depth, float specular_factor, DATA32 black, DATA32 color, DATA32 white, Evas_Filter_Bump_Flags flags, Evas_Filter_Fill_Mode fillmode); 221int evas_filter_command_bump_map_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int bumpbuf, int outbuf, float azimuth, float elevation, float depth, float specular_factor, DATA32 black, DATA32 color, DATA32 white, Evas_Filter_Bump_Flags flags, Evas_Filter_Fill_Mode fillmode);
215 222
223/**
224 * @brief Apply a geometrical transformation to the buffer
225 * @param ctx Current filter chain
226 * @param draw_context Current Evas draw context (ignored)
227 * @param inbuf Input buffer (Alpha or RGBA)
228 * @param outbuf Output buffer (Alpha or RGBA), same size as inbuf
229 * @param flags Specifies the operation to apply (eg. vflip)
230 * @return Filter command ID or -1 in case of error
231 */
232int evas_filter_command_transform_add(Evas_Filter_Context *ctx, void *draw_context, int inbuf, int outbuf, Evas_Filter_Transform_Flags flags);
233
216#endif 234#endif
217 235