Merge from gdk-pixbuf stable.

2002-01-25  Federico Mena Quintero  <federico@ximian.com>

	Merge from gdk-pixbuf stable.

	* gdk-pixbuf-xlib-drawable.c (rgb565msb): Fixed the endianness
	conversion --- swap the individual 16 bit values instead of taking
	everying as a 32 bit value.
	(rgb565lsb): Likewise.
	(rgb555lsb): Likewise.
	(rgb555msb): Likewise.
This commit is contained in:
Federico Mena Quintero 2002-01-25 21:38:13 +00:00 committed by Federico Mena Quintero
parent 165e970296
commit 2ca60b920b
2 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,14 @@
2002-01-25 Federico Mena Quintero <federico@ximian.com>
Merge from gdk-pixbuf stable.
* gdk-pixbuf-xlib-drawable.c (rgb565msb): Fixed the endianness
conversion --- swap the individual 16 bit values instead of taking
everying as a 32 bit value.
(rgb565lsb): Likewise.
(rgb555lsb): Likewise.
(rgb555msb): Likewise.
2001-11-26 Akira TAGOH <tagoh@redhat.com>
* Makefile.am (libgdk_pixbuf_xlib_1_3_la_LDFLAGS):

View File

@ -365,7 +365,7 @@ rgb565lsb (XImage *image, guchar *pixels, int rowstride, xlib_colormap *colormap
| (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10;
#else
/* swap endianness first */
data = s[0] | s[1] << 8 | s[2] << 16 | s[3] << 24;
data = s[1] | s[0] << 8 | s[3] << 16 | s[2] << 24;
s += 4;
*o++ = (data & 0xf800) | (data & 0xe000) >> 5
| (data & 0x7e0) >> 3 | (data & 0x600) >> 9;
@ -428,7 +428,7 @@ rgb565msb (XImage *image, guchar *pixels, int rowstride, xlib_colormap *colormap
register guint32 data;
#ifdef LITTLE
/* swap endianness first */
data = s[0] | s[1] << 8 | s[2] << 16 | s[3] << 24;
data = s[1] | s[0] << 8 | s[3] << 16 | s[2] << 24;
s += 4;
*o++ = (data & 0xf800) >> 8 | (data & 0xe000) >> 13
| (data & 0x7e0) << 5 | (data & 0x600) >> 1;
@ -617,7 +617,7 @@ rgb555lsb (XImage *image, guchar *pixels, int rowstride, xlib_colormap *colormap
| (data & 0x1f0000) >> 5 | (data & 0x1c0000) >> 10;
#else
/* swap endianness first */
data = s[0] | s[1] << 8 | s[2] << 16 | s[3] << 24;
data = s[1] | s[0] << 8 | s[3] << 16 | s[2] << 24;
s += 4;
*o++ = (data & 0x7c00) << 1 | (data & 0x7000) >> 4
| (data & 0x3e0) >> 2 | (data & 0x380) >> 7;
@ -676,7 +676,7 @@ rgb555msb (XImage *image, guchar *pixels, int rowstride, xlib_colormap *colormap
register guint32 data;
#ifdef LITTLE
/* swap endianness first */
data = s[0] | s[1] << 8 | s[2] << 16 | s[3] << 24;
data = s[1] | s[0] << 8 | s[3] << 16 | s[2] << 24;
s += 4;
*o++ = (data & 0x7c00) >> 7 | (data & 0x7000) >> 12
| (data & 0x3e0) << 6 | (data & 0x380) << 1;