[poppler] poppler/qt: poppler-page.cc,1.14,1.15

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


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

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


Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt/poppler-page.cc,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- poppler-page.cc	4 Apr 2006 21:01:01 -0000	1.14
+++ poppler-page.cc	21 May 2006 18:14:15 -0000	1.15
@@ -77,6 +77,23 @@
   int bw = output_dev->getBitmap()->getWidth();
   int bh = output_dev->getBitmap()->getHeight();
   SplashColorPtr dataPtr = output_dev->getBitmap()->getDataPtr();
+  
+  if (QImage::BigEndian == QImage::systemByteOrder())
+  {
+    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, 32, 0, 0, QImage::IgnoreEndian );
   img = img.copy();



More information about the poppler mailing list