def pixel.under

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

import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base

5338# The fast pixel: a constant packed front blended along the row, its
5339# channels split once per row.
5340def pixel.under(+fr: U32, +fg: U32, +fb: U32, +fa: U32, +keep: U32, +back: U32) -> U32:
5341  (fr + U32.div((U32.mod(back, 256) * keep + 127 : U32), 255) + (fg + U32.div((U32.mod(U32.div(back, 256), 256) * keep + 127 : U32), 255)) * 256
5342    + (fb + U32.div((U32.mod(U32.div(back, 65536), 256) * keep + 127 : U32), 255)) * 65536 + (fa + U32.div((U32.div(back, 16777216) * keep + 127 : U32), 255)) * 16777216 : U32)

Uses (5)

Used by (1)