[poppler] poppler/poppler: SplashOutputDev.cc,1.13,1.14

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


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

Modified Files:
	SplashOutputDev.cc 
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: SplashOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/SplashOutputDev.cc,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- SplashOutputDev.cc	25 Apr 2007 19:59:10 -0000	1.13
+++ SplashOutputDev.cc	28 Apr 2007 23:25:59 -0000	1.14
@@ -244,7 +244,7 @@
   case splashModeMono8:
     blend[0] = dest[0];
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     src[3] = 255;
   case splashModeRGB8:
   case splashModeBGR8:
@@ -285,7 +285,7 @@
   case splashModeMono8:
     blend[0] = dest[0];
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     src[3] = 255;
   case splashModeRGB8:
   case splashModeBGR8:
@@ -325,7 +325,7 @@
   case splashModeMono8:
     blend[0] = dest[0];
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     src[3] = 255;
   case splashModeRGB8:
   case splashModeBGR8:
@@ -366,7 +366,7 @@
   case splashModeMono8:
     blend[0] = dest[0];
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     src[3] = 255;
   case splashModeRGB8:
   case splashModeBGR8:
@@ -722,7 +722,7 @@
   case splashModeMono8:
     color[0] = 0;
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     color[3] = 255;
   case splashModeRGB8:
   case splashModeBGR8:
@@ -900,7 +900,7 @@
     color[0] = colToByte(gray);
     pattern = new SplashSolidColor(color);
     break;
-  case splashModeRGBX8:
+  case splashModeXBGR8:
     color[3] = 255;
   case splashModeRGB8:
   case splashModeBGR8:
@@ -1720,7 +1720,6 @@
 	*q++ = imgData->lookup[*p];
       }
     break;
-  case splashModeRGBX8:
   case splashModeRGB8:
   case splashModeBGR8:
       for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
@@ -1730,9 +1729,19 @@
 	*q++ = col[0];
 	*q++ = col[1];
 	*q++ = col[2];
-	if (imgData->colorMode == splashModeRGBX8) *q++ = 255;
       }
     break;
+  case splashModeXBGR8:
+      for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
+	   x < imgData->width;
+	   ++x, ++p) {
+	col = &imgData->lookup[4 * *p];
+	*q++ = col[0];
+	*q++ = col[1];
+	*q++ = col[2];
+	*q++ = col[3];
+      }
+      break;
 #if SPLASH_CMYK
     case splashModeCMYK8:
       for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
@@ -1758,7 +1767,7 @@
 	*q++ = colToByte(gray);
       }
 	break;
-	case splashModeRGBX8:
+	case splashModeXBGR8:
     case splashModeRGB8:
     case splashModeBGR8:
       for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
@@ -1768,7 +1777,7 @@
 	*q++ = colToByte(rgb.r);
 	*q++ = colToByte(rgb.g);
 	*q++ = colToByte(rgb.b);
-	if (imgData->colorMode == splashModeRGBX8) *q++ = 255;
+	if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
       }
       break;
 #if SPLASH_CMYK
@@ -1828,14 +1837,20 @@
 	*q++ = imgData->lookup[*p];
 	*aq++ = alpha;
 	break;
-      case splashModeRGBX8:
       case splashModeRGB8:
       case splashModeBGR8:
 	col = &imgData->lookup[3 * *p];
 	*q++ = col[0];
 	*q++ = col[1];
 	*q++ = col[2];
-	if (imgData->colorMode == splashModeRGBX8) *q++ = 255;
+	*aq++ = alpha;
+	break;
+      case splashModeXBGR8:
+	col = &imgData->lookup[4 * *p];
+	*q++ = col[0];
+	*q++ = col[1];
+	*q++ = col[2];
+	*q++ = 255;
 	*aq++ = alpha;
 	break;
 #if SPLASH_CMYK
@@ -1857,14 +1872,14 @@
 	*q++ = colToByte(gray);
 	*aq++ = alpha;
 	break;
-      case splashModeRGBX8:
+      case splashModeXBGR8:
       case splashModeRGB8:
       case splashModeBGR8:
 	imgData->colorMap->getRGB(p, &rgb);
 	*q++ = colToByte(rgb.r);
 	*q++ = colToByte(rgb.g);
 	*q++ = colToByte(rgb.b);
-	if (imgData->colorMode == splashModeRGBX8) *q++ = 255;
+	if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
 	*aq++ = alpha;
 	break;
 #if SPLASH_CMYK
@@ -1936,7 +1951,6 @@
 	imgData.lookup[i] = colToByte(gray);
       }
       break;
-    case splashModeRGBX8:
     case splashModeRGB8:
     case splashModeBGR8:
       imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
@@ -1946,7 +1960,17 @@
 	imgData.lookup[3*i] = colToByte(rgb.r);
 	imgData.lookup[3*i+1] = colToByte(rgb.g);
 	imgData.lookup[3*i+2] = colToByte(rgb.b);
