@@ -41,6 +41,8 @@ fn processing(m: &Bound<'_, PyModule>) -> PyResult<()> {
4141 m. add_function ( wrap_pyfunction ! ( image, m) ?) ?;
4242 m. add_function ( wrap_pyfunction ! ( draw_geometry, m) ?) ?;
4343 m. add_function ( wrap_pyfunction ! ( create_directional_light, m) ?) ?;
44+ m. add_function ( wrap_pyfunction ! ( create_point_light, m) ?) ?;
45+ m. add_function ( wrap_pyfunction ! ( create_spot_light, m) ?) ?;
4446
4547 Ok ( ( ) )
4648}
@@ -236,3 +238,33 @@ fn create_directional_light(
236238) -> PyResult < Light > {
237239 get_graphics ( module) ?. light_directional ( r, g, b, illuminance)
238240}
241+
242+ #[ pyfunction]
243+ #[ pyo3( pass_module, signature = ( r, g, b, intensity, range, radius) ) ]
244+ fn create_point_light (
245+ module : & Bound < ' _ , PyModule > ,
246+ r : f32 ,
247+ g : f32 ,
248+ b : f32 ,
249+ intensity : f32 ,
250+ range : f32 ,
251+ radius : f32 ,
252+ ) -> PyResult < Light > {
253+ get_graphics ( module) ?. light_point ( r, g, b, intensity, range, radius)
254+ }
255+
256+ #[ pyfunction]
257+ #[ pyo3( pass_module, signature = ( r, g, b, intensity, range, radius, inner_angle, outer_angle) ) ]
258+ fn create_spot_light (
259+ module : & Bound < ' _ , PyModule > ,
260+ r : f32 ,
261+ g : f32 ,
262+ b : f32 ,
263+ intensity : f32 ,
264+ range : f32 ,
265+ radius : f32 ,
266+ inner_angle : f32 ,
267+ outer_angle : f32 ,
268+ ) -> PyResult < Light > {
269+ get_graphics ( module) ?. light_spot ( r, g, b, intensity, range, radius, inner_angle, outer_angle)
270+ }
0 commit comments