Fixed the red/green/red bug on two occasions. Changed from the custom

1999-12-08  Arjan van de Ven
<arjan@fenrus.demon.nl>

* gdk-pixbuf/gdk-pixbuf-drawable.c : Fixed
  the red/green/red bug on two occasions.
* gdk-pixbuf/io-ras.c: Changed from the custom
  be32_to_cpu function to the generic glib one.
This commit is contained in:
Arjan van de Ven 1999-12-08 21:37:17 +00:00 committed by Arjan van de Ven
parent c6f25c2de8
commit 880f5ade6b
3 changed files with 15 additions and 18 deletions

View File

@ -1,3 +1,10 @@
1999-12-08 Arjan van de Ven <arjan@fenrus.demon.nl>
* gdk-pixbuf/gdk-pixbuf-drawable.c : Fixed the red/green/red
bug on two occasions.
* gdk-pixbuf/io-ras.c: Changed from the custom be32_to_cpu
function to the generic glib one.
1999-12-08 Federico Mena Quintero <federico@redhat.com>
* gdk-pixbuf/gdk-pixbuf-drawable.c: Fix includes.

View File

@ -63,16 +63,6 @@ struct rasterfile {
be32_to_cpu() ??
*/
static unsigned int be32_to_cpu(guint i)
{
unsigned int i2;
i2 =
((i & 255) << 24) | (((i >> 8) & 255) << 16) |
(((i >> 16) & 255) << 8) | ((i >> 24) & 255);
return i2;
}
/* Progressive loading */
struct ras_progressive_state {
@ -142,12 +132,12 @@ GdkPixbuf *image_load(FILE * f)
static void RAS2State(struct rasterfile *RAS,
struct ras_progressive_state *State)
{
State->Header.width = be32_to_cpu(RAS->width);
State->Header.height = be32_to_cpu(RAS->height);
State->Header.depth = be32_to_cpu(RAS->depth);
State->Header.type = be32_to_cpu(RAS->type);
State->Header.maptype = be32_to_cpu(RAS->maptype);
State->Header.maplength = be32_to_cpu(RAS->maplength);
State->Header.width = GUINT32_FROM_BE(RAS->width);
State->Header.height = GUINT32_FROM_BE(RAS->height);
State->Header.depth = GUINT32_FROM_BE(RAS->depth);
State->Header.type = GUINT32_FROM_BE(RAS->type);
State->Header.maptype = GUINT32_FROM_BE(RAS->maptype);
State->Header.maplength = GUINT32_FROM_BE(RAS->maplength);
g_assert(State->Header.maplength <= 768); /* Otherwise, we are in trouble */

View File

@ -127,7 +127,7 @@ rgb1a (GdkImage *image, art_u8 *pixels, int rowstride)
remap[xx] = 0xff
| colormap->colors[xx].red << 24
| colormap->colors[xx].green << 16
| colormap->colors[xx].red << 8;
| colormap->colors[xx].blue << 8;
#endif
}
@ -221,7 +221,7 @@ rgb8a (GdkImage *image, art_u8 *pixels, int rowstride)
remap[xx] = 0xff
| colormap->colors[xx].red << 24
| colormap->colors[xx].green << 16
| colormap->colors[xx].red << 8;
| colormap->colors[xx].blue << 8;
#endif
}