4 ms·
((width * bytes_per_pixel)+3&~3) anyone? Can't remember how many times I've done that for Windows bitmap stride. WORD/DWORD/QWORD alignment was something I had
by shdon 14y ago
((width * bytes_per_pixel)+3&~3) anyone? Can't remember how many times I've done that for Windows bitmap stride. WORD/DWORD/QWORD alignment was something I had to do frequently in C or C++ code. Even fixed point math for speed in the really old days.
- zerr 14y agohehe, also sin/cos tables ;)
- dspeyer 14y agoThat's a code snippet where extra parenthesis might help. The first several times I read it as: ((width * bytes_per_pixel)+(3&~3)) and thought "what's the point?" I don't know why bitwise ops are so low precedence. They've always felt more like multiplication to me.