-	if (colorMode == splashModeRGBX8) imgData.lookup[3*i+3] = 255;
+      }
+      break;
+    case splashModeXBGR8:
+      imgData.lookup = (SplashColorPtr)gmalloc(4 * n);
+      for (i = 0; i < n; ++i) {
+	pix = (Guchar)i;
+	colorMap->getRGB(&pix, &rgb);
+	imgData.lookup[4*i] = colToByte(rgb.r);
+	imgData.lookup[4*i+1] = colToByte(rgb.g);
+	imgData.lookup[4*i+2] = colToByte(rgb.b);
+	imgData.lookup[4*i+3] = 255;
       }
       break;
 #if SPLASH_CMYK
@@ -2027,14 +2051,20 @@
 	*q++ = imgData->lookup[*p];
 	*aq++ = alpha;
 	break;
-      case splashModeRGBX8:
       case splashModeRGB8:
       case splashModeBGR8:
 	col = &imgData->lookup[3 * *p];
 	*q++ = col[0];
 	*q++ = col[1];
 	*q++ = col[2];
-	if (imgData->colorMode == splashModeRGBX8) *q++ = 255;
+	*aq++ = alpha;
+	break;
+      case splashModeXBGR8:
+	col = &imgData->lookup[4 * *p];
+	*q++ = col[0];
+	*q++ = col[1];
+	*q++ = col[2];
+	*q++ = 255;
 	*aq++ = alpha;
 	break;
 #if SPLASH_CMYK
@@ -2056,14 +2086,14 @@
 	*q++ = colToByte(gray);
 	*aq++ = alpha;
 	break;
-      case splashModeRGBX8:
+      case splashModeXBGR8:
       case splashModeRGB8:
       case splashModeBGR8:
 	imgData->colorMap->getRGB(p, &rgb);
 	*q++ = colToByte(rgb.r);
 	*q++ = colToByte(rgb.g);
 	*q++ = colToByte(rgb.b);
-	if (imgData->colorMode == splashModeRGBX8) *q++ = 255;
+	if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
 	*aq++ = alpha;
 	break;
 #if SPLASH_CMYK
@@ -2186,7 +2216,6 @@
 	  imgData.lookup[i] = colToByte(gray);
 	}
 	break;
-      case splashModeRGBX8:
       case splashModeRGB8:
       case splashModeBGR8:
 	imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
@@ -2196,7 +2225,17 @@
 	  imgData.lookup[3*i] = colToByte(rgb.r);
 	  imgData.lookup[3*i+1] = colToByte(rgb.g);
 	  imgData.lookup[3*i+2] = colToByte(rgb.b);
-	  if (colorMode == splashModeRGBX8) imgData.lookup[3*i+2] = 255;
+	}
+	break;
+      case splashModeXBGR8:
+	imgData.lookup = (SplashColorPtr)gmalloc(4 * n);
+	for (i = 0; i < n; ++i) {
+	  pix = (Guchar)i;
+	  colorMap->getRGB(&pix, &rgb);
+	  imgData.lookup[4*i] = colToByte(rgb.r);
+	  imgData.lookup[4*i+1] = colToByte(rgb.g);
+	  imgData.lookup[4*i+2] = colToByte(rgb.b);
+	  imgData.lookup[4*i+3] = 255;
 	}
 	break;
 #if SPLASH_CMYK
@@ -2321,7 +2360,6 @@
       }
       break;
     case splashModeRGB8:
-    case splashModeRGBX8:
     case splashModeBGR8:
       imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
       for (i = 0; i < n; ++i) {
@@ -2330,7 +2368,17 @@
 	imgData.lookup[3*i] = colToByte(rgb.r);
 	imgData.lookup[3*i+1] = colToByte(rgb.g);
 	imgData.lookup[3*i+2] = colToByte(rgb.b);
-	if (colorMode == splashModeRGBX8) imgData.lookup[3*i+2] = 255;
+      }
+      break;
+    case splashModeXBGR8:
+      imgData.lookup = (SplashColorPtr)gmalloc(4 * n);
+      for (i = 0; i < n; ++i) {
+	pix = (Guchar)i;
+	colorMap->getRGB(&pix, &rgb);
+	imgData.lookup[4*i] = colToByte(rgb.r);
+	imgData.lookup[4*i+1] = colToByte(rgb.g);
+	imgData.lookup[4*i+2] = colToByte(rgb.b);
+	imgData.lookup[4*i+3] = 255;
       }
       break;
 #if SPLASH_CMYK
@@ -2461,7 +2509,7 @@
     case splashModeMono8:
       color[0] = 0;
       break;
-    case splashModeRGBX8:
+    case splashModeXBGR8:
       color[3] = 255;
     case splashModeRGB8:
     case splashModeBGR8:
@@ -2559,7 +2607,7 @@
 	color[0] = colToByte(gray);
 	tSplash->compositeBackground(color);
 	break;
-      case splashModeRGBX8:
+      case splashModeXBGR8:
 	color[3] = 255;
       case splashModeRGB8:
       case splashModeBGR8:
@@ -2601,7 +2649,7 @@
 	case splashModeMono8:
 	  lum = color[0] / 255.0;
 	  break;
-	case splashModeRGBX8:
+	case splashModeXBGR8:
 	case splashModeRGB8:
 	case splashModeBGR8:
 	  lum = (0.3 / 255.0) * color[0] +



More information about the poppler mailing list