public void Render(RowIterator row, int x, int count, CoverageIterator covers, Color c) { byte dst = c.A; row.Move(x); for (int i = 0; i < count; i++) { int alpha = covers.Current * c.A; uint src = row[i]; row[i] = (byte)((((dst - src) * alpha) + (src << 16)) >> 16); covers.MoveNext(); } }
public void Render(RowIterator row, int x, int count, CoverageIterator covers, Color c) { row.Move(x + x + x); for (int i = 0; i < 3 * count; i += 3) { int alpha = covers.Current * c.A; int b = row[i + 0]; int g = row[i + 1]; int r = row[i + 2]; row[i + 0] = (byte)((((c.B - b) * alpha) + (b << 16)) >> 16); row[i + 1] = (byte)((((c.G - g) * alpha) + (g << 16)) >> 16); row[i + 2] = (byte)((((c.R - r) * alpha) + (r << 16)) >> 16); covers.MoveNext(); } }
public void Render(RowIterator row, int x, int count, CoverageIterator covers, Color c) { row.Move(x << 1); for (int i = 0; i < count << 1; i += 2) { ushort rgb = (ushort)(row[i + 0] | row[i + 1]); int alpha = covers.Current * c.A; int r = (rgb >> 7) & 0xF8; int g = (rgb >> 2) & 0xF8; int b = (rgb << 3) & 0xF8; int v = (((((c.R - r) * alpha) + (r << 16)) >> 9) & 0x7C00) | (((((c.G - g) * alpha) + (g << 16)) >> 14) & 0x3E0) | ((((c.B - b) * alpha) + (b << 16)) >> 19); row[i + 0] = (byte)(v >> 8); row[i + 1] = (byte)(v & 0xFF); covers.MoveNext(); } }