Evas filters: Improve doc automatization
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 13 Feb 2014 08:26:33 +0000 (17:26 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 13 Feb 2014 08:37:33 +0000 (17:37 +0900)
Include example filter codes from src/examples in Doxygen.
Use these examples for the generation as well.

18 files changed:
doc/previews/Makefile.am
doc/previews/filter_blend.sh
doc/previews/filter_blur.sh
doc/previews/filter_bump.sh
doc/previews/filter_curve.sh
doc/previews/filter_example_1.sh
doc/previews/filter_grow.sh
doc/previews/filter_mask.sh
doc/previews/filter_transform.sh
src/examples/evas/filters/filter_blend.txt [new file with mode: 0644]
src/examples/evas/filters/filter_blur.txt [new file with mode: 0644]
src/examples/evas/filters/filter_bump.txt [new file with mode: 0644]
src/examples/evas/filters/filter_curve.txt [new file with mode: 0644]
src/examples/evas/filters/filter_example_1.txt [new file with mode: 0644]
src/examples/evas/filters/filter_grow.txt [new file with mode: 0644]
src/examples/evas/filters/filter_mask.txt [new file with mode: 0644]
src/examples/evas/filters/filter_transform.txt [new file with mode: 0644]
src/lib/evas/filters/evas_filter_parser.c

index fbfdd297dc2c554c14c4e4d4a5d5c3dfab89625c..dd25cc16774d3a84b14934e9d6dcc9a9022f4a86 100644 (file)
@@ -35,7 +35,12 @@ previews-data:
        $(MKDIR_P) $(HTMLDIR)
        @for a in $(PREVIEWS) ; do \
                echo "  GEN      filter_$${a}.png" ; \
-               source ${top_srcdir}/doc/previews/filter_$${a}.sh ; \
+               FONT="Sans" ; \
+               SIZE=24 ; \
+               FILTER=`cat ${top_srcdir}/src/examples/evas/filters/filter_$${a}.txt` ; \
+               if [ -e ${top_srcdir}/doc/previews/filter_$${a}.sh ] ; then \
+                       source ${top_srcdir}/doc/previews/filter_$${a}.sh ; \
+               fi ; \
                $(top_srcdir)/doc/previews/preview_text_filter "$${TEXT}" "$${FILTER}" "$(DATADIR)/filter_$${a}.png" "$${FONT}" "$${SIZE}" ; \
                cp "$(DATADIR)/filter_$${a}.png" "$(HTMLDIR)/" ; \
        done
index eee04461be41fa255a96cd9f67607e95ca92bf01..0d13cea28c77ac91ac7d61fe1afce16956137cce 100644 (file)
@@ -1,5 +1 @@
-TEXT="Blend"
-FONT="Sans:style=bold"
-SIZE=32
-FILTER="blend (color = #3399FF);"
-
+TEXT="Blend Example"
index a844419e399a6abe930a3f4990b2e4605df58516..59de6f4a48417d693cb52b59b45ef0695ea23dc0 100644 (file)
@@ -1,8 +1,3 @@
 TEXT="Blur"
 FONT="Sans:style=bold"
 SIZE=32
-FILTER="
-blur (10, color = black, oy = 5, ox = 5);
-blend ();
-"
-
index 7fa8787e74b7b0455da994e1f75ffbaa1fca915d..76862f19bd107eea63276a66403f4e993cba4839 100644 (file)
@@ -1,8 +1,3 @@
 TEXT="Bump"
 FONT="Sans:style=bold"
 SIZE=64
-FILTER="
-buffer : a (alpha);
-blur (5, dst = a);
-bump (map = a, compensate = yes, color = cyan, specular = 10.0);
-"
index 96e3f11049460520015d0a53335222e5ca3fd3e0..852e165c047ba6fdb3ab957e65edaf6dcee7ee88 100644 (file)
@@ -1,9 +1,3 @@
 TEXT="Curve"
 FONT="Sans:style=bold"
 SIZE=64
-FILTER="
-buffer : a (alpha);
-blur (4, dst = a);
-curve (0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0, src = a, dst = a);
-blend(src = a, color = black);
-"
index 0098a6b2a888d6cd61d9aff9e0b135ce318a8eb5..dfe587cea7762367dee3e476bf043a3df07d8228 100644 (file)
@@ -1,10 +1,3 @@
 TEXT="Evas Filters"
 FONT="Sans"
 SIZE=50
-FILTER="
-buffer : fat (alpha);
-grow (8, dst = fat);
-blur (12, src = fat, color = darkblue);
-blur (4, color = cyan);
-blend ();
-"
index b675ab13eaa250fe893bb7ebc595cc8e001b19b9..7a0b832944ffac307a291d0d21c7293299202d3d 100644 (file)
@@ -1,9 +1,3 @@
 TEXT="Grow - Contour"
 FONT="Sans:style=bold"
 SIZE=32
-FILTER="
-buffer : fat (alpha);
-grow (4, dst = fat);
-blend (src = fat, color = black);
-blend (color = white);
-"
index ab22e5539cb85fbcba75ce669421ca86f0383567..706903eb67b0e7576edc992f76dfea43bd733d02 100644 (file)
@@ -1,10 +1,3 @@
 TEXT="Mask"
 FONT="Sans:style=bold"
 SIZE=64
-FILTER="
-buffer: a (alpha);
-blur(5, dst = a);
-curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
-blend(color = black);
-mask(mask = a, color = cyan);
-"
index 6acd8459c552c5bcaf2028861f3c4767aacdcf98..7d9f3c47a110d4f9cb852e82cca7ed7cde609cfd 100644 (file)
@@ -1,9 +1,3 @@
 TEXT="Transform - Mirror effect"
 FONT="Sans"
 SIZE=50
-FILTER="
-buffer : t (alpha);
-transform (oy = 20, dst = t);
-blend (src = t, color = silver);
-blend (color = white);
-"
diff --git a/src/examples/evas/filters/filter_blend.txt b/src/examples/evas/filters/filter_blend.txt
new file mode 100644 (file)
index 0000000..251c8c3
--- /dev/null
@@ -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 (file)
index 0000000..54b1953
--- /dev/null
@@ -0,0 +1,2 @@
+blur (10, color = black, oy = 5, ox = 5);
+blend ();
diff --git a/src/examples/evas/filters/filter_bump.txt b/src/examples/evas/filters/filter_bump.txt
new file mode 100644 (file)
index 0000000..8110254
--- /dev/null
@@ -0,0 +1,3 @@
+buffer : a (alpha);
+blur (5, dst = a);
+bump (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 (file)
index 0000000..e2e84f7
--- /dev/null
@@ -0,0 +1,4 @@
+buffer : a (alpha);
+blur (4, dst = a);
+curve (0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0, src = a, dst = a);
+blend(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 (file)
index 0000000..ed87d7e
--- /dev/null
@@ -0,0 +1,5 @@
+buffer : fat (alpha);
+grow (8, dst = fat);
+blur (12, src = fat, color = darkblue);
+blur (4, color = cyan);
+blend ();
\ 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 (file)
index 0000000..2d57f42
--- /dev/null
@@ -0,0 +1,4 @@
+buffer : fat (alpha);
+grow (4, dst = fat);
+blend (src = fat, color = black);
+blend (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 (file)
index 0000000..a43c23b
--- /dev/null
@@ -0,0 +1,5 @@
+buffer: a (alpha);
+blur(5, dst = a);
+curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
+blend(color = black);
+mask(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 (file)
index 0000000..322af27
--- /dev/null
@@ -0,0 +1,4 @@
+buffer : t (alpha);
+transform (oy = 20, dst = t);
+blend (src = t, color = silver);
+blend (color = white);
\ No newline at end of file
index 0a5ac7c109b06741ab40735062c23b0748a133f8..3335dc57ab9c6fd900b2e0815c8158845dd7604b 100644 (file)
 
   Here is a simple example illustrating the syntax:
 
-  @code
-    buffer : fat (alpha);
-    grow (8, dst = fat);
-    blur (12, src = fat, color = darkblue);
-    blur (4, color = cyan);
-    blend ();
-  @endcode
+  @include filter_example_1.txt
 
   This example will display a cyan and dark blue glow surrounding the
   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,
 
   If @a src is an alpha buffer and @a dst is an RGBA buffer, then the @a color option should be set.
 
-  @code
-    blend (color = #3399FF);
-  @endcode
+  @include filter_blend.txt
 
   <center>
   @image html filter_blend.png
@@ -1095,10 +1087,7 @@ _blur_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
   If @a src is an alpha buffer and @a dst is an RGBA buffer, then the color option should be set.
 
   @a ox and @a oy can be used to move the blurry output by a few pixels, like a drop shadow. Example:
-  @code
-    blur (10, color = black, oy = 5, ox = 5);
-    blend ();
-  @endcode
+  @include filter_blur.txt
 
   <center>
   @image html filter_blur.png
@@ -1159,11 +1148,7 @@ _blur_instruction_prepare(Evas_Filter_Instruction *instr)
   @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.
 
   Here is a full example for a size 100 font, of a very simple bevel effect:
-  @code
-    buffer : a (alpha);
-    blur (5, dst = a);
-    bump (map = a, compensate = yes, color = cyan, specular = 10.0);
-  @endcode
+  @include filter_bump.txt
 
   <center>
   @image html filter_bump.png
@@ -1230,12 +1215,7 @@ _bump_instruction_prepare(Evas_Filter_Instruction *instr)
   If ignored, y(x = 0) is 0 and y(x = 255) is 255.
 
   The following example will generate a 4px thick stroke around text letters:
-  @code
-    buffer : a (alpha);
-    blur (4, dst = a);
-    curve (0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0, src = a, dst = a);
-    blend(src = a, color = black);
-  @endcode
+  @include filter_curve.txt
 
   <center>
   @image html filter_curve.png
@@ -1470,12 +1450,8 @@ _grow_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
   @param dst     Destination buffer for blending. This must be of same size and colorspace as @a src.
 
   Example:
-  @code
-    buffer : fat (alpha);
-    grow (4, dst = fat);
-    blend (src = fat, color = black);
-    blend (color = white);
-  @endcode
+  @include filter_grow.txt
+
   This will first grow the letters in the buffer @c input by 4px, and then draw
   this buffer in black in the background. Blending white on top of that will
   give a simple impression of stroked text.
@@ -1524,13 +1500,8 @@ _grow_instruction_prepare(Evas_Filter_Instruction *instr)
   Note that @a src and @a mask are interchangeable, if they have the same dimensions.
 
   Example:
-  @code
-    buffer: a (alpha);
-    blur(5, dst = a);
-    curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
-    blend(color = black);
-    mask(mask = a, color = cyan);
-  @endcode
+  @include filter_mask.txt
+
   This will create a simple cyan inner glow effect on black text.
 
   <center>
@@ -1610,12 +1581,8 @@ _transform_padding_update(Evas_Filter_Program *pgm,
   @param oy       Y offset.
 
   Example:
-  @code
-    buffer : t (alpha);
-    transform (oy = 20, dst = t);
-    blend (src = t, color = silver);
-    blend (color = white);
-  @endcode
+  @include filter_transform.txt
+
   This will create a mirrored text effect, for a font of 50px.
 
   <center>