Pixel Calculations (bits)

Started by
-1 comments, last by Big Al 23 years, 9 months ago
Okay, I have recently been implementing a pixel calculating routine for 16-bit surfaces. Okay Now I have set it up to do this: To take the most important bits and dump the least important bits. #define RGBG16(r, g, b) (((((WORD)r >> objDD.RGBDetails.RedRightBitShift) & objDD.RGBDetails.RedANDMask) << objDD.RGBDetails.RedLeftBitShift) + ((((WORD)g >> objDD.RGBDetails.GreenRightBitShift) & objDD.RGBDetails.GreenANDMask) << objDD.RGBDetails.GreenLeftBitShift) + ((((WORD)b >> objDD.RGBDetails.BlueRightBitShift) & objDD.RGBDetails.BlueANDMask) << objDD.RGBDetails.BlueLeftBitShift)) Note that I changed OR''s to +''s. Is this better than just accepting the lower bits or can I have a comprimise?

This topic is closed to new replies.

Advertisement