Go back to 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 Fill modes.
Examples

This example requires an external object named “image1”:

texturing.lua
mask { mask = 'image1', fillmode = 'stretch' }

The following example does not require any external texture:

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' })