forked from enlightenment/efl
Evas doc: Move filters examples to Lua
Part 1: auto-generated examples with previews
This commit is contained in:
parent
fec21e85ce
commit
8a1b335bb1
|
@ -48,7 +48,7 @@ previews-data: preview_text_filter
|
||||||
echo " GEN filter_$${a}.png" ; \
|
echo " GEN filter_$${a}.png" ; \
|
||||||
FONT="Sans" ; \
|
FONT="Sans" ; \
|
||||||
SIZE=24 ; \
|
SIZE=24 ; \
|
||||||
FILTER=`cat ${top_srcdir}/src/examples/evas/filters/filter_$${a}.txt` ; \
|
FILTER=`cat ${top_srcdir}/src/examples/evas/filters/filter_$${a}.lua` ; \
|
||||||
if [ -e ${top_srcdir}/doc/previews/filter_$${a}.sh ] ; then \
|
if [ -e ${top_srcdir}/doc/previews/filter_$${a}.sh ] ; then \
|
||||||
source ${top_srcdir}/doc/previews/filter_$${a}.sh ; \
|
source ${top_srcdir}/doc/previews/filter_$${a}.sh ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
blend ({ color = 0x3399FF })
|
|
@ -1 +0,0 @@
|
||||||
blend (color = #3399FF);
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
blur ({ 10, color = 'black', oy = 5, ox = 5 })
|
||||||
|
blend ({ color = 0x3399FF })
|
|
@ -1,2 +0,0 @@
|
||||||
blur (10, color = black, oy = 5, ox = 5);
|
|
||||||
blend (color = #3399FF);
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
a = buffer ('alpha')
|
||||||
|
blur ({ 5, dst = a })
|
||||||
|
bump ({ map = a, compensate = true, color = 0x3399FF, specular = 10.0 })
|
|
@ -1,3 +0,0 @@
|
||||||
buffer : a (alpha);
|
|
||||||
blur (5, dst = a);
|
|
||||||
bump (map = a, compensate = yes, color = #3399FF, specular = 10.0);
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
a = buffer ('alpha')
|
||||||
|
blur ({ 4, dst = a })
|
||||||
|
curve ({ points = '0:0 - 20:0 - 60:255 - 160:255 - 200:0 - 255:0', src = a, dst = a })
|
||||||
|
blend ({ src = a, color = 'black' })
|
|
@ -1,4 +0,0 @@
|
||||||
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);
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
fat = buffer ('alpha')
|
||||||
|
grow ({ 8, dst = fat })
|
||||||
|
blur ({ 12, src = fat, color = 'darkblue' })
|
||||||
|
blur ({ 4, color = 'cyan' })
|
||||||
|
blend ()
|
|
@ -1,5 +0,0 @@
|
||||||
buffer : fat (alpha);
|
|
||||||
grow (8, dst = fat);
|
|
||||||
blur (12, src = fat, color = darkblue);
|
|
||||||
blur (4, color = cyan);
|
|
||||||
blend ();
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
fat = buffer ('alpha')
|
||||||
|
grow ({ 8, dst = fat })
|
||||||
|
blend ({ src = fat, color = 'black' })
|
||||||
|
blend ({ color = 0x3399FF })
|
|
@ -1,4 +0,0 @@
|
||||||
buffer : fat (alpha);
|
|
||||||
grow (8, dst = fat);
|
|
||||||
blend (src = fat, color = black);
|
|
||||||
blend (color = #3399FF);
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
a = buffer ('alpha')
|
||||||
|
blur ({ 6, dst = a })
|
||||||
|
curve ({ points = '0:255 - 128:255 - 255:0', src = a, dst = a })
|
||||||
|
blend ({ color = 'yellow' })
|
||||||
|
mask ({ mask = a, color = 'black' })
|
|
@ -1,5 +0,0 @@
|
||||||
buffer: a (alpha);
|
|
||||||
blur(6, dst = a);
|
|
||||||
curve(points = 0:255 - 128:255 - 255:0, src = a, dst = a);
|
|
||||||
blend(color = yellow);
|
|
||||||
mask(mask = a, color = black);
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
t = buffer ('alpha')
|
||||||
|
transform ({ oy = 20, dst = t })
|
||||||
|
blend ({ src = t, color = 'silver' })
|
||||||
|
blend ({ color = 'black' })
|
|
@ -1,4 +0,0 @@
|
||||||
buffer : t (alpha);
|
|
||||||
transform (oy = 20, dst = t);
|
|
||||||
blend (src = t, color = silver);
|
|
||||||
blend (color = black);
|
|
|
@ -84,7 +84,7 @@
|
||||||
|
|
||||||
Here is a simple example illustrating the syntax:
|
Here is a simple example illustrating the syntax:
|
||||||
|
|
||||||
@include filter_example_1.txt
|
@include filter_example_1.lua
|
||||||
|
|
||||||
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).
|
||||||
|
@ -803,7 +803,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.
|
||||||
|
|
||||||
@include filter_blend.txt
|
@include filter_blend.lua
|
||||||
|
|
||||||
<center>
|
<center>
|
||||||
@image html filter_blend.png
|
@image html filter_blend.png
|
||||||
|
@ -923,7 +923,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:
|
||||||
@include filter_blur.txt
|
@include filter_blur.lua
|
||||||
|
|
||||||
<center>
|
<center>
|
||||||
@image html filter_blur.png
|
@image html filter_blur.png
|
||||||
|
@ -985,7 +985,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 of a very simple bevel effect:
|
Here is a full example of a very simple bevel effect:
|
||||||
@include filter_bump.txt
|
@include filter_bump.lua
|
||||||
|
|
||||||
<center>
|
<center>
|
||||||
@image html filter_bump.png
|
@image html filter_bump.png
|
||||||
|
@ -1052,7 +1052,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:
|
||||||
@include filter_curve.txt
|
@include filter_curve.lua
|
||||||
|
|
||||||
<center>
|
<center>
|
||||||
@image html filter_curve.png
|
@image html filter_curve.png
|
||||||
|
@ -1289,7 +1289,7 @@ _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:
|
||||||
@include filter_grow.txt
|
@include filter_grow.lua
|
||||||
|
|
||||||
This will first grow the letters in the buffer @c input by a few pixels, and
|
This will first grow the letters in the buffer @c input by a few pixels, and
|
||||||
then draw this buffer in black in the background.
|
then draw this buffer in black in the background.
|
||||||
|
@ -1340,7 +1340,7 @@ _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:
|
||||||
@include filter_mask.txt
|
@include filter_mask.lua
|
||||||
|
|
||||||
This will create an inner shadow effect.
|
This will create an inner shadow effect.
|
||||||
|
|
||||||
|
@ -1422,7 +1422,7 @@ _transform_padding_update(Evas_Filter_Program *pgm,
|
||||||
@param oy Y offset.
|
@param oy Y offset.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@include filter_transform.txt
|
@include filter_transform.lua
|
||||||
|
|
||||||
This will create a mirrored text effect, for a font of 50px.
|
This will create a mirrored text effect, for a font of 50px.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue