def cover.bitmap.sized

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

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

4341def cover.bitmap.sized(+raster: Raster, +inv: Matrix, +nearest: Bool, +w: U32, +h: U32, +rw: U32, +rh: U32) -> Brush:
4342  U.branch(Brush, Bool.not(nearest) && (U32.is_lt(rw, w) || U32.is_lt(rh, h)),
4343    _ => Bitmap{raster.reduce(raster, rw, rh), matrix.mul(scale((U32.to_f32(rw) / U32.to_f32(w) : F32), (U32.to_f32(rh) / U32.to_f32(h) : F32)), inv), nearest},
4344    _ => Bitmap{raster, inv, nearest})

Uses (16)

Used by (1)