summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-02-13 17:26:33 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-13 17:37:33 +0900
commit511049e20da614bd14be2f57f8aa87315b97d69d (patch)
treea2d1276087f9642ea587293d85df9fe67e4178f8
parent9f1ae254db87e15797ea658d9e1f3cb6d9b11671 (diff)
Evas filters: Improve doc automatization
Include example filter codes from src/examples in Doxygen. Use these examples for the generation as well.
-rw-r--r--doc/previews/Makefile.am7
-rw-r--r--doc/previews/filter_blend.sh6
-rw-r--r--doc/previews/filter_blur.sh5
-rw-r--r--doc/previews/filter_bump.sh5
-rw-r--r--doc/previews/filter_curve.sh6
-rw-r--r--doc/previews/filter_example_1.sh7
-rw-r--r--doc/previews/filter_grow.sh6
-rw-r--r--doc/previews/filter_mask.sh7
-rw-r--r--doc/previews/filter_transform.sh6
-rw-r--r--src/examples/evas/filters/filter_blend.txt1
-rw-r--r--src/examples/evas/filters/filter_blur.txt2
-rw-r--r--src/examples/evas/filters/filter_bump.txt3
-rw-r--r--src/examples/evas/filters/filter_curve.txt4
-rw-r--r--src/examples/evas/filters/filter_example_1.txt5
-rw-r--r--src/examples/evas/filters/filter_grow.txt4
-rw-r--r--src/examples/evas/filters/filter_mask.txt5
-rw-r--r--src/examples/evas/filters/filter_transform.txt4
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c55
18 files changed, 46 insertions, 92 deletions
diff --git a/doc/previews/Makefile.am b/doc/previews/Makefile.am
index fbfdd297dc..dd25cc1677 100644
--- a/doc/previews/Makefile.am
+++ b/doc/previews/Makefile.am
@@ -35,7 +35,12 @@ previews-data:
35 $(MKDIR_P) $(HTMLDIR) 35 $(MKDIR_P) $(HTMLDIR)
36 @for a in $(PREVIEWS) ; do \ 36 @for a in $(PREVIEWS) ; do \
37 echo " GEN filter_$${a}.png" ; \ 37 echo " GEN filter_$${a}.png" ; \
38 source ${top_srcdir}/doc/previews/filter_$${a}.sh ; \ 38 FONT="Sans" ; \
39 SIZE=24 ; \
40 FILTER=`cat ${top_srcdir}/src/examples/evas/filters/filter_$${a}.txt` ; \
41 if [ -e ${top_srcdir}/doc/previews/filter_$${a}.sh ] ; then \
42 source ${top_srcdir}/doc/previews/filter_$${a}.sh ; \
43 fi ; \
39 $(top_srcdir)/doc/previews/preview_text_filter "$${TEXT}" "$${FILTER}" "$(DATADIR)/filter_$${a}.png" "$${FONT}" "$${SIZE}" ; \ 44 $(top_srcdir)/doc/previews/preview_text_filter "$${TEXT}" "$${FILTER}" "$(DATADIR)/filter_$${a}.png" "$${FONT}" "$${SIZE}" ; \
40 cp "$(DATADIR)/filter_$${a}.png" "$(HTMLDIR)/" ; \ 45 cp "$(DATADIR)/filter_$${a}.png" "$(HTMLDIR)/" ; \
41 done 46 done
diff --git a/doc/previews/filter_blend.sh b/doc/previews/filter_blend.sh
index eee04461be..0d13cea28c 100644
--- a/doc/previews/filter_blend.sh
+++ b/doc/previews/filter_blend.sh
@@ -1,5 +1 @@
1TEXT="Blend" TEXT="Blend Example"
2FONT="Sans:style=bold"
3SIZE=32
4FILTER="blend (color = #3399FF);"
5
diff --git a/doc/previews/filter_blur.sh b/doc/previews/filter_blur.sh
index a844419e39..59de6f4a48 100644
--- a/doc/previews/filter_blur.sh
+++ b/doc/previews/filter_blur.sh
@@ -1,8 +1,3 @@
1TEXT="Blur" 1TEXT="Blur"
2FONT="Sans:style=bold" 2FONT="Sans:style=bold"
3SIZE=32 3SIZE=32
4FILTER="
5blur (10, color = black, oy = 5, ox = 5);
6blend ();
7"
8
diff --git a/doc/previews/filter_bump.sh b/doc/previews/filter_bump.sh
index 7fa8787e74..76862f19bd 100644
--- a/doc/previews/filter_bump.sh
+++ b/doc/previews/filter_bump.sh
@@ -1,8 +1,3 @@
1TEXT="Bump" 1TEXT="Bump"
2FONT="Sans:style=bold" 2FONT="Sans:style=bold"
3SIZE=64 3SIZE=64
4FILTER="
5buffer : a (alpha);
6blur (5, dst = a);
7bump (map = a, compensate = yes, color = cyan, specular = 10.0);
8"
diff --git a/doc/previews/filter_curve.sh b/doc/previews/filter_curve.sh
index 96e3f11049..852e165c04 100644
--- a/doc/previews/filter_curve.sh
+++ b/doc/previews/filter_curve.sh
@@ -1,9 +1,3 @@
1TEXT="Curve" 1TEXT="Curve"
2FONT="Sans:style=bold" 2FONT="Sans:style=bold"
3SIZE=64 3SIZE=64
4FILTER="
5buffer : a (alpha);
6blur (4, dst = a);
7curve (0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0, src = a, dst = a);
8blend(src = a, color = black);
9"
diff --git a/doc/previews/filter_example_1.sh b/doc/previews/filter_example_1.sh
index 0098a6b2a8..dfe587cea7 100644
--- a/doc/previews/filter_example_1.sh
+++ b/doc/previews/filter_example_1.sh
@@ -1,10 +1,3 @@
1TEXT="Evas Filters" 1TEXT="Evas Filters"
2FONT="Sans" 2FONT="Sans"
3SIZE=50 3SIZE=50
4FILTER="
5buffer : fat (alpha);
6grow (8, dst = fat);
7blur (12, src = fat, color = darkblue);
8blur (4, color = cyan);
9blend ();
10"
diff --git a/doc/previews/filter_grow.sh b/doc/previews/filter_grow.sh
index b675ab13ea..7a0b832944 100644
--- a/doc/previews/filter_grow.sh
+++ b/doc/previews/filter_grow.sh
@@ -1,9 +1,3 @@
1TEXT="Grow - Contour" 1TEXT="Grow - Contour"
2FONT="Sans:style=bold" 2FONT="Sans:style=bold"
3SIZE=32 3SIZE=32
4FILTER="
5buffer : fat (alpha);
6grow (4, dst = fat);
7blend (src = fat, color = black);
8blend (color = white);
9"
diff --git a/doc/previews/filter_mask.sh b/doc/previews/filter_mask.sh
index ab22e5539c..706903eb67 100644
--- a/doc/previews/filter_mask.sh
+++ b/doc/previews/filter_mask.sh
@@ -1,10 +1,3 @@
1TEXT="Mask" 1TEXT="Mask"
2FONT="Sans:style=bold" 2FONT="Sans:style=bold"
3SIZE=64 3SIZE=64
4FILTER="
5buffer: a (alpha);
6blur(5, dst = a);
7curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
8blend(color = black);
9mask(mask = a, color = cyan);
10"
diff --git a/doc/previews/filter_transform.sh b/doc/previews/filter_transform.sh
index 6acd8459c5..7d9f3c47a1 100644
--- a/doc/previews/filter_transform.sh
+++ b/doc/previews/filter_transform.sh
@@ -1,9 +1,3 @@
1TEXT="Transform - Mirror effect" 1TEXT="Transform - Mirror effect"
2FONT="Sans" 2FONT="Sans"
3SIZE=50 3SIZE=50
4FILTER="
5buffer : t (alpha);
6transform (oy = 20, dst = t);
7blend (src = t, color = silver);
8blend (color = white);
9"
diff --git a/src/examples/evas/filters/filter_blend.txt b/src/examples/evas/filters/filter_blend.txt
new file mode 100644
index 0000000000..251c8c3150
--- /dev/null
+++ b/src/examples/evas/filters/filter_blend.txt
@@ -0,0 +1 @@
blend (color = #3399FF); \ No newline at end of file
diff --git a/src/examples/evas/filters/filter_blur.txt b/src/examples/evas/filters/filter_blur.txt
new file mode 100644
index 0000000000..54b1953d6d
--- /dev/null
+++ b/src/examples/evas/filters/filter_blur.txt
@@ -0,0 +1,2 @@
1blur (10, color = black, oy = 5, ox = 5);
2blend ();
diff --git a/src/examples/evas/filters/filter_bump.txt b/src/examples/evas/filters/filter_bump.txt
new file mode 100644
index 0000000000..8110254c29
--- /dev/null
+++ b/src/examples/evas/filters/filter_bump.txt
@@ -0,0 +1,3 @@
1buffer : a (alpha);
2blur (5, dst = a);
3bump (map = a, compensate = yes, color = cyan, specular = 10.0);
diff --git a/src/examples/evas/filters/filter_curve.txt b/src/examples/evas/filters/filter_curve.txt
new file mode 100644
index 0000000000..e2e84f700b
--- /dev/null
+++ b/src/examples/evas/filters/filter_curve.txt
@@ -0,0 +1,4 @@
1buffer : a (alpha);
2blur (4, dst = a);
3curve (0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0, src = a, dst = a);
4blend(src = a, color = black); \ No newline at end of file
diff --git a/src/examples/evas/filters/filter_example_1.txt b/src/examples/evas/filters/filter_example_1.txt
new file mode 100644
index 0000000000..ed87d7efcb
--- /dev/null
+++ b/src/examples/evas/filters/filter_example_1.txt
@@ -0,0 +1,5 @@
1buffer : fat (alpha);
2grow (8, dst = fat);
3blur (12, src = fat, color = darkblue);
4blur (4, color = cyan);
5blend (); \ No newline at end of file
diff --git a/src/examples/evas/filters/filter_grow.txt b/src/examples/evas/filters/filter_grow.txt
new file mode 100644
index 0000000000..2d57f4281a
--- /dev/null
+++ b/src/examples/evas/filters/filter_grow.txt
@@ -0,0 +1,4 @@
1buffer : fat (alpha);
2grow (4, dst = fat);
3blend (src = fat, color = black);
4blend (color = white); \ No newline at end of file
diff --git a/src/examples/evas/filters/filter_mask.txt b/src/examples/evas/filters/filter_mask.txt
new file mode 100644
index 0000000000..a43c23b695
--- /dev/null
+++ b/src/examples/evas/filters/filter_mask.txt
@@ -0,0 +1,5 @@
1buffer: a (alpha);
2blur(5, dst = a);
3curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
4blend(color = black);
5mask(mask = a, color = cyan); \ No newline at end of file
diff --git a/src/examples/evas/filters/filter_transform.txt b/src/examples/evas/filters/filter_transform.txt
new file mode 100644
index 0000000000..322af27bbb
--- /dev/null
+++ b/src/examples/evas/filters/filter_transform.txt
@@ -0,0 +1,4 @@
1buffer : t (alpha);
2transform (oy = 20, dst = t);
3blend (src = t, color = silver);
4blend (color = white); \ No newline at end of file
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 0a5ac7c109..3335dc57ab 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -67,13 +67,7 @@
67 67
68 Here is a simple example illustrating the syntax: 68 Here is a simple example illustrating the syntax:
69 69
70 @code 70 @include filter_example_1.txt
71 buffer : fat (alpha);
72 grow (8, dst = fat);
73 blur (12, src = fat, color = darkblue);
74 blur (4, color = cyan);
75 blend ();
76 @endcode
77 71
78 This example will display a cyan and dark blue glow surrounding the 72 This example will display a cyan and dark blue glow surrounding the
79 main text (its color depends on the object's theme). 73 main text (its color depends on the object's theme).
@@ -985,9 +979,7 @@ _blend_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
985 979
986 If @a src is an alpha buffer and @a dst is an RGBA buffer, then the @a color option should be set. 980 If @a src is an alpha buffer and @a dst is an RGBA buffer, then the @a color option should be set.
987 981
988 @code 982 @include filter_blend.txt
989 blend (color = #3399FF);
990 @endcode
991 983
992 <center> 984 <center>
993 @image html filter_blend.png 985 @image html filter_blend.png
@@ -1095,10 +1087,7 @@ _blur_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
1095 If @a src is an alpha buffer and @a dst is an RGBA buffer, then the color option should be set. 1087 If @a src is an alpha buffer and @a dst is an RGBA buffer, then the color option should be set.
1096 1088
1097 @a ox and @a oy can be used to move the blurry output by a few pixels, like a drop shadow. Example: 1089 @a ox and @a oy can be used to move the blurry output by a few pixels, like a drop shadow. Example:
1098 @code 1090 @include filter_blur.txt
1099 blur (10, color = black, oy = 5, ox = 5);
1100 blend ();
1101 @endcode
1102 1091
1103 <center> 1092 <center>
1104 @image html filter_blur.png 1093 @image html filter_blur.png
@@ -1159,11 +1148,7 @@ _blur_instruction_prepare(Evas_Filter_Instruction *instr)
1159 @note As of 2014/02/11, the ALPHA to RGBA support is of much better quality than ALPHA only, but @b very slow. RGBA sources are not supported yet. 1148 @note As of 2014/02/11, the ALPHA to RGBA support is of much better quality than ALPHA only, but @b very slow. RGBA sources are not supported yet.
1160 1149
1161 Here is a full example for a size 100 font, of a very simple bevel effect: 1150 Here is a full example for a size 100 font, of a very simple bevel effect:
1162 @code 1151 @include filter_bump.txt
1163 buffer : a (alpha);
1164 blur (5, dst = a);
1165 bump (map = a, compensate = yes, color = cyan, specular = 10.0);
1166 @endcode
1167 1152
1168 <center> 1153 <center>
1169 @image html filter_bump.png 1154 @image html filter_bump.png
@@ -1230,12 +1215,7 @@ _bump_instruction_prepare(Evas_Filter_Instruction *instr)
1230 If ignored, y(x = 0) is 0 and y(x = 255) is 255. 1215 If ignored, y(x = 0) is 0 and y(x = 255) is 255.
1231 1216
1232 The following example will generate a 4px thick stroke around text letters: 1217 The following example will generate a 4px thick stroke around text letters:
1233 @code 1218 @include filter_curve.txt
1234 buffer : a (alpha);
1235 blur (4, dst = a);
1236 curve (0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0, src = a, dst = a);
1237 blend(src = a, color = black);
1238 @endcode
1239 1219
1240 <center> 1220 <center>
1241 @image html filter_curve.png 1221 @image html filter_curve.png
@@ -1470,12 +1450,8 @@ _grow_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
1470 @param dst Destination buffer for blending. This must be of same size and colorspace as @a src. 1450 @param dst Destination buffer for blending. This must be of same size and colorspace as @a src.
1471 1451
1472 Example: 1452 Example:
1473 @code 1453 @include filter_grow.txt
1474 buffer : fat (alpha); 1454
1475 grow (4, dst = fat);
1476 blend (src = fat, color = black);
1477 blend (color = white);
1478 @endcode
1479 This will first grow the letters in the buffer @c input by 4px, and then draw 1455 This will first grow the letters in the buffer @c input by 4px, and then draw
1480 this buffer in black in the background. Blending white on top of that will 1456 this buffer in black in the background. Blending white on top of that will
1481 give a simple impression of stroked text. 1457 give a simple impression of stroked text.
@@ -1524,13 +1500,8 @@ _grow_instruction_prepare(Evas_Filter_Instruction *instr)
1524 Note that @a src and @a mask are interchangeable, if they have the same dimensions. 1500 Note that @a src and @a mask are interchangeable, if they have the same dimensions.
1525 1501
1526 Example: 1502 Example:
1527 @code 1503 @include filter_mask.txt
1528 buffer: a (alpha); 1504
1529 blur(5, dst = a);
1530 curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
1531 blend(color = black);
1532 mask(mask = a, color = cyan);
1533 @endcode
1534 This will create a simple cyan inner glow effect on black text. 1505 This will create a simple cyan inner glow effect on black text.
1535 1506
1536 <center> 1507 <center>
@@ -1610,12 +1581,8 @@ _transform_padding_update(Evas_Filter_Program *pgm,
1610 @param oy Y offset. 1581 @param oy Y offset.
1611 1582
1612 Example: 1583 Example:
1613 @code 1584 @include filter_transform.txt
1614 buffer : t (alpha); 1585
1615 transform (oy = 20, dst = t);
1616 blend (src = t, color = silver);
1617 blend (color = white);
1618 @endcode
1619 This will create a mirrored text effect, for a font of 50px. 1586 This will create a mirrored text effect, for a font of 50px.
1620 1587
1621 <center> 1588 <center>