def filter.convolution.index

gralha-svg-render@0.1.0.1 · svg.bend:4658

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

4658def filter.convolution.index(+n: F32, +low: F32, +high: F32, edge: U32) -> F32:
4659  +length = U.max((high - low : F32), 1.0)
4660  U.choose(F32, U32.is_eq(edge, 1), (low + (n - low) - F32.floor(((n - low) / length : F32)) * length : F32), U.clamp(n, low, (high - 1.0 : F32)))

Uses (11)

Used by (1)