try some better default offsets for big endian machines.

print what the conversion is so i can see what it should be if im wrong though
This commit is contained in:
Dana Jansens 2003-07-05 17:01:30 +00:00
parent 41d72ee51f
commit ce940eee0f
2 changed files with 8 additions and 4 deletions

View file

@ -75,6 +75,10 @@ void RrReduceDepth(const RrInstance *inst, RrPixel32 *data, XImage *im)
if ((RrRedOffset(inst) != RrDefaultRedOffset) ||
(RrBlueOffset(inst) != RrDefaultBlueOffset) ||
(RrGreenOffset(inst) != RrDefaultGreenOffset)) {
g_message("CONVERSION %d->%d %d->%d %d->%d",
RrDefaultRedOffset, RrRedOffset(inst),
RrDefaultBlueOffset, RrGreenOffset(inst),
RrDefaultGreenOffset, RrBlueOffset(inst));
for (y = 0; y < im->height; y++) {
for (x = 0; x < im->width; x++) {
r = (data[x] >> RrDefaultRedOffset) & 0xFF;

View file

@ -128,10 +128,10 @@ struct _RrAppearance {
};
#if (G_BYTE_ORDER == G_BIG_ENDIAN)
#define RrDefaultRedOffset 0
#define RrDefaultGreenOffset 8
#define RrDefaultBlueOffset 16
#define RrDefaultAlphaOffset 24
#define RrDefaultAlphaOffset 0
#define RrDefaultRedOffset 8
#define RrDefaultGreenOffset 16
#define RrDefaultBlueOffset 24
#define RrEndian MSBFirst
#else
#define RrDefaultAlphaOffset 24