summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_gfx_filter.eo
blob: 29a9644c109cc3690ad099a3364a5739a2d30680 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
interface 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.

     @since 1.18
   ]]
   eo_prefix: efl_gfx;
   methods {
      @property filter_program {
         set {
            [[Set 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.
            ]]
         }
         get {
            [[Gets the code of the filter program set on this object.
              May be $null.
            ]]
         }
         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;
            cur_val: double;
            next_state: string @optional;
            next_val: double @optional;
            pos: double @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 overriden (set) from inside the filter program
           by using the function 'padding_set' in the Lua program.
         ]]
         get {
            [[Gets the padding required to apply this filter.]]
         }
         values {
            l: int;
            r: int;
            t: int;
            b: int;
         }
      }
      @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; [[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']]
         }
      }
   }
}