changeset 9988:a32fb6812221

bigendian fix by (Samuel Kleiner <kleiner at cd dot chalmers dot se>)
author michael
date Fri, 25 Apr 2003 17:22:11 +0000
parents 988c2ffc5bc1
children 98791b90215a
files postproc/rgb2rgb_template.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/postproc/rgb2rgb_template.c	Fri Apr 25 17:16:55 2003 +0000
+++ b/postproc/rgb2rgb_template.c	Fri Apr 25 17:22:11 2003 +0000
@@ -1340,9 +1340,15 @@
 	unsigned num_pixels = src_size >> 2;
 	for(i=0; i<num_pixels; i++)
 	{
-		dst[4*i + 0] = src[4*i + 2];
-		dst[4*i + 1] = src[4*i + 1];
-		dst[4*i + 2] = src[4*i + 0];
+#ifdef WORDS_BIGENDIAN  
+	  dst[4*i + 1] = src[4*i + 3];
+	  dst[4*i + 2] = src[4*i + 2];
+	  dst[4*i + 3] = src[4*i + 1];
+#else
+	  dst[4*i + 0] = src[4*i + 2];
+	  dst[4*i + 1] = src[4*i + 1];
+	  dst[4*i + 2] = src[4*i + 0];
+#endif
 	}
 #endif
 }