def filter.convolution.raw
gralha-svg-render@0.1.0.1 · svg.bend:4662
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
4662def filter.convolution.raw(+input: FilterInput, x: F32, y: F32, +linear: Bool) -> Img.Color:
4663 FilterInput{raster, region, alpha, standard} = input
4664 +stored = raster.is.linear(raster)
4665 +c = raster.pixel(raster, x, y)
4666 +converted = U.branch(Img.Color, U.choose(Bool, stored, linear, Bool.not(linear)), _ => c,
4667 _ => U.branch(Img.Color, stored, _ => color.from.linear(c), _ => color.space(c, True{})))
4668 U.choose(Img.Color, alpha, color.alpha.only(converted), converted)