From ee9445b2b7dbc9e8ae254f60ad08d9d1b131a3b7 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 20 Oct 2017 09:03:42 -0700 Subject: [PATCH] Wiki page mask changed with summary [refactoring developer docs] by Andrew Williams --- .../efl/advanced/eflgfxfilter/mask.txt | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pages/develop/efl/advanced/eflgfxfilter/mask.txt diff --git a/pages/develop/efl/advanced/eflgfxfilter/mask.txt b/pages/develop/efl/advanced/eflgfxfilter/mask.txt new file mode 100644 index 000000000..278310b2a --- /dev/null +++ b/pages/develop/efl/advanced/eflgfxfilter/mask.txt @@ -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 == + +mask ({ mask, src = input, dst = output, color = 'white', fillmode = 'repeat' }) + + +== 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"'': + +mask { mask = 'image1', fillmode = 'stretch' } + +{{:docs:efl:advanced:filter-mask.png|}} + +The following example does not require any external texture: + +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' }) + +{{:docs:efl:advanced:filter-innershadow.png|}} \ No newline at end of file