Index: image-private.h =================================================================== --- image-private.h (revision 3595) +++ image-private.h (working copy) @@ -78,6 +78,16 @@ return((unsigned char) (((color) << 2) | ((color) >> 4))); } +static inline unsigned long ScaleColor8to5(const unsigned char color) +{ + return((unsigned long) (((color) & ~0x07) >> 3)); +} + +static inline unsigned long ScaleColor8to6(const unsigned char color) +{ + return((unsigned long) (((color) & ~0x03) >> 2)); +} + #if defined(__cplusplus) || defined(c_plusplus) } #endif