diff options
author | Savio Sena <savio@expertisesolutions.com.br> | 2014-08-28 18:54:18 -0300 |
---|---|---|
committer | Savio Sena <savio@expertisesolutions.com.br> | 2014-09-16 19:35:19 -0300 |
commit | 7975d438568e1505e2625f2dcfcc1ef92beff8a0 (patch) | |
tree | 78496268442109de25f06e335bb1b7e0d1b0e74d | |
parent | 2edb6402d654e4fd5f87e1d8ccecae30476e41a2 (diff) |
Added more image/C++ tests.
-rw-r--r-- | src/bin/Makefile.am | 10 | ||||
-rw-r--r-- | src/bin/cxx/image_blend_solid_border.cc | 106 | ||||
-rw-r--r-- | src/bin/cxx/image_blend_solid_border_capi.h | 34 | ||||
-rw-r--r-- | src/bin/cxx/image_blend_solid_fade_pow2_unscaled.cc | 108 | ||||
-rw-r--r-- | src/bin/cxx/image_blend_solid_fade_pow2_unscaled_capi.h | 33 | ||||
-rw-r--r-- | src/bin/cxx/image_blend_solid_fade_unscaled.cc | 107 | ||||
-rw-r--r-- | src/bin/cxx/image_blend_solid_fade_unscaled_capi.h | 32 | ||||
-rw-r--r-- | src/bin/tests.h | 4 |
8 files changed, 433 insertions, 1 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 1ce1509..c7c6ee4 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am | |||
@@ -40,10 +40,16 @@ cxx/image_blend_fade_unscaled.cc \ | |||
40 | cxx/image_blend_fade_unscaled_capi.h \ | 40 | cxx/image_blend_fade_unscaled_capi.h \ |
41 | image_blend_fade_pow2_unscaled.c \ | 41 | image_blend_fade_pow2_unscaled.c \ |
42 | cxx/image_blend_fade_pow2_unscaled.cc \ | 42 | cxx/image_blend_fade_pow2_unscaled.cc \ |
43 | ocxx/image_blend_fade_pow2_unscaled_capi.h \ | 43 | cxx/image_blend_fade_pow2_unscaled_capi.h \ |
44 | image_blend_solid_unscaled.c \ | 44 | image_blend_solid_unscaled.c \ |
45 | cxx/image_blend_solid_unscaled.cc \ | ||
46 | cxx/image_blend_solid_unscaled_capi.h \ | ||
45 | image_blend_solid_fade_unscaled.c \ | 47 | image_blend_solid_fade_unscaled.c \ |
48 | cxx/image_blend_solid_fade_unscaled.cc \ | ||
49 | cxx/image_blend_solid_fade_unscaled_capi.h \ | ||
46 | image_blend_solid_fade_pow2_unscaled.c \ | 50 | image_blend_solid_fade_pow2_unscaled.c \ |
51 | cxx/image_blend_solid_fade_pow2_unscaled.cc \ | ||
52 | cxx/image_blend_solid_fade_pow2_unscaled_capi.h \ | ||
47 | image_blend_nearest_scaled.c \ | 53 | image_blend_nearest_scaled.c \ |
48 | image_blend_nearest_solid_scaled.c \ | 54 | image_blend_nearest_solid_scaled.c \ |
49 | image_blend_smooth_scaled.c \ | 55 | image_blend_smooth_scaled.c \ |
@@ -60,6 +66,8 @@ cxx/image_blend_border_recolor.cc \ | |||
60 | cxx/image_blend_border_recolor_capi.h \ | 66 | cxx/image_blend_border_recolor_capi.h \ |
61 | image_blend_solid_middle_border.c \ | 67 | image_blend_solid_middle_border.c \ |
62 | image_blend_solid_border.c \ | 68 | image_blend_solid_border.c \ |
69 | cxx/image_blend_solid_border.cc \ | ||
70 | cxx/image_blend_solid_border_acpi.h \ | ||
63 | image_map_rotate.c \ | 71 | image_map_rotate.c \ |
64 | image_map_solid_rotate.c \ | 72 | image_map_solid_rotate.c \ |
65 | image_map_nearest_rotate.c \ | 73 | image_map_nearest_rotate.c \ |
diff --git a/src/bin/cxx/image_blend_solid_border.cc b/src/bin/cxx/image_blend_solid_border.cc new file mode 100644 index 0000000..6b1f77e --- /dev/null +++ b/src/bin/cxx/image_blend_solid_border.cc | |||
@@ -0,0 +1,106 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | |||
5 | /* metadata */ | ||
6 | #define FNAME image_blend_solid_border_start | ||
7 | #define NAME "Image Blend Solid Border" | ||
8 | #define ICON "blend.png" | ||
9 | |||
10 | #ifndef PROTO | ||
11 | # ifndef UI | ||
12 | # include "main.h" | ||
13 | |||
14 | /* standard var */ | ||
15 | static int done = 0; | ||
16 | /* private data */ | ||
17 | static Evas_Object *o_images[OBNUM]; | ||
18 | |||
19 | /* setup */ | ||
20 | static void _setup(void) | ||
21 | { | ||
22 | int i; | ||
23 | Evas_Object *o; | ||
24 | for (i = 0; i < OBNUM; i++) | ||
25 | { | ||
26 | o = eo_add(EVAS_IMAGE_CLASS, G_evas); | ||
27 | o_images[i] = o; | ||
28 | eo_do(o, | ||
29 | efl_file_set(build_path("frame.png"), NULL), | ||
30 | evas_obj_image_border_set(8, 8, 8, 8), | ||
31 | evas_obj_visibility_set(EINA_TRUE)); | ||
32 | } | ||
33 | done = 0; | ||
34 | } | ||
35 | |||
36 | /* cleanup */ | ||
37 | static void _cleanup(void) | ||
38 | { | ||
39 | int i; | ||
40 | for (i = 0; i < OBNUM; i++) eo_del(o_images[i]); | ||
41 | } | ||
42 | |||
43 | /* loop - do things */ | ||
44 | static void _loop(double t, int f) | ||
45 | { | ||
46 | int i; | ||
47 | Evas_Coord x, y, w, h, w0, h0; | ||
48 | for (i = 0; i < OBNUM; i++) | ||
49 | { | ||
50 | w0 = 80; | ||
51 | h0 = 80; | ||
52 | w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW))) * w0 * 2); | ||
53 | h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW))) * h0 * 2); | ||
54 | x = (win_w / 2) - (w / 2); | ||
55 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); | ||
56 | y = (win_h / 2) - (h / 2); | ||
57 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); | ||
58 | eo_do(o_images[i], | ||
59 | evas_obj_position_set(x, y), | ||
60 | evas_obj_size_set(w, h), | ||
61 | evas_obj_image_fill_set(0, 0, w, h)); | ||
62 | } | ||
63 | FPS_STD(NAME); | ||
64 | } | ||
65 | |||
66 | /* prepend special key handlers if interactive (before STD) */ | ||
67 | static void _key(char *key) | ||
68 | { | ||
69 | KEY_STD; | ||
70 | } | ||
71 | |||
72 | |||
73 | |||
74 | |||
75 | |||
76 | |||
77 | |||
78 | |||
79 | |||
80 | |||
81 | |||
82 | |||
83 | /* template stuff - ignore */ | ||
84 | # endif | ||
85 | #endif | ||
86 | |||
87 | #ifdef UI | ||
88 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
89 | #endif | ||
90 | |||
91 | #ifdef PROTO | ||
92 | void FNAME(void); | ||
93 | #endif | ||
94 | |||
95 | #ifndef PROTO | ||
96 | # ifndef UI | ||
97 | void FNAME(void) | ||
98 | { | ||
99 | ui_func_set(_key, _loop); | ||
100 | _setup(); | ||
101 | } | ||
102 | # endif | ||
103 | #endif | ||
104 | #undef FNAME | ||
105 | #undef NAME | ||
106 | #undef ICON | ||
diff --git a/src/bin/cxx/image_blend_solid_border_capi.h b/src/bin/cxx/image_blend_solid_border_capi.h new file mode 100644 index 0000000..e8cae8c --- /dev/null +++ b/src/bin/cxx/image_blend_solid_border_capi.h | |||
@@ -0,0 +1,34 @@ | |||
1 | |||
2 | #ifdef __cplusplus | ||
3 | extern "C" { | ||
4 | #endif | ||
5 | |||
6 | #undef FNAME | ||
7 | #undef NAME | ||
8 | #undef ICON | ||
9 | |||
10 | |||
11 | /* metadata */ | ||
12 | #define FNAME image_blend_solid_border_cxx_start | ||
13 | #define NAME "Image Blend Solid Border (C++)" | ||
14 | #define ICON "blend.png" | ||
15 | |||
16 | #ifdef UI | ||
17 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
18 | #endif | ||
19 | |||
20 | #ifdef PROTO | ||
21 | void FNAME(void); | ||
22 | #endif | ||
23 | |||
24 | #ifndef EXPEDITE_CXX_TEST_IMPL | ||
25 | #undef FNAME | ||
26 | #undef NAME | ||
27 | #undef ICON | ||
28 | #endif | ||
29 | |||
30 | #ifdef __cplusplus | ||
31 | } | ||
32 | #endif | ||
33 | |||
34 | |||
diff --git a/src/bin/cxx/image_blend_solid_fade_pow2_unscaled.cc b/src/bin/cxx/image_blend_solid_fade_pow2_unscaled.cc new file mode 100644 index 0000000..1967554 --- /dev/null +++ b/src/bin/cxx/image_blend_solid_fade_pow2_unscaled.cc | |||
@@ -0,0 +1,108 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | |||
5 | /* metadata */ | ||
6 | #define FNAME image_blend_solid_fade_pow2_unscaled_start | ||
7 | #define NAME "Image Blend Solid Fade Power 2 Unscaled" | ||
8 | #define ICON "blend.png" | ||
9 | |||
10 | #ifndef PROTO | ||
11 | # ifndef UI | ||
12 | # include "main.h" | ||
13 | |||
14 | /* standard var */ | ||
15 | static int done = 0; | ||
16 | /* private data */ | ||
17 | static Evas_Object *o_images[OBNUM]; | ||
18 | |||
19 | /* setup */ | ||
20 | static void _setup(void) | ||
21 | { | ||
22 | int i; | ||
23 | Evas_Object *o; | ||
24 | for (i = 0; i < OBNUM; i++) | ||
25 | { | ||
26 | int a; | ||
27 | |||
28 | o = eo_add(EVAS_IMAGE_CLASS, G_evas); | ||
29 | o_images[i] = o; | ||
30 | eo_do(o, | ||
31 | efl_file_set(build_path("image.png"), NULL), | ||
32 | evas_obj_image_fill_set(0, 0, 120, 160), | ||
33 | evas_obj_size_set(120, 160)); | ||
34 | a = 256 - (1 << ((rnd() % 8) + 1)); | ||
35 | if (a < 128) a = 128; | ||
36 | eo_do(o, | ||
37 | evas_obj_color_set(a, a, a, a), | ||
38 | evas_obj_visibility_set(EINA_TRUE)); | ||
39 | } | ||
40 | done = 0; | ||
41 | } | ||
42 | |||
43 | /* cleanup */ | ||
44 | static void _cleanup(void) | ||
45 | { | ||
46 | int i; | ||
47 | for (i = 0; i < OBNUM; i++) eo_del(o_images[i]); | ||
48 | } | ||
49 | |||
50 | /* loop - do things */ | ||
51 | static void _loop(double t, int f) | ||
52 | { | ||
53 | int i; | ||
54 | Evas_Coord x, y, w, h; | ||
55 | for (i = 0; i < OBNUM; i++) | ||
56 | { | ||
57 | w = 120; | ||
58 | h = 160; | ||
59 | x = (win_w / 2) - (w / 2); | ||
60 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); | ||
61 | y = (win_h / 2) - (h / 2); | ||
62 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); | ||
63 | eo_do(o_images[i], evas_obj_position_set(x, y)); | ||
64 | } | ||
65 | FPS_STD(NAME); | ||
66 | } | ||
67 | |||
68 | /* prepend special key handlers if interactive (before STD) */ | ||
69 | static void _key(char *key) | ||
70 | { | ||
71 | KEY_STD; | ||
72 | } | ||
73 | |||
74 | |||
75 | |||
76 | |||
77 | |||
78 | |||
79 | |||
80 | |||
81 | |||
82 | |||
83 | |||
84 | |||
85 | /* template stuff - ignore */ | ||
86 | # endif | ||
87 | #endif | ||
88 | |||
89 | #ifdef UI | ||
90 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
91 | #endif | ||
92 | |||
93 | #ifdef PROTO | ||
94 | void FNAME(void); | ||
95 | #endif | ||
96 | |||
97 | #ifndef PROTO | ||
98 | # ifndef UI | ||
99 | void FNAME(void) | ||
100 | { | ||
101 | ui_func_set(_key, _loop); | ||
102 | _setup(); | ||
103 | } | ||
104 | # endif | ||
105 | #endif | ||
106 | #undef FNAME | ||
107 | #undef NAME | ||
108 | #undef ICON | ||
diff --git a/src/bin/cxx/image_blend_solid_fade_pow2_unscaled_capi.h b/src/bin/cxx/image_blend_solid_fade_pow2_unscaled_capi.h new file mode 100644 index 0000000..11203c8 --- /dev/null +++ b/src/bin/cxx/image_blend_solid_fade_pow2_unscaled_capi.h | |||
@@ -0,0 +1,33 @@ | |||
1 | |||
2 | #ifdef __cplusplus | ||
3 | extern "C" { | ||
4 | #endif | ||
5 | |||
6 | #undef FNAME | ||
7 | #undef NAME | ||
8 | #undef ICON | ||
9 | |||
10 | /* metadata */ | ||
11 | #define FNAME image_blend_solid_fade_pow2_unscaled_cxx_start | ||
12 | #define NAME "Image Blend Solid Fade Power 2 Unscaled (C++)" | ||
13 | #define ICON "blend.png" | ||
14 | |||
15 | #ifdef UI | ||
16 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
17 | #endif | ||
18 | |||
19 | #ifdef PROTO | ||
20 | void FNAME(void); | ||
21 | #endif | ||
22 | |||
23 | #ifndef EXPEDITE_CXX_TEST_IMPL | ||
24 | #undef FNAME | ||
25 | #undef NAME | ||
26 | #undef ICON | ||
27 | #endif | ||
28 | |||
29 | #ifdef __cplusplus | ||
30 | } | ||
31 | #endif | ||
32 | |||
33 | |||
diff --git a/src/bin/cxx/image_blend_solid_fade_unscaled.cc b/src/bin/cxx/image_blend_solid_fade_unscaled.cc new file mode 100644 index 0000000..bb09de2 --- /dev/null +++ b/src/bin/cxx/image_blend_solid_fade_unscaled.cc | |||
@@ -0,0 +1,107 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | |||
5 | /* metadata */ | ||
6 | #define FNAME image_blend_solid_fade_unscaled_start | ||
7 | #define NAME "Image Blend Solid Fade Unscaled" | ||
8 | #define ICON "blend.png" | ||
9 | |||
10 | #ifndef PROTO | ||
11 | # ifndef UI | ||
12 | # include "main.h" | ||
13 | |||
14 | /* standard var */ | ||
15 | static int done = 0; | ||
16 | /* private data */ | ||
17 | static Evas_Object *o_images[OBNUM]; | ||
18 | |||
19 | /* setup */ | ||
20 | static void _setup(void) | ||
21 | { | ||
22 | int i; | ||
23 | Evas_Object *o; | ||
24 | for (i = 0; i < OBNUM; i++) | ||
25 | { | ||
26 | int a; | ||
27 | |||
28 | o = eo_add(EVAS_IMAGE_CLASS, G_evas); | ||
29 | o_images[i] = o; | ||
30 | eo_do(o, | ||
31 | efl_file_set(build_path("image.png"), NULL), | ||
32 | evas_obj_image_fill_set(0, 0, 120, 160), | ||
33 | evas_obj_size_set(120, 160)); | ||
34 | a = rnd()&0xff; | ||
35 | eo_do(o, | ||
36 | evas_obj_color_set(a, a, a, a), | ||
37 | evas_obj_visibility_set(EINA_TRUE)); | ||
38 | } | ||
39 | done = 0; | ||
40 | } | ||
41 | |||
42 | /* cleanup */ | ||
43 | static void _cleanup(void) | ||
44 | { | ||
45 | int i; | ||
46 | for (i = 0; i < OBNUM; i++) eo_del(o_images[i]); | ||
47 | } | ||
48 | |||
49 | /* loop - do things */ | ||
50 | static void _loop(double t, int f) | ||
51 | { | ||
52 | int i; | ||
53 | Evas_Coord x, y, w, h; | ||
54 | for (i = 0; i < OBNUM; i++) | ||
55 | { | ||
56 | w = 120; | ||
57 | h = 160; | ||
58 | x = (win_w / 2) - (w / 2); | ||
59 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); | ||
60 | y = (win_h / 2) - (h / 2); | ||
61 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); | ||
62 | eo_do(o_images[i], evas_obj_position_set(x, y)); | ||
63 | } | ||
64 | FPS_STD(NAME); | ||
65 | } | ||
66 | |||
67 | /* prepend special key handlers if interactive (before STD) */ | ||
68 | static void _key(char *key) | ||
69 | { | ||
70 | KEY_STD; | ||
71 | } | ||
72 | |||
73 | |||
74 | |||
75 | |||
76 | |||
77 | |||
78 | |||
79 | |||
80 | |||
81 | |||
82 | |||
83 | |||
84 | /* template stuff - ignore */ | ||
85 | # endif | ||
86 | #endif | ||
87 | |||
88 | #ifdef UI | ||
89 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
90 | #endif | ||
91 | |||
92 | #ifdef PROTO | ||
93 | void FNAME(void); | ||
94 | #endif | ||
95 | |||
96 | #ifndef PROTO | ||
97 | # ifndef UI | ||
98 | void FNAME(void) | ||
99 | { | ||
100 | ui_func_set(_key, _loop); | ||
101 | _setup(); | ||
102 | } | ||
103 | # endif | ||
104 | #endif | ||
105 | #undef FNAME | ||
106 | #undef NAME | ||
107 | #undef ICON | ||
diff --git a/src/bin/cxx/image_blend_solid_fade_unscaled_capi.h b/src/bin/cxx/image_blend_solid_fade_unscaled_capi.h new file mode 100644 index 0000000..b2b4ee0 --- /dev/null +++ b/src/bin/cxx/image_blend_solid_fade_unscaled_capi.h | |||
@@ -0,0 +1,32 @@ | |||
1 | |||
2 | #ifdef __cplusplus | ||
3 | extern "C" { | ||
4 | #endif | ||
5 | |||
6 | #undef FNAME | ||
7 | #undef NAME | ||
8 | #undef ICON | ||
9 | |||
10 | /* metadata */ | ||
11 | #define FNAME image_blend_solid_fade_unscaled_cxx_start | ||
12 | #define NAME "Image Blend Solid Fade Unscaled (C++)" | ||
13 | #define ICON "blend.png" | ||
14 | |||
15 | #ifdef UI | ||
16 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
17 | #endif | ||
18 | |||
19 | #ifdef PROTO | ||
20 | void FNAME(void); | ||
21 | #endif | ||
22 | |||
23 | #ifndef EXPEDITE_CXX_TEST_IMPL | ||
24 | #undef FNAME | ||
25 | #undef NAME | ||
26 | #undef ICON | ||
27 | #endif | ||
28 | |||
29 | #ifdef __cplusplus | ||
30 | } | ||
31 | #endif | ||
32 | |||
diff --git a/src/bin/tests.h b/src/bin/tests.h index 936bf46..22c39a9 100644 --- a/src/bin/tests.h +++ b/src/bin/tests.h | |||
@@ -9,6 +9,10 @@ extern "C" { | |||
9 | #include "cxx/image_blend_border_capi.h" | 9 | #include "cxx/image_blend_border_capi.h" |
10 | #include "cxx/image_blend_border_recolor_capi.h" | 10 | #include "cxx/image_blend_border_recolor_capi.h" |
11 | 11 | ||
12 | #include "cxx/image_blend_solid_border_capi.h" | ||
13 | #include "cxx/image_blend_solid_fade_pow2_unscaled_capi.h" | ||
14 | #include "cxx/image_blend_solid_fade_unscaled_capi.h" | ||
15 | |||
12 | // C tests | 16 | // C tests |
13 | /* #include "widgets_file_icons.c" */ | 17 | /* #include "widgets_file_icons.c" */ |
14 | /* #include "widgets_file_icons_2.c" */ | 18 | /* #include "widgets_file_icons_2.c" */ |