Svg.pixel.over: def of gralha-svg-render@0.1.0.1 Import: import gralha-svg-render@0.1.0.1/svg.bend as Svg Lines 5165-5177 of gralha-svg-render@0.1.0.1/svg.bend: https://jend.leeeet.dev/read.txt?path=gralha-svg-render@0.1.0.1/svg.bend&start_line=5165&end_line=5177 import Base # front over back, both premultiplied: front + back * (255 - alpha) / 255 per # channel, written as one expression over the four lanes. def pixel.over(+front: U32, +back: U32) -> U32: +fa = U32.div(front, 16777216) +keep = (255 - fa : U32) +fb = U32.mod(U32.div(front, 65536), 256) +fg = U32.mod(U32.div(front, 256), 256) +fr = U32.mod(front, 256) +ba = U32.div(back, 16777216) +bb = U32.mod(U32.div(back, 65536), 256) +bg = U32.mod(U32.div(back, 256), 256) +br = U32.mod(back, 256) (fr + U32.div((br * keep + 127 : U32), 255) + (fg + U32.div((bg * keep + 127 : U32), 255)) * 256 + (fb + U32.div((bb * keep + 127 : U32), 255)) * 65536 + (fa + U32.div((ba * keep + 127 : U32), 255)) * 16777216 : U32) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mod https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub