def cover.tile.pixels

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

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

4244def cover.tile.pixels(depth: Nat, +x: U32, +y: U32, +frame: Raster, +nodes: List<&2, Scene<Brush>>, +box: Bounds, +w: F32, +h: F32) -> Img.Pixels:
4245  match depth:
4246    case 0n:
4247      +center = cover.tile.center(frame, x, y, w, h)
4248      U.branch(Img.Pixels, raster.in.frame(frame, x, y) && bounds.inside(box, center, 0.01), _ => Img.Flat{sample(nodes, center, center, Img.clear(), False{}, 1.0)}, _ => Img.Flat{Img.clear()})
4249    case 1n+d:
4250      +dd = d
4251      +half = U32.shln(1, dd)
4252      U.branch(Img.Pixels, raster.in.frame(frame, x, y),
4253        _ => Img.pixels.join(cover.tile.pixels(dd, x, y, frame, nodes, box, w, h), cover.tile.pixels(dd, (x + half : U32), y, frame, nodes, box, w, h), cover.tile.pixels(dd, x, (y + half : U32), frame, nodes, box, w, h), cover.tile.pixels(dd, (x + half : U32), (y + half : U32), frame, nodes, box, w, h)),
4254        _ => Img.Flat{Img.clear()})

Uses (20)

Used by (1)