skia_safe/modules/svg/fe/
light_source.rs

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
use crate::{
    impl_default_make,
    prelude::*,
    scalar,
    svg::{DebugAttributes, NodeSubtype},
};
use skia_bindings as sb;

pub type DistantLight = RCHandle<sb::SkSVGFeDistantLight>;

impl NodeSubtype for sb::SkSVGFeDistantLight {
    type Base = sb::SkSVGContainer;
}

impl_default_make!(DistantLight, sb::C_SkSVGFeDistantLight_Make);

impl DebugAttributes for DistantLight {
    const NAME: &'static str = "FeDistantLight";

    fn _dbg(&self, builder: &mut std::fmt::DebugStruct) {
        self.as_base()._dbg(
            builder
                .field("azimuth", &self.azimuth())
                .field("elevation", &self.elevation()),
        );
    }
}

impl DistantLight {
    skia_svg_macros::attrs! {
        SkSVGFeDistantLight => {
            *azimuth: scalar [get(value) => value, set(value) => value],
            *elevation: scalar [get(value) => value, set(value) => value]
        }
    }
}

pub type PointLight = RCHandle<sb::SkSVGFePointLight>;

impl NodeSubtype for sb::SkSVGFePointLight {
    type Base = sb::SkSVGContainer;
}

impl_default_make!(PointLight, sb::C_SkSVGFePointLight_Make);

impl DebugAttributes for PointLight {
    const NAME: &'static str = "FePointLight";

    fn _dbg(&self, builder: &mut std::fmt::DebugStruct) {
        self.as_base()._dbg(
            builder
                .field("x", &self.x())
                .field("y", &self.y())
                .field("z", &self.z()),
        );
    }
}

impl PointLight {
    skia_svg_macros::attrs! {
        SkSVGFePointLight => {
            *x: scalar [get(value) => value, set(value) => value],
            *y: scalar [get(value) => value, set(value) => value],
            *z: scalar [get(value) => value, set(value) => value]
        }
    }
}

pub type SpotLight = RCHandle<sb::SkSVGFeSpotLight>;

impl NodeSubtype for sb::SkSVGFeSpotLight {
    type Base = sb::SkSVGContainer;
}

impl_default_make!(SpotLight, sb::C_SkSVGFeSpotLight_Make);

impl DebugAttributes for SpotLight {
    const NAME: &'static str = "FeSpotLight";

    fn _dbg(&self, builder: &mut std::fmt::DebugStruct) {
        self.as_base()._dbg(
            builder
                .field("x", &self.x())
                .field("y", &self.y())
                .field("z", &self.z())
                .field("points_at_x", &self.points_at_x())
                .field("points_at_y", &self.points_at_y())
                .field("points_at_z", &self.points_at_z())
                .field("specular_exponent", &self.specular_exponent())
                .field("limiting_cone_angle", &self.limiting_cone_angle()),
        );
    }
}

impl SpotLight {
    skia_svg_macros::attrs! {
        SkSVGFeSpotLight => {
            *x: scalar [get(value) => value, set(value) => value],
            *y: scalar [get(value) => value, set(value) => value],
            *z: scalar [get(value) => value, set(value) => value],
            *points_at_x: scalar [get(value) => value, set(value) => value],
            *points_at_y: scalar [get(value) => value, set(value) => value],
            *points_at_z: scalar [get(value) => value, set(value) => value],
            *specular_exponent: scalar [get(value) => value, set(value) => value],
            *limiting_cone_angle?: scalar [get(value) => value, set(value) => value]
        }
    }
}