Add font effect tests (alpha blur, rgba blur)
Patch by eunue (Jaeun Choi): D658
This commit is contained in:
parent
d68739908f
commit
c3890ffeb1
|
@ -114,7 +114,9 @@ proxy_image.c \
|
||||||
proxy_text_fixed.c \
|
proxy_text_fixed.c \
|
||||||
proxy_text_random.c \
|
proxy_text_random.c \
|
||||||
line_blend.c \
|
line_blend.c \
|
||||||
image_blend_many_smooth_same_scaled.c
|
image_blend_many_smooth_same_scaled.c \
|
||||||
|
font_effect_blur_alpha.c \
|
||||||
|
font_effect_blur_color.c
|
||||||
# \
|
# \
|
||||||
# image_mask.c \
|
# image_mask.c \
|
||||||
# image_mask_2.c \
|
# image_mask_2.c \
|
||||||
|
|
|
@ -0,0 +1,105 @@
|
||||||
|
#undef FNAME
|
||||||
|
#undef NAME
|
||||||
|
#undef ICON
|
||||||
|
|
||||||
|
/* metadata */
|
||||||
|
#define FNAME font_effect_blur_alpha_start
|
||||||
|
#define NAME "Font Effect Blur (Alpha)"
|
||||||
|
#define ICON "text.png"
|
||||||
|
|
||||||
|
#ifndef PROTO
|
||||||
|
# ifndef UI
|
||||||
|
# include "main.h"
|
||||||
|
|
||||||
|
#include "ui.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* standard var */
|
||||||
|
static int done = 0;
|
||||||
|
/* private data */
|
||||||
|
static Evas_Object *bg;
|
||||||
|
static Evas_Object *text;
|
||||||
|
|
||||||
|
extern int win_w, win_h;
|
||||||
|
|
||||||
|
|
||||||
|
/* setup */
|
||||||
|
static void _setup(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
Evas_Object *o;
|
||||||
|
o = evas_object_rectangle_add(evas);
|
||||||
|
evas_object_color_set(o, 0, 0, 0, 255);
|
||||||
|
evas_object_resize(o, win_w, win_h);
|
||||||
|
evas_object_show(o);
|
||||||
|
bg = o;
|
||||||
|
|
||||||
|
o = evas_object_text_add(evas);
|
||||||
|
evas_object_color_set(o, 0, 0, 0, 255);
|
||||||
|
evas_object_text_font_set(o, "Vera-Bold", 80);
|
||||||
|
evas_object_text_text_set(o, "Font Effect");
|
||||||
|
evas_object_show(o);
|
||||||
|
text = o;
|
||||||
|
|
||||||
|
done = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* cleanup */
|
||||||
|
static void _cleanup(void)
|
||||||
|
{
|
||||||
|
evas_object_del(bg);
|
||||||
|
evas_object_del(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* loop - do things */
|
||||||
|
static void _loop(double t, int f)
|
||||||
|
{
|
||||||
|
char buf[128];
|
||||||
|
char *str = "blur(%d);";
|
||||||
|
sprintf(buf, str, ((f % 50) + 1));
|
||||||
|
evas_object_text_filter_program_set(text, buf);
|
||||||
|
|
||||||
|
FPS_STD(NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* prepend special key handlers if interactive (before STD) */
|
||||||
|
static void _key(char *key)
|
||||||
|
{
|
||||||
|
KEY_STD;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* template stuff - ignore */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef UI
|
||||||
|
_ui_menu_item_add(ICON, NAME, FNAME);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PROTO
|
||||||
|
void FNAME(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PROTO
|
||||||
|
# ifndef UI
|
||||||
|
void FNAME(void)
|
||||||
|
{
|
||||||
|
ui_func_set(_key, _loop);
|
||||||
|
_setup();
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#undef FNAME
|
||||||
|
#undef NAME
|
||||||
|
#undef ICON
|
|
@ -0,0 +1,95 @@
|
||||||
|
#undef FNAME
|
||||||
|
#undef NAME
|
||||||
|
#undef ICON
|
||||||
|
|
||||||
|
/* metadata */
|
||||||
|
#define FNAME font_effect_blur_color_start
|
||||||
|
#define NAME "Font Effect Blur (Color)"
|
||||||
|
#define ICON "text.png"
|
||||||
|
|
||||||
|
#ifndef PROTO
|
||||||
|
# ifndef UI
|
||||||
|
# include "main.h"
|
||||||
|
|
||||||
|
#include "ui.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* standard var */
|
||||||
|
static int done = 0;
|
||||||
|
/* private data */
|
||||||
|
static Evas_Object *text;
|
||||||
|
|
||||||
|
|
||||||
|
/* setup */
|
||||||
|
static void _setup(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
Evas_Object *o;
|
||||||
|
o = evas_object_text_add(evas);
|
||||||
|
evas_object_color_set(o, 0, 0, 0, 255);
|
||||||
|
evas_object_text_font_set(o, "Vera-Bold", 80);
|
||||||
|
evas_object_text_text_set(o, "Font Effect");
|
||||||
|
evas_object_show(o);
|
||||||
|
text = o;
|
||||||
|
|
||||||
|
done = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* cleanup */
|
||||||
|
static void _cleanup(void)
|
||||||
|
{
|
||||||
|
evas_object_del(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* loop - do things */
|
||||||
|
static void _loop(double t, int f)
|
||||||
|
{
|
||||||
|
char buf[128];
|
||||||
|
char *str = "buffer:a(rgba);blend(dst=a, color=blue);blur(%d, src=a);";
|
||||||
|
sprintf(buf, str, ((f % 50) + 1));
|
||||||
|
evas_object_text_filter_program_set(text, buf);
|
||||||
|
|
||||||
|
FPS_STD(NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* prepend special key handlers if interactive (before STD) */
|
||||||
|
static void _key(char *key)
|
||||||
|
{
|
||||||
|
KEY_STD;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* template stuff - ignore */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef UI
|
||||||
|
_ui_menu_item_add(ICON, NAME, FNAME);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PROTO
|
||||||
|
void FNAME(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PROTO
|
||||||
|
# ifndef UI
|
||||||
|
void FNAME(void)
|
||||||
|
{
|
||||||
|
ui_func_set(_key, _loop);
|
||||||
|
_setup();
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#undef FNAME
|
||||||
|
#undef NAME
|
||||||
|
#undef ICON
|
|
@ -91,6 +91,8 @@
|
||||||
#include "proxy_text_random.c"
|
#include "proxy_text_random.c"
|
||||||
#include "line_blend.c"
|
#include "line_blend.c"
|
||||||
#include "image_blend_many_smooth_same_scaled.c"
|
#include "image_blend_many_smooth_same_scaled.c"
|
||||||
|
#include "font_effect_blur_alpha.c"
|
||||||
|
#include "font_effect_blur_color.c"
|
||||||
#if 0 // test disabled - evas having code disabled
|
#if 0 // test disabled - evas having code disabled
|
||||||
#include "image_mask.c"
|
#include "image_mask.c"
|
||||||
#include "image_mask_2.c"
|
#include "image_mask_2.c"
|
||||||
|
|
Loading…
Reference in New Issue