Svg.filter.composite: def of gralha-svg-render@0.1.0.1 Import: import gralha-svg-render@0.1.0.1/svg.bend as Svg Lines 4536-4543 of gralha-svg-render@0.1.0.1/svg.bend: https://jend.leeeet.dev/read.txt?path=gralha-svg-render@0.1.0.1/svg.bend&start_line=4536&end_line=4543 import Base import gralha-text-scan@0.1.0.1/scan.bend as U import gralha-image@0.1.0.1/image.bend as Img def filter.composite(+a: Img.Color, +b: Img.Color, +kind: U32, +k1: F32, +k2: F32, +k3: F32, +k4: F32) -> Img.Color: Img.Color{ar, ag, ab, aa} = a Img.Color{br, bg, bb, ba} = b U.branch(Img.Color, U32.is_eq(kind, 5), _ => color.premul.clamp(Img.Color{filter.arithmetic(ar, br, k1, k2, k3, k4), filter.arithmetic(ag, bg, k1, k2, k3, k4), filter.arithmetic(ab, bb, k1, k2, k3, k4), filter.arithmetic(aa, ba, k1, k2, k3, k4)}), _ => U.branch(Img.Color, U32.is_eq(kind, 1), _ => color.fade(a, ba), _ => U.branch(Img.Color, U32.is_eq(kind, 2), _ => color.fade(a, (1.0 - ba : F32)), _ => U.branch(Img.Color, U32.is_eq(kind, 3), _ => color.add(color.fade(a, ba), color.fade(b, (1.0 - aa : F32))), _ => U.branch(Img.Color, U32.is_eq(kind, 4), _ => color.add(color.fade(a, (1.0 - ba : F32)), color.fade(b, (1.0 - aa : F32))), _ => color.over(a, b)))))) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=gralha-image@0.1.0.1/image.bend&name=Color https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=color.add https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=color.fade https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=color.over https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=color.premul.clamp https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=filter.arithmetic https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch