summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorTaehyub Kim <taehyub.kim@samsung.com>2020-05-29 11:40:37 +0900
committerHermet Park <chuneon.park@samsung.com>2020-05-29 11:40:37 +0900
commitdf06418b6f39f3b8d73631bda33308b67736bb9d (patch)
tree956a06a4a860168cf9462204b9cd356d84dc9614 /src/examples
parentf88494aa2c2f7ad6edb9da5d626b9042db86f6c9 (diff)
Support WebP Animation Image Files
Summary: Support WebP Animate Format Imaeg Files. To support webp animation, apply webp animation decoder. Test Plan: 1. compile src/exmaple/elementary/image_webp_example_01.c and 02.c 2. run the samples Reviewers: Hermet, kimcinoo, jsuya, bu5hm4n Reviewed By: Hermet, kimcinoo, jsuya Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11876
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/elementary/image_webp_example_01.c38
-rw-r--r--src/examples/elementary/image_webp_example_02.c41
-rw-r--r--src/examples/elementary/meson.build2
3 files changed, 81 insertions, 0 deletions
diff --git a/src/examples/elementary/image_webp_example_01.c b/src/examples/elementary/image_webp_example_01.c
new file mode 100644
index 0000000000..24bc79ae72
--- /dev/null
+++ b/src/examples/elementary/image_webp_example_01.c
@@ -0,0 +1,38 @@
1//Compile with:
2//gcc -g image_webp_example_01.c -o image_webp_example_01 `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6int
7elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
8{
9 Evas_Object *win, *image;
10 char buf[PATH_MAX];
11
12 elm_app_info_set(elm_main, "elementary", "images/static_webp_image.webp");
13 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
14
15 win = elm_win_util_standard_add("WebP Image", "WebP Image");
16 elm_win_autodel_set(win, EINA_TRUE);
17
18 snprintf(buf, sizeof(buf), "%s/images/static_webp_image.webp", elm_app_data_dir_get());
19
20 image = elm_image_add(win);
21 if (!elm_image_file_set(image, buf, NULL))
22 {
23 printf("error: could not load image \"%s\"\n", buf);
24 return -1;
25 }
26
27 evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
28 elm_win_resize_object_add(win, image);
29 evas_object_show(image);
30
31 evas_object_resize(win, 320, 320);
32 evas_object_show(win);
33
34 elm_run();
35
36 return 0;
37}
38ELM_MAIN()
diff --git a/src/examples/elementary/image_webp_example_02.c b/src/examples/elementary/image_webp_example_02.c
new file mode 100644
index 0000000000..3bfaf4a71c
--- /dev/null
+++ b/src/examples/elementary/image_webp_example_02.c
@@ -0,0 +1,41 @@
1//Compile with:
2//gcc -g image_webp_example_02.c -o image_webp_example_02 `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6int
7elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
8{
9 Evas_Object *win, *image;
10 char buf[PATH_MAX];
11
12 elm_app_info_set(elm_main, "elementary", "images/animated_webp_image.webp");
13 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
14
15 win = elm_win_util_standard_add("WebP Image", "WebP Image");
16 elm_win_autodel_set(win, EINA_TRUE);
17
18 snprintf(buf, sizeof(buf), "%s/images/animated_webp_image.webp", elm_app_data_dir_get());
19
20 image = elm_image_add(win);
21 if (!elm_image_file_set(image, buf, NULL))
22 {
23 printf("error: could not load image \"%s\"\n", buf);
24 return -1;
25 }
26
27 elm_image_animated_set(image, EINA_TRUE);
28 elm_image_animated_play_set(image, EINA_TRUE);
29
30 evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
31 elm_win_resize_object_add(win, image);
32 evas_object_show(image);
33
34 evas_object_resize(win, 320, 320);
35 evas_object_show(win);
36
37 elm_run();
38
39 return 0;
40}
41ELM_MAIN()
diff --git a/src/examples/elementary/meson.build b/src/examples/elementary/meson.build
index 7876285349..7abffa8a2f 100644
--- a/src/examples/elementary/meson.build
+++ b/src/examples/elementary/meson.build
@@ -46,6 +46,8 @@ examples = [
46 'hoversel_example_01', 46 'hoversel_example_01',
47 'icon_example_01', 47 'icon_example_01',
48 'image_example_01', 48 'image_example_01',
49 'image_webp_example_01',
50 'image_webp_example_02',
49 'index_example_01', 51 'index_example_01',
50 'index_example_02', 52 'index_example_02',
51 'inwin_example', 53 'inwin_example',