New answers tagged

4

This code is converting from premultiplied alpha: Expanding one of the assignments by substituting for divAlpha: var r = (byte) (color.R*(0xff00/color.A) >> 8); which on rearrangement of the multiplicative terms becomes var r = (byte) ((color.R*(0xff00) >> 8)/color.A); which in turn simplifies to: var r = (byte) (color.R*0xff /color.A); ...



Top 50 recent answers are included