149 |
return out; |
return out; |
150 |
} |
} |
151 |
|
|
152 |
#define BSWAP16(x) x = (((x & 0xff) << 8) | (x >> 8)); |
#define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); } |
153 |
#define BSWAP24(x) x = (((x & 0xff) << 16) | (x >> 16) | ((x >> 8) & 0xff00)); |
#define BSWAP24(x) { x = (((x & 0xff) << 16) | (x >> 16) | ((x >> 8) & 0xff00)); } |
154 |
#define BSWAP32(x) x = (((x & 0xff00ff) << 8) | ((x >> 8) & 0xff00ff)); \ |
#define BSWAP32(x) { x = (((x & 0xff00ff) << 8) | ((x >> 8) & 0xff00ff)); \ |
155 |
x = (x << 16) | (x >> 16); |
x = (x << 16) | (x >> 16); } |
156 |
|
|
157 |
static uint32 |
static uint32 |
158 |
translate_colour(uint32 colour) |
translate_colour(uint32 colour) |
714 |
MAKE_XCOLOR(&xentry, entry); |
MAKE_XCOLOR(&xentry, entry); |
715 |
|
|
716 |
if (XAllocColor(display, xcolmap, &xentry) != 0) |
if (XAllocColor(display, xcolmap, &xentry) != 0) |
717 |
colour = translate_colour(xentry.pixel); |
colour = xentry.pixel; |
718 |
else |
else |
719 |
colour = translate_colour(white); |
colour = white; |
720 |
|
|
721 |
/* byte swap here to make translate_image faster */ |
/* byte swap here to make translate_image faster */ |
722 |
map[i] = translate_colour(colour); |
map[i] = translate_colour(colour); |