4 ms·
The algorithm to rotate images can be illustrated by running /usr/lib/xscreensaver/blitspin blitspin - rotate a bitmap in an interesting way The blitspin
by teddyh 10y ago
The algorithm to rotate images can be illustrated by running
/usr/lib/xscreensaver/blitspin
blitspin - rotate a bitmap in an interesting way
The blitspin program repeatedly rotates a bitmap by 90 degrees by using logical operations: the bitmap is divided into quadrants, and the quad‐ rants are shifted clockwise. Then the same thing is done again with progressively smaller quadrants, except that all sub-quadrants of a given size are rotated in parallel. So this takes O(16×log2(N)) blits of size NxN, with the limitation that the image must be square, and the size must be a power of 2.
Movie here, for those without XScreenSaver installed:
https://www.youtube.com/watch?v=UTtcwb-UWW8 https://www.youtube.com/watch?v=UTtcwb-UWW8
- braythwayt 10y agoThanks, I have included the video and a credit to you in the essay.