summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_3d_light.eo
blob: 7cd71fdf202601642b75123b3fcaf81dc458f48c (plain) (blame)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
class Evas_3D_Light (Evas_3D_Object, Evas.Common_Interface)
{
   legacy_prefix: null;
   data: Evas_3D_Light_Data;

   properties {
      directional {
         set {
            /*@
              Set the directional flag of the given light.

              Directional light is a type of light which is infinitely far away with no
              attenuation. The light direction is determined by the containing node's
              forward vector (negative Z-axis).

              By default, directional is not enabled.

              @see evas_3d_node_look_at_set()

              @ingroup Evas_3D_Light
             */
         }
         get {
            /*@
              Get the directional flag of the given light.

              @see evas_3d_light_directional_set()

              @ingroup Evas_3D_Light
             */
         }
         values {
            bool directional; /*@ Whether the light is directional (@c EINA_TRUE), or not (@c EINA_FALSE).*/
         }
      }

      spot_exponent {
         set {
            /*@
              Set the spot exponent of the given light.

              Higher spot exponent means intensity at the center of the cone is relatively
              stronger. Zero exponent means the light intensity is evenly distibuted. The
              spot exponent has no effect when the light is not spot light (spot cutoff
              angle is less than 180 degree).

              Default spot exponent is 0.

              @see evas_3d_light_spot_cutoff_set()

              @ingroup Evas_3D_Light
             */
         }
         get {
            /*@
              Get the spot exponent of the given light.

              @see evas_3d_light_spot_exponent_set()

              @ingroup Evas_3D_Light
             */
         }
         values {
            Evas_Real exponent; /*@ Spot exponent value..*/
         }
      }

      spot_cutoff {
         set {
            /*@
              Set the spot cutoff angle of the given light.

              Only angle less than 180 degree will make it spot light, so that other spot
              light attribute will take effect.

              Default spot cutoff angle is 180.

              @ingroup Evas_3D_Light
             */
         }
         get {
            /*@
              Get the spot cutoff angle of the given light.

              @see evas_3d_light_spot_cutoff_set()

              @ingroup Evas_3D_Light
             */
         }
         values {
            Evas_Real cutoff; /*@ Cutoff angle in degree..*/
         }
      }

      attenuation_enable {
         set {
            /*@
              Set the attenuation enable flag of the given light.

              By default, light attenuation is not enabled.

              @see evas_3d_light_attenuation_set()

              @ingroup Evas_3D_Light
             */
         }
         get {
            /*@
              Get the attenuation enable flag of the given light.

              @see evas_3d_light_attenuation_enable_set()

              @ingroup Evas_3D_Light
             */
         }
         values {
            bool enable; /*@ Whether to enable attenuation (@c EINA_TRUE), or not (@c EINA_FALSE)..*/
         }
      }
   }
   methods {
      ambient_set {
         /*@
           Set the ambient color of the given light.

           Default ambient color is (0.0, 0.0, 0.0, 1.0).

           @ingroup Evas_3D_Light
          */
         params {
           @in Evas_Real r; /*@ Red component of the ambient color between [0.0, 1.0]. */
           @in Evas_Real g; /*@ Green component of the ambient color between [0.0, 1.0]. */
           @in Evas_Real b; /*@ Blue component of the ambient color between [0.0, 1.0]. */
           @in Evas_Real a; /*@ Alpha component of the ambient color between [0.0, 1.0]. */
         }
      }
      ambient_get @const {
         /*@
           Get the ambient color of the given light.

           @see evas_3d_light_ambient_set()

           @ingroup Evas_3D_Light
          */
         params {
           @out Evas_Real r; /*@ Red component of the ambient color between [0.0, 1.0]. */
           @out Evas_Real g; /*@ Green component of the ambient color between [0.0, 1.0]. */
           @out Evas_Real b; /*@ Blue component of the ambient color between [0.0, 1.0]. */
           @out Evas_Real a; /*@ Alpha component of the ambient color between [0.0, 1.0]. */
         }
      }

      diffuse_set {
         /*@
           Set the diffuse color of the given light.

           Default diffuse color is (1.0, 1.0, 1.0, 1.0).

           @ingroup Evas_3D_Light
          */
         params {
           @in Evas_Real r; /*@ Red component of the diffuse color between [0.0, 1.0]. */
           @in Evas_Real g; /*@ Green component of the diffuse color between [0.0, 1.0]. */
           @in Evas_Real b; /*@ Blue component of the diffuse color between [0.0, 1.0]. */
           @in Evas_Real a; /*@ Alpha component of the diffuse color between [0.0, 1.0]. */
         }
      }
      diffuse_get @const {
         /*@
           Get the diffuse color of the given light.

           @see evas_3d_light_diffuse_set()

           @ingroup Evas_3D_Light
          */
         params {
           @out Evas_Real r; /*@ Red component of the diffuse color between [0.0, 1.0]. */
           @out Evas_Real g; /*@ Green component of the diffuse color between [0.0, 1.0]. */
           @out Evas_Real b; /*@ Blue component of the diffuse color between [0.0, 1.0]. */
           @out Evas_Real a; /*@ Alpha component of the diffuse color between [0.0, 1.0]. */
         }
      }

      specular_set {
         /*@
           Set the specular color of the given light.

           Default specular color is (1.0, 1.0, 1.0, 1.0).

           @ingroup Evas_3D_Light
          */
         params {
           @in Evas_Real r; /*@ Red component of the specular color between [0.0, 1.0]. */
           @in Evas_Real g; /*@ Green component of the specular color between [0.0, 1.0]. */
           @in Evas_Real b; /*@ Blue component of the specular color between [0.0, 1.0]. */
           @in Evas_Real a; /*@ Alpha component of the specular color between [0.0, 1.0]. */
         }
      }
      specular_get @const {
         /*@
           Get the specular color of the given light.

           @see evas_3d_light_specular_set()

           @ingroup Evas_3D_Light
          */
         params {
           @out Evas_Real r; /*@ Red component of the specular color between [0.0, 1.0]. */
           @out Evas_Real g; /*@ Green component of the specular color between [0.0, 1.0]. */
           @out Evas_Real b; /*@ Blue component of the specular color between [0.0, 1.0]. */
           @out Evas_Real a; /*@ Alpha component of the specular color between [0.0, 1.0]. */
         }
      }

      attenuation_set {
         /*@
           Set the attenuation of the given light.

           Light attenuation has no effect with directional light. And the attenuation
           should be enabled first to take effect. The attenuation factor is calculated
           as follows.

           atten = 1.0 / constant + linear * distance + quadratic * distance * distance

           Default attenuation is constant = 1.0, linear = 0.0, quadratic = 0.0.

           @see evas_3d_light_attenuation_enable_set()

           @ingroup Evas_3D_Light
          */
         params {
            @in Evas_Real constant; /*@ Constant attenuation term..*/
            @in Evas_Real linear; /*@ Linear attenuation term..*/
            @in Evas_Real quadratic; /*@ Quadratic attenuation term..*/
         }
      }

      attenuation_get @const {
         /*@
           Get the attenuation of the given light.

           @see evas_3d_light_attenuation_set()

           @ingroup Evas_3D_Light
          */
         params {
            @out Evas_Real constant; /*@ Constant attenuation term..*/
            @out Evas_Real linear; /*@ Linear attenuation term..*/
            @out Evas_Real quadratic; /*@ Quadratic attenuation term..*/
         }
      }

      projection_matrix_set {
         /*@
           Set the projection matrix of the given light source.

           @param light The given light source.
           @param matrix Pointer to the array of 16 Evas_Real values in column major order.

           Default projection matrix is identity matrix.

           @see evas_3d_light_projection_perspective_set()
           @see evas_3d_light_projection_ortho_set()
           @see evas_3d_light_projection_frustum_set()

           @ingroup Evas_3D_Light
          */
         params {
           @in const(Evas_Real) *matrix; /*@ Projection Matrix */
         }
      }

      projection_matrix_get  @const {
         /*@
          Get the projection matrix of the given light source.

          @param light The given light source.
          @param matrix Pointer to receive the 16 Evas_Real values in column major order.

          @see evas_3d_light_projection_matrix_set()

          @ingroup Evas_3D_Light
         */
         params {
           @out Evas_Real matrix; /*@ Projection Matrix */
         }
      }

      projection_perspective_set {
         /*@
           Set the projection matrix of the given light source with perspective projection.

           @param light The given light source.
           @param fovy Field of view angle in Y direction.
           @param aspect Aspect ratio.
           @param dnear Distance to near clipping plane.
           @param dfar Distance to far clipping plane.

           @see evas_3d_light_projection_matrix_set()

           @ingroup Evas_3D_Light
          */

         params {
            Evas_Real fovy; /*@ Field of view angle in Y direction. */
            Evas_Real aspect; /*@ Aspect ratio.*/
            Evas_Real dnear; /*@ Distance to near clipping plane. */
            Evas_Real dfar; /*@ Distance to far clipping plane. */
         }
      }

      projection_frustum_set {
         /*@
           Set the projection matrix of the given light source with frustum projection.

           @see evas_3d_Light_projection_matrix_set()

           @ingroup Evas_3D_Light
          */
         params {
            Evas_Real left; /*@ Left X coordinate of the near clipping plane. */
            Evas_Real right; /*@ Right X coordinate of the near clipping plane..*/
            Evas_Real bottom; /*@ Bottom Y coordinate of the near clipping plane. */
            Evas_Real top; /*@ Top Y coordinate of the near clipping plane */
            Evas_Real dnear; /*@ Distance to near clipping plane. */
            Evas_Real dfar; /*@ Distance to far clipping plane. */
         }
      }
      projection_ortho_set {
         /*@
           Set the projection matrix of the given light source with orthogonal projection.

           @see evas_3d_light_projection_matrix_set()

           @ingroup Evas_3D_Light
          */
         params {
            Evas_Real left; /*@ Left X coordinate of the near clipping plane. */
            Evas_Real right; /*@ Right X coordinate of the near clipping plane..*/
            Evas_Real bottom; /*@ Bottom Y coordinate of the near clipping plane. */
            Evas_Real top; /*@ Top Y coordinate of the near clipping plane */
            Evas_Real dnear; /*@ Distance to near clipping plane. */
            Evas_Real dfar; /*@ Distance to far clipping plane. */
         }
      }
   }

   implements {
      Eo.Base.constructor;
      Eo.Base.destructor;
      Evas_3D_Object.update_notify;
      Evas_3D_Object.change_notify;
   }

}