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) $(MKDIR_P) $(HTMLDIR)
@for a in $(PREVIEWS) ; do \ @for a in $(PREVIEWS) ; do \
echo " GEN filter_$${a}.png" ; \ 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}" ; \ $(top_srcdir)/doc/previews/preview_text_filter "$${TEXT}" "$${FILTER}" "$(DATADIR)/filter_$${a}.png" "$${FONT}" "$${SIZE}" ; \
cp "$(DATADIR)/filter_$${a}.png" "$(HTMLDIR)/" ; \ cp "$(DATADIR)/filter_$${a}.png" "$(HTMLDIR)/" ; \
done done

View File

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

View File

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

View File

@ -1,8 +1,3 @@
TEXT="Bump" TEXT="Bump"
FONT="Sans:style=bold" FONT="Sans:style=bold"
SIZE=64 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" TEXT="Curve"
FONT="Sans:style=bold" FONT="Sans:style=bold"
SIZE=64 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" TEXT="Evas Filters"
FONT="Sans" FONT="Sans"
SIZE=50 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" TEXT="Grow - Contour"
FONT="Sans:style=bold" FONT="Sans:style=bold"
SIZE=32 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" TEXT="Mask"
FONT="Sans:style=bold" FONT="Sans:style=bold"
SIZE=64 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" TEXT="Transform - Mirror effect"
FONT="Sans" FONT="Sans"
SIZE=50 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: Here is a simple example illustrating the syntax:
@code @include filter_example_1.txt
buffer : fat (alpha);
grow (8, dst = fat);
blur (12, src = fat, color = darkblue);
blur (4, color = cyan);
blend ();
@endcode
This example will display a cyan and dark blue glow surrounding the This example will display a cyan and dark blue glow surrounding the
main text (its color depends on the object's theme). 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. If @a src is an alpha buffer and @a dst is an RGBA buffer, then the @a color option should be set.
@code @include filter_blend.txt
blend (color = #3399FF);
@endcode
<center> <center>
@image html filter_blend.png @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. 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: @a ox and @a oy can be used to move the blurry output by a few pixels, like a drop shadow. Example:
@code @include filter_blur.txt
blur (10, color = black, oy = 5, ox = 5);
blend ();
@endcode
<center> <center>
@image html filter_blur.png @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. @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: Here is a full example for a size 100 font, of a very simple bevel effect:
@code @include filter_bump.txt
buffer : a (alpha);
blur (5, dst = a);
bump (map = a, compensate = yes, color = cyan, specular = 10.0);
@endcode
<center> <center>
@image html filter_bump.png @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. 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: The following example will generate a 4px thick stroke around text letters:
@code @include filter_curve.txt
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
<center> <center>
@image html filter_curve.png @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. @param dst Destination buffer for blending. This must be of same size and colorspace as @a src.
Example: Example:
@code @include filter_grow.txt
buffer : fat (alpha);
grow (4, dst = fat);
blend (src = fat, color = black);
blend (color = white);
@endcode
This will first grow the letters in the buffer @c input by 4px, and then draw 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 this buffer in black in the background. Blending white on top of that will
give a simple impression of stroked text. 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. Note that @a src and @a mask are interchangeable, if they have the same dimensions.
Example: Example:
@code @include filter_mask.txt
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
This will create a simple cyan inner glow effect on black text. This will create a simple cyan inner glow effect on black text.
<center> <center>
@ -1610,12 +1581,8 @@ _transform_padding_update(Evas_Filter_Program *pgm,
@param oy Y offset. @param oy Y offset.
Example: Example:
@code @include filter_transform.txt
buffer : t (alpha);
transform (oy = 20, dst = t);
blend (src = t, color = silver);
blend (color = white);
@endcode
This will create a mirrored text effect, for a font of 50px. This will create a mirrored text effect, for a font of 50px.
<center> <center>