def filter.convolution.limits.box

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

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

4958def filter.convolution.limits.box(+raster: Raster, box: Bounds) -> Bounds:
4959  Raster{Point{ox, oy}, step, width, height, depth, stored, pixels} = raster
4960  Bounds{x0, y0, x1, y1} = box
4961  Bounds{U.max(0.0, F32.floor(((x0 - ox) / step : F32))), U.max(0.0, F32.floor(((y0 - oy) / step : F32))), U.min(U32.to_f32(width), F32.ceil(((x1 - ox) / step : F32))), U.min(U32.to_f32(height), F32.ceil(((y1 - oy) / step : F32)))}

Uses (11)

Used by (1)