1use crate::Blender;
2use skia_bindings as sb;
3
4impl Blender {
5 pub fn arithmetic(k1: f32, k2: f32, k3: f32, k4: f32, enforce_premul: bool) -> Option<Blender> {
6 arithmetic(k1, k2, k3, k4, enforce_premul)
7 }
8}
9
10/// Create a blender that implements the following:
11/// `k1 * src * dst + k2 * src + k3 * dst + k4`
12///
13/// - `k1`, `k2`, `k3`, `k4` The four coefficients.
14/// - `enforce_premul` If `true`, the RGB channels will be clamped to the calculated alpha.
15pub fn arithmetic(k1: f32, k2: f32, k3: f32, k4: f32, enforce_premul: bool) -> Option<Blender> {
16 Blender::from_ptr(unsafe { sb::C_SkBlenders_Arithmetic(k1, k2, k3, k4, enforcePremul:enforce_premul) })
17}
18