summaryrefslogtreecommitdiff
path: root/gdk/gdkpixbuf-drawable.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2002-07-16 17:18:09 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2002-07-16 17:18:09 +0000
commit8e5a691115baed7b9ff1a3fd617aad6bee1514b6 (patch)
tree0b4e79b94898c498aa204d066b67ce379420c7da /gdk/gdkpixbuf-drawable.c
parent2f57f4684ba1945e7bdf87c8ecea4a6e926cf223 (diff)
downloadgtk+-8e5a691115baed7b9ff1a3fd617aad6bee1514b6.tar.gz
Fixed the LSB -> MSB case. Fixes #79463.
2002-07-16 Federico Mena Quintero <federico@ximian.com> * gdk/gdkpixbuf-drawable.c (rgb565lsb): Fixed the LSB -> MSB case. Fixes #79463.
Diffstat (limited to 'gdk/gdkpixbuf-drawable.c')
-rw-r--r--gdk/gdkpixbuf-drawable.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gdk/gdkpixbuf-drawable.c b/gdk/gdkpixbuf-drawable.c
index ddf3458fdd..ca25768aeb 100644
--- a/gdk/gdkpixbuf-drawable.c
+++ b/gdk/gdkpixbuf-drawable.c
@@ -437,14 +437,15 @@ rgb565lsb (GdkImage *image,
| (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10;
#else
/* swap endianness first */
- data = s[1] | s[0] << 8 | s[3] << 16 | s[2] << 24;
+ data = s[1] << 24 | s[0] << 16 | s[3] << 8 | s[2];
s += 4;
- *o++ = (data & 0xf800) | (data & 0xe000) >> 5
- | (data & 0x7e0) >> 3 | (data & 0x600) >> 9;
- *o++ = (data & 0x1f) << 11 | (data & 0x1c) << 6
- | (data & 0xf8000000) >> 24 | (data & 0xe0000000) >> 29;
- *o++ = (data & 0x7e00000) >> 11 | (data & 0x6000000) >> 17
- | (data & 0x1f0000) >> 13 | (data & 0x1c0000) >> 18;
+
+ *o++ = (data & 0xf8000000) >> 16 | (data & 0xe0000000) >> 21
+ | (data & 0x7e00000) >> 19 | (data & 0x6000000) >> 25;
+ *o++ = (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10
+ | (data & 0xf800) >> 8 | (data & 0xe000) >> 13;
+ *o++ = (data & 0x7e0) << 5 | (data & 0x600) >> 1
+ | (data & 0x1f) << 3 | (data & 0x1c) >> 2;
#endif
}
/* check for last remaining pixel */