def filter.convolution.sum
gralha-svg-render@0.1.0.1 · svg.bend:4694
import gralha-svg-render@0.1.0.1/svg.bend as Svg
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
4694def filter.convolution.sum(xs: List<&2, FilterTap>, +input: FilterInput, +limits: Bounds, +edge: U32, +preserve: Bool, +p: Point, +linear: Bool, acc: Img.Color) -> Img.Color:
4695 match xs:
4696 case Nil{}: acc
4697 case Con{FilterTap{delta, weight}, rest}:
4698 +sample = filter.convolution.color(input, limits, edge, point.add(p, delta), linear)
4699 filter.convolution.sum(rest, input, limits, edge, preserve, p, linear, color.add(acc, color.fade(U.choose(Img.Color, preserve, color.straight(sample), sample), weight)))