The `res` argument is a combination of resolution and shifting, combined using `(y << 4) | x`. To yield x, `0x0F` should have been used.