def filter.draw.tiles

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

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

4798def filter.draw.tiles(depth: Nat, +x: U32, +y: U32, +format: Raster, +op: FilterOp, +a: FilterInput, +b: FilterInput, +window: FilterWindow, +linear: Bool, +aa: U32) -> Img.Pixels:
4799  match depth:
4800    case 0n:
4801      +span = filter.window.span(window, raster.tile.box(format, x, y, 1))
4802      U.branch(Img.Pixels, raster.in.frame(format, x, y) && Bool.not(U32.is_eq(span, 0)),
4803        _ => filter.draw.pixel(format, x, y, op, a, b, window, linear, aa, span), _ => Img.Flat{Img.clear()})
4804    case 1n+d:
4805      +dd = d
4806      +half = U32.shln(1, dd)
4807      +span = filter.window.span(window, raster.tile.box(format, x, y, (half * 2 : U32)))
4808      U.branch(Img.Pixels, raster.in.frame(format, x, y) && Bool.not(U32.is_eq(span, 0)),
4809        _ => Img.pixels.join(filter.draw.tiles(dd, x, y, format, op, a, b, window, linear, aa), filter.draw.tiles(dd, (x + half : U32), y, format, op, a, b, window, linear, aa), filter.draw.tiles(dd, x, (y + half : U32), format, op, a, b, window, linear, aa), filter.draw.tiles(dd, (x + half : U32), (y + half : U32), format, op, a, b, window, linear, aa)), _ => Img.Flat{Img.clear()})

Uses (21)

Used by (1)