Go back to Efl.Gfx.Filter.
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.
mask ({ mask, src = input, dst = output, color = 'white', fillmode = 'repeat' })
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. |
This example requires an external object named “image1”
:
mask { mask = 'image1', fillmode = 'stretch' }
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' })