[poppler] poppler/splash: Splash.cc, 1.12, 1.13 SplashBitmap.cc, 1.6, 1.7 SplashTypes.h, 1.6, 1.7

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Apr 28 16:26:02 PDT 2007


Update of /cvs/poppler/poppler/splash
In directory kemper:/tmp/cvs-serv26437/splash

Modified Files:
	Splash.cc SplashBitmap.cc SplashTypes.h 
Log Message:
        * poppler/SplashOutputDev.cc:
        * qt/poppler-private.h:
        * qt4/src/poppler-private.h:
        * splash/Splash.cc:
        * splash/SplashBitmap.cc:
        * splash/SplashTypes.h: Rename splashModeRGBX8 to splashModeXBGR8 and
        hopefully fix qt frontends image generation


Index: Splash.cc
===================================================================
RCS file: /cvs/poppler/poppler/splash/Splash.cc,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- Splash.cc	28 Apr 2007 22:12:22 -0000	1.12
+++ Splash.cc	28 Apr 2007 23:25:59 -0000	1.13
@@ -84,6 +84,7 @@
   splashPipeResultColorNoAlphaBlendMono,
   splashPipeResultColorNoAlphaBlendMono,
   splashPipeResultColorNoAlphaBlendRGB,
+  splashPipeResultColorNoAlphaBlendRGB,
   splashPipeResultColorNoAlphaBlendRGB
 #if SPLASH_CMYK
   ,
@@ -95,6 +96,7 @@
   splashPipeResultColorAlphaNoBlendMono,
   splashPipeResultColorAlphaNoBlendMono,
   splashPipeResultColorAlphaNoBlendRGB,
+  splashPipeResultColorNoAlphaBlendRGB,
   splashPipeResultColorAlphaNoBlendRGB
 #if SPLASH_CMYK
   ,
@@ -106,6 +108,7 @@
   splashPipeResultColorAlphaBlendMono,
   splashPipeResultColorAlphaBlendMono,
   splashPipeResultColorAlphaBlendRGB,
+  splashPipeResultColorNoAlphaBlendRGB,
   splashPipeResultColorAlphaBlendRGB
 #if SPLASH_CMYK
   ,
@@ -253,10 +256,10 @@
       *pipe->destColorPtr++ = pipe->cSrc[1];
       *pipe->destColorPtr++ = pipe->cSrc[2];
       break;
-    case splashModeRGBX8:
-      *pipe->destColorPtr++ = pipe->cSrc[0];
-      *pipe->destColorPtr++ = pipe->cSrc[1];
+    case splashModeXBGR8:
       *pipe->destColorPtr++ = pipe->cSrc[2];
+      *pipe->destColorPtr++ = pipe->cSrc[1];
+      *pipe->destColorPtr++ = pipe->cSrc[0];
       *pipe->destColorPtr++ = 255;
       break;
     case splashModeBGR8:
@@ -293,10 +296,10 @@
       cDest[1] = pipe->destColorPtr[1];
       cDest[2] = pipe->destColorPtr[2];
       break;
-    case splashModeRGBX8:
-      cDest[0] = pipe->destColorPtr[0];
+    case splashModeXBGR8:
+      cDest[0] = pipe->destColorPtr[2];
       cDest[1] = pipe->destColorPtr[1];
-      cDest[2] = pipe->destColorPtr[2];
+      cDest[2] = pipe->destColorPtr[0];
       cDest[3] = 255;
       break;
     case splashModeBGR8:
@@ -519,10 +522,10 @@
       *pipe->destColorPtr++ = cResult1;
       *pipe->destColorPtr++ = cResult2;
       break;
-    case splashModeRGBX8:
-      *pipe->destColorPtr++ = cResult0;
-      *pipe->destColorPtr++ = cResult1;
+    case splashModeXBGR8:
       *pipe->destColorPtr++ = cResult2;
+      *pipe->destColorPtr++ = cResult1;
+      *pipe->destColorPtr++ = cResult0;
       *pipe->destColorPtr++ = 255;
       break;
     case splashModeBGR8:
@@ -567,7 +570,7 @@
   case splashModeBGR8:
     pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x];
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 4 * x];
     break;
 #if SPLASH_CMYK
@@ -609,7 +612,7 @@
   case splashModeBGR8:
     pipe->destColorPtr += 3;
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     pipe->destColorPtr += 4;
     break;
 #if SPLASH_CMYK
@@ -1087,7 +1090,7 @@
       }
     }
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     if (color[0] == color[1] && color[1] == color[2]) {
       if (bitmap->rowSize < 0) {
 	memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
@@ -1100,9 +1103,9 @@
       for (y = 0; y < bitmap->height; ++y) {
 	p = row;
 	for (x = 0; x < bitmap->width; ++x) {
-	  *p++ = color[2];
-	  *p++ = color[1];
 	  *p++ = color[0];
+	  *p++ = color[1];
+	  *p++ = color[2];
 	  *p++ = 255;
 	}
 	row += bitmap->rowSize;
@@ -2144,8 +2147,8 @@
     ok = srcMode == splashModeRGB8;
     nComps = 3;
     break;
-  case splashModeRGBX8:
-    ok = srcMode == splashModeRGBX8;
+  case splashModeXBGR8:
+    ok = srcMode == splashModeXBGR8;
     nComps = 4;
     break;
   case splashModeBGR8:
@@ -2486,9 +2489,8 @@
 	}
 	break;
 
-      case splashModeRGBX8:
+      case splashModeXBGR8:
 	for (x = 0; x < scaledWidth; ++x) {
-
 	  // x scale Bresenham
 	  xStep = xp;
 	  xt += xq;
@@ -2817,7 +2819,7 @@
 	}
 	break;
 
-      case splashModeRGBX8:
+      case splashModeXBGR8:
 	for (x = 0; x < scaledWidth; ++x) {
 
 	  // x scale Bresenham
@@ -3067,7 +3069,7 @@
       }
     }
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     color0 = color[0];
     color1 = color[1];
     color2 = color[2];
@@ -3161,7 +3163,7 @@
       }
     }
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     for (y = 0; y < h; ++y) {
       p = &bitmap->data[(yDest + y) * bitmap->rowSize + 4 * xDest];
       for (x = 0; x < w; ++x) {

Index: SplashBitmap.cc
===================================================================
RCS file: /cvs/poppler/poppler/splash/SplashBitmap.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- SplashBitmap.cc	28 Apr 2007 22:12:22 -0000	1.6
+++ SplashBitmap.cc	28 Apr 2007 23:25:59 -0000	1.7
@@ -36,7 +36,7 @@
   case splashModeBGR8:
     rowSize = width * 3;
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     rowSize = width * 4;
     break;
 #if SPLASH_CMYK
@@ -121,15 +121,15 @@
     }
     break;
 
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     fprintf(f, "P6\n%d %d\n255\n", width, height);
     row = data;
     for (y = 0; y < height; ++y) {
       p = row;
       for (x = 0; x < width; ++x) {
-	fputc(splashRGB8R(p), f);
-	fputc(splashRGB8G(p), f);
-	fputc(splashRGB8B(p), f);
+	fputc(splashBGR8R(p), f);
+	fputc(splashBGR8G(p), f);
+	fputc(splashBGR8B(p), f);
 	p += 4;
       }
       row += rowSize;
@@ -184,11 +184,11 @@
     pixel[1] = p[1];
     pixel[2] = p[2];
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     p = &data[y * rowSize + 4 * x];
-    pixel[0] = p[0];
+    pixel[0] = p[2];
     pixel[1] = p[1];
-    pixel[2] = p[2];
+    pixel[2] = p[0];
     pixel[3] = p[3];
     break;
   case splashModeBGR8:

Index: SplashTypes.h
===================================================================
RCS file: /cvs/poppler/poppler/splash/SplashTypes.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- SplashTypes.h	25 Apr 2007 19:59:10 -0000	1.6
+++ SplashTypes.h	28 Apr 2007 23:25:59 -0000	1.7
@@ -38,8 +38,8 @@
 				//   RGBRGB...
   splashModeBGR8,		// 1 byte per component, 3 bytes per pixel:
 				//   BGRBGR...
-  splashModeRGBX8,	// 1 byte per component, 4 bytes per pixel:
-				//   RGBXRGBX...
+  splashModeXBGR8,	// 1 byte per component, 4 bytes per pixel:
+				//   XBGRXBGR...
 #if SPLASH_CMYK
   ,
   splashModeCMYK8		// 1 byte per component, 4 bytes per pixel:



More information about the poppler mailing list