efl/src/lib/efl/interfaces/efl_gfx_filter.eo

106 lines
3.7 KiB
Plaintext

interface @beta Efl.Gfx.Filter
{
[[Graphical filters can be applied to any object implementing this interface.
Filters are programmable effects that run whenever the object is rendered
on its canvas. The program language is Lua and a complete reference can
be found under "EFL Graphics Filters".
This was a beta feature since 1.15.
]]
c_prefix: efl_gfx;
methods {
@property filter_program {
[[A graphical filter program on this object.
Valid for Text and Image objects at the moment.
The argument passed to this function is a string containing
a valid Lua program based on the filters API as described in
the "EFL Graphics Filters" reference page.
Set to $null to disable filtering.
]]
set {
}
get {
}
values {
code: string; [[The Lua program source code.]]
name: string @optional; [[An optional name for this filter.]]
}
}
@property filter_state {
[[Set the current state of the filter.
This should be used by Edje (EFL's internal layout engine), but
could also be used when implementing animations programmatically.
A full state is defined by two states (name + value): origin state
and target state of an ongoing animation, as well as the $pos
progress (from 0 to 1) of that animation timeline. The second state
can be omitted if there is no ongoing animation.
]]
get {}
set {}
values {
cur_state: string; [[Current state of the filter]]
cur_val: double; [[Current value]]
next_state: string @optional; [[Next filter state, optional]]
next_val: double @optional; [[Next value, optional]]
pos: double @optional; [[Position, optional]]
}
}
@property filter_padding {
[[Required padding to apply this filter without cropping.
Read-only property that can be used to calculate the object's final
geometry. This can be overridden (set) from inside the filter program
by using the function 'padding_set' in the Lua program.
]]
get {
}
values {
l: int; [[Padding on the left]]
r: int; [[Padding on the right]]
t: int; [[Padding on the top]]
b: int; [[Padding on the bottom]]
}
}
@property filter_source {
[[Bind an object to use as a mask or texture in a filter program.
This will create automatically a new RGBA buffer containing
the source object's pixels (as it is rendered).
]]
set {}
get {}
keys {
name: string; [[Buffer name as used in the program.]]
}
values {
source: Efl.Gfx.Entity; [[Object to use as a source of pixels.]]
}
}
@property filter_data {
[[Extra data used by the filter program.
Each data element is a string ($value) stored as a global variable
$name. The program is then responsible for conversion to numbers,
tables, etc...
If the $execute flag is set, then the $value can be complex and
run, as if the original Lua program contained a line 'name = value'.
This can be used to pass in tables.
]]
keys {
name: string; [[Name of the global variable]]
}
values {
value: string; [[String value to use as data]]
execute: bool(false); [[If $true, execute 'name = value']]
}
}
}
}