Dither
The Pixel Engine uses a 4×4 perfect-magic-square matrix when DstMode.DitherEnable is set.
| Y / X | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 0 | 0 | 12 | 3 | 15 |
| 1 | 7 | 11 | 4 | 8 |
| 2 | 13 | 1 | 14 | 2 |
| 3 | 10 | 6 | 9 | 5 |
DitherOffset adds two-bit offsets to the low two integer bits of X and Y, modulo four. This preserves the dither pattern when a window moves.
Let d be the selected matrix value. The reduced-width component calculations are:
Color6 = min(Color8 + (d >> 2), 255) >> 2 Color5 = min(Color8 + (d >> 1), 255) >> 3 Color4 = min(Color8 + d, 255) >> 4 Color3 = min(Color8 + (d << 1), 255) >> 5 Color2 = min(Color8 + (d << 2), 255) >> 6
Sources: Technical Spec, p.34, Technical Spec, p.35