[poppler] poppler/qt4/src: poppler-page.cc,1.22,1.23

Albert Astals Cid aacid at kemper.freedesktop.org
Sun May 21 11:14:17 PDT 2006


Update of /cvs/poppler/poppler/qt4/src
In directory kemper:/tmp/cvs-serv8574/qt4/src

Modified Files:
	poppler-page.cc 
Log Message:
fix all is blue issue on ppc machines


Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-page.cc,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- poppler-page.cc	12 May 2006 21:02:01 -0000	1.22
+++ poppler-page.cc	21 May 2006 18:14:15 -0000	1.23
@@ -69,6 +69,23 @@
   int bh = bitmap->getHeight();
   
   SplashColorPtr dataPtr = output_dev->getBitmap()->getDataPtr();
+  
+  if (QSysInfo::BigEndian == QSysInfo::ByteOrder)
+  {
+    uchar c;
+    int count = bw * bh * 4;
+    for (int k = 0; k < count; k += 4)
+    {
+      c = dataPtr[k];
+      dataPtr[k] = dataPtr[k+3];
+      dataPtr[k+3] = c;
+
+      c = dataPtr[k+1];
+      dataPtr[k+1] = dataPtr[k+2];
+      dataPtr[k+2] = c;
+    }
+  }
+  
   // construct a qimage SHARING the raw bitmap data in memory
   QImage img( dataPtr, bw, bh, QImage::Format_ARGB32 );
   img = img.copy();



More information about the poppler mailing list