Tuesday, 16 January 2007

Bitmaps | Bit Arrays - Part2

I was going to write an article on wikipedia about bitmaps. But came across this article on Bit Arrays.. ala Bitmaps after a little searching beyond raster graphics. Gotta love that wikipedia.

It's well worth the time learning how it all works and I've created the toggle macro for you:

#define bitmap_toggle(bitmap, i) bitmap[i/8]~=(1<<(i%8))

No comments: