skia_safe/modules/svg/fe/
blend.rs

1use super::{DebugAttributes, Input, NodeSubtype};
2use crate::{impl_default_make, prelude::*};
3use skia_bindings as sb;
4
5pub type BlendMode = sb::SkSVGFeBlend_Mode;
6variant_name!(BlendMode::Multiply);
7
8pub type Blend = RCHandle<sb::SkSVGFeBlend>;
9
10impl NodeSubtype for sb::SkSVGFeBlend {
11    type Base = sb::SkSVGFe;
12}
13
14impl_default_make!(Blend, sb::C_SkSVGFeBlend_Make);
15
16impl DebugAttributes for Blend {
17    const NAME: &'static str = "FeBlend";
18
19    fn _dbg(&self, builder: &mut std::fmt::DebugStruct) {
20        self.as_base()._dbg(
21            builder
22                .field("input2", self.input2())
23                .field("mode", self.mode()),
24        );
25    }
26}
27
28impl Blend {
29    skia_svg_macros::attrs! {
30        SkSVGFeBlend => {
31            "in2" as input2: Input [get(value) => Input::from_native_ref(value), set(value) => value.into_native()],
32            mode: BlendMode [get(value) => value, set(value) => value]
33        }
34    }
35}
36
37#[cfg(test)]
38mod tests {
39    use super::Blend;
40
41    #[test]
42    pub fn create() {
43        let blend = Blend::default();
44        println!("{blend:?}");
45    }
46}