Evas filters: Improve doc automatization

Include example filter codes from src/examples in Doxygen.
Use these examples for the generation as well.
This commit is contained in:
Jean-Philippe Andre 2014-02-13 17:26:33 +09:00
parent 9f1ae254db
commit 511049e20d
18 changed files with 46 additions and 92 deletions

View 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

View File

@ -1,5 +1 @@
TEXT="Blend"
FONT="Sans:style=bold"
SIZE=32
FILTER="blend (color = #3399FF);"
TEXT="Blend Example"

View File

@ -1,8 +1,3 @@
TEXT="Blur"
FONT="Sans:style=bold"
SIZE=32
FILTER="
blur (10, color = black, oy = 5, ox = 5);
blend ();
"

View 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);
"

View 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);
"

View 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 ();
"

View 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);
"

View 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);
"

View 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);
"

View File

@ -0,0 +1 @@
blend (color = #3399FF);

View File

@ -0,0 +1,2 @@
blur (10, color = black, oy = 5, ox = 5);
blend ();

View File

@ -0,0 +1,3 @@
buffer : a (alpha);
blur (5, dst = a);
bump (map = a, compensate = yes, color = cyan, specular = 10.0);

View File

@ -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);

View File

@ -0,0 +1,5 @@
buffer : fat (alpha);
grow (8, dst = fat);
blur (12, src = fat, color = darkblue);
blur (4, color = cyan);
blend ();

View File

@ -0,0 +1,4 @@
buffer : fat (alpha);
grow (4, dst = fat);
blend (src = fat, color = black);
blend (color = white);

View File

@ -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);

View File

@ -0,0 +1,4 @@
buffer : t (alpha);
transform (oy = 20, dst = t);
blend (src = t, color = silver);
blend (color = white);

View File

@ -67,13 +67,7 @@
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>