[SDL] Blitting
David Olofson
david at olofson.net
Wed Feb 12 10:51:01 PST 2003
On Wednesday 12 February 2003 19.25, David Olofson wrote:
[...]
Uhm, just in case you didn't notice:
> /* Calculate filter core */
> x -= 8;
> y -= 8;
This is a (-.5, -.5) pixel offset, to compensate for the fact that
interpolation is done from a grid of infinitely small pixels, while
output is to a grid of full size pixels. Without this, you'd get
images shifted half a pixel to the left and half a pixel up.
(Source/scaled pixels, that is.)
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`---------------------------> http://olofson.net/audiality -'
--- http://olofson.net --- http://www.reologica.se ---
More information about the SDL
mailing list