Revert "Revert "Setup before starting fps measurement""
[platform/upstream/expedite.git] / src / bin / image_quality_scale.c
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME image_quality_scale_start
7 #define NAME "Image Quality Scale"
8 #define ICON "data.png"
9
10 #ifndef PROTO
11 # ifndef UI
12 #  include "main.h"
13
14 /* standard var */
15 static int done = 0;
16
17 /* private data */
18 static Evas_Object *o_images[1];
19
20 /* setup */
21 static void _setup(void)
22 {
23    int i;
24    Evas_Object *o;
25    for (i = 0; i < 1; i++)
26      {
27         o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
28         o_images[i] = o;
29         efl_file_simple_load(o, build_path("tp.png"), NULL);
30         efl_gfx_fill_set(o, EINA_RECT(0, 0, 640, 480));
31         efl_gfx_entity_size_set(o, EINA_SIZE2D(640, 480));
32         efl_gfx_entity_visible_set(o, EINA_TRUE);
33      }
34    done = 0;
35 }
36
37 /* cleanup */
38 static void _cleanup(void)
39 {
40    int i;
41    for (i = 0; i < 1; i++) efl_del(o_images[i]);
42 }
43
44 /* loop - do things */
45 static void _loop(double t, int f)
46 {
47    int i;
48    Evas_Coord x, y, w, h;
49    for (i = 0; i < 1; i++)
50      {
51         w = 640;
52         h = 480;
53         w *= (f / 100.0) * 4.0;
54         h *= (f / 100.0) * 4.0;
55         x = (win_w / 2) - (w / 2);
56         y = (win_h / 2) - (h / 2);
57         efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
58         efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
59         efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
60      }
61    FPS_STD(NAME);
62 }
63
64 /* prepend special key handlers if interactive (before STD) */
65 static void _key(const char *key)
66 {
67    KEY_STD;
68 }
69
70
71
72
73
74
75
76
77
78
79
80
81 /* template stuff - ignore */
82 # endif
83 #endif
84
85 #ifdef UI
86 _ui_menu_item_add(ICON, NAME, FNAME);
87 #endif
88
89 #ifdef PROTO
90 void FNAME(void);
91 #endif
92
93 #ifndef PROTO
94 # ifndef UI
95 void FNAME(void)
96 {
97    _setup();
98    ui_func_set(_key, _loop);
99 }
100 # endif
101 #endif
102 #undef FNAME
103 #undef NAME
104 #undef ICON