Wiki page mask changed with summary [refactoring developer docs] by Andrew Williams

This commit is contained in:
Andrew Williams 2017-10-20 09:03:42 -07:00 committed by apache
parent 438b938fe0
commit ee9445b2b7
1 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,40 @@
Go back to [[:docs:efl:advanced:eflgfxfilters|Efl.Gfx.Filter]].
==== Masking and texturing ====
The ''mask'' function is used to blend together 3 buffers instead of just two. As such this means input ''A'' can be masked by input ''B'' and blended on target ''C''.
''mask'' can be used to apply textures to text characters or apply alpha masks to RGBA buffers.
== Syntax ==
<code Lua>
mask ({ mask, src = input, dst = output, color = 'white', fillmode = 'repeat' })
</code>
== Parameters ==
|''mask'' |A mask or texture to blend with the input src into the target dst. |
|''src'' |Source buffer. This can also be thought of a mask if src is alpha and mask is RGBA. |
|''dst'' |Destination buffer for blending. This must be of same size and colorspace as src. |
|''color'' |A color to use for alpha to RGBA conversion for the blend operations. White means no change. See [[colors]]. \\ This will have no effect on RGBA sources. |
|''fillmode'' |Defines whether to stretch or repeat the mask if its size differs from the ''input'' size. \\ Should be set when masking with external textures. Default is ''"repeat"''. See [[fillmodes]]. |
== Examples ==
This example requires an external object named ''"image1"'':
<code Lua texturing.lua>
mask { mask = 'image1', fillmode = 'stretch' }
</code>
{{:docs:efl:advanced:filter-mask.png|}}
The following example does not require any external texture:
<code Lua innershadow.lua>
a = buffer ('alpha')
blur ({ 6, dst = a })
p = {}
p[0] = 255
p[128] = 255
p[255] = 0
curve ({ points = p, src = a, dst = a })
blend ({ color = 'black' })
mask ({ mask = a, color = 'cyan' })
</code>
{{:docs:efl:advanced:filter-innershadow.png|}}