Commit c5613ab5 authored by Albert Astals Cid's avatar Albert Astals Cid

* 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
parent 6479ce22
2007-04-29 Albert Astals Cid <aacid@kde.org>
* 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
2007-04-28 Albert Astals Cid <aacid@kde.org> 2007-04-28 Albert Astals Cid <aacid@kde.org>
* qt4/src/Makefile.am: * qt4/src/Makefile.am:
......
...@@ -244,7 +244,7 @@ static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest, ...@@ -244,7 +244,7 @@ static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest,
case splashModeMono8: case splashModeMono8:
blend[0] = dest[0]; blend[0] = dest[0];
break; break;
case splashModeRGBX8: case splashModeXBGR8:
src[3] = 255; src[3] = 255;
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
...@@ -285,7 +285,7 @@ static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest, ...@@ -285,7 +285,7 @@ static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest,
case splashModeMono8: case splashModeMono8:
blend[0] = dest[0]; blend[0] = dest[0];
break; break;
case splashModeRGBX8: case splashModeXBGR8:
src[3] = 255; src[3] = 255;
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
...@@ -325,7 +325,7 @@ static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest, ...@@ -325,7 +325,7 @@ static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest,
case splashModeMono8: case splashModeMono8:
blend[0] = dest[0]; blend[0] = dest[0];
break; break;
case splashModeRGBX8: case splashModeXBGR8:
src[3] = 255; src[3] = 255;
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
...@@ -366,7 +366,7 @@ static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest, ...@@ -366,7 +366,7 @@ static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
case splashModeMono8: case splashModeMono8:
blend[0] = dest[0]; blend[0] = dest[0];
break; break;
case splashModeRGBX8: case splashModeXBGR8:
src[3] = 255; src[3] = 255;
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
...@@ -722,7 +722,7 @@ void SplashOutputDev::startPage(int pageNum, GfxState *state) { ...@@ -722,7 +722,7 @@ void SplashOutputDev::startPage(int pageNum, GfxState *state) {
case splashModeMono8: case splashModeMono8:
color[0] = 0; color[0] = 0;
break; break;
case splashModeRGBX8: case splashModeXBGR8:
color[3] = 255; color[3] = 255;
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
...@@ -900,7 +900,7 @@ SplashPattern *SplashOutputDev::getColor(GfxGray gray, GfxRGB *rgb) { ...@@ -900,7 +900,7 @@ SplashPattern *SplashOutputDev::getColor(GfxGray gray, GfxRGB *rgb) {
color[0] = colToByte(gray); color[0] = colToByte(gray);
pattern = new SplashSolidColor(color); pattern = new SplashSolidColor(color);
break; break;
case splashModeRGBX8: case splashModeXBGR8:
color[3] = 255; color[3] = 255;
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
...@@ -1720,7 +1720,6 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine, ...@@ -1720,7 +1720,6 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
*q++ = imgData->lookup[*p]; *q++ = imgData->lookup[*p];
} }
break; break;
case splashModeRGBX8:
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
for (x = 0, p = imgData->imgStr->getLine(), q = colorLine; for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
...@@ -1730,9 +1729,19 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine, ...@@ -1730,9 +1729,19 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
*q++ = col[0]; *q++ = col[0];
*q++ = col[1]; *q++ = col[1];
*q++ = col[2]; *q++ = col[2];
if (imgData->colorMode == splashModeRGBX8) *q++ = 255;
} }
break; 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 #if SPLASH_CMYK
case splashModeCMYK8: case splashModeCMYK8:
for (x = 0, p = imgData->imgStr->getLine(), q = colorLine; for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
...@@ -1758,7 +1767,7 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine, ...@@ -1758,7 +1767,7 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
*q++ = colToByte(gray); *q++ = colToByte(gray);
} }
break; break;
case splashModeRGBX8: case splashModeXBGR8:
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
for (x = 0, p = imgData->imgStr->getLine(), q = colorLine; for (x = 0, p = imgData->imgStr->getLine(), q = colorLine;
...@@ -1768,7 +1777,7 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine, ...@@ -1768,7 +1777,7 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
*q++ = colToByte(rgb.r); *q++ = colToByte(rgb.r);
*q++ = colToByte(rgb.g); *q++ = colToByte(rgb.g);
*q++ = colToByte(rgb.b); *q++ = colToByte(rgb.b);
if (imgData->colorMode == splashModeRGBX8) *q++ = 255; if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
} }
break; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -1828,14 +1837,20 @@ GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine, ...@@ -1828,14 +1837,20 @@ GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
*q++ = imgData->lookup[*p]; *q++ = imgData->lookup[*p];
*aq++ = alpha; *aq++ = alpha;
break; break;
case splashModeRGBX8:
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
col = &imgData->lookup[3 * *p]; col = &imgData->lookup[3 * *p];
*q++ = col[0]; *q++ = col[0];
*q++ = col[1]; *q++ = col[1];
*q++ = col[2]; *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; *aq++ = alpha;
break; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -1857,14 +1872,14 @@ GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine, ...@@ -1857,14 +1872,14 @@ GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
*q++ = colToByte(gray); *q++ = colToByte(gray);
*aq++ = alpha; *aq++ = alpha;
break; break;
case splashModeRGBX8: case splashModeXBGR8:
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
imgData->colorMap->getRGB(p, &rgb); imgData->colorMap->getRGB(p, &rgb);
*q++ = colToByte(rgb.r); *q++ = colToByte(rgb.r);
*q++ = colToByte(rgb.g); *q++ = colToByte(rgb.g);
*q++ = colToByte(rgb.b); *q++ = colToByte(rgb.b);
if (imgData->colorMode == splashModeRGBX8) *q++ = 255; if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
*aq++ = alpha; *aq++ = alpha;
break; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -1936,7 +1951,6 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, ...@@ -1936,7 +1951,6 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
imgData.lookup[i] = colToByte(gray); imgData.lookup[i] = colToByte(gray);
} }
break; break;
case splashModeRGBX8:
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
imgData.lookup = (SplashColorPtr)gmalloc(3 * n); imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
...@@ -1946,7 +1960,17 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, ...@@ -1946,7 +1960,17 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
imgData.lookup[3*i] = colToByte(rgb.r); imgData.lookup[3*i] = colToByte(rgb.r);
imgData.lookup[3*i+1] = colToByte(rgb.g); imgData.lookup[3*i+1] = colToByte(rgb.g);
imgData.lookup[3*i+2] = colToByte(rgb.b); 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; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -2027,14 +2051,20 @@ GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine, ...@@ -2027,14 +2051,20 @@ GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine,
*q++ = imgData->lookup[*p]; *q++ = imgData->lookup[*p];
*aq++ = alpha; *aq++ = alpha;
break; break;
case splashModeRGBX8:
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
col = &imgData->lookup[3 * *p]; col = &imgData->lookup[3 * *p];
*q++ = col[0]; *q++ = col[0];
*q++ = col[1]; *q++ = col[1];
*q++ = col[2]; *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; *aq++ = alpha;
break; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -2056,14 +2086,14 @@ GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine, ...@@ -2056,14 +2086,14 @@ GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine,
*q++ = colToByte(gray); *q++ = colToByte(gray);
*aq++ = alpha; *aq++ = alpha;
break; break;
case splashModeRGBX8: case splashModeXBGR8:
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
imgData->colorMap->getRGB(p, &rgb); imgData->colorMap->getRGB(p, &rgb);
*q++ = colToByte(rgb.r); *q++ = colToByte(rgb.r);
*q++ = colToByte(rgb.g); *q++ = colToByte(rgb.g);
*q++ = colToByte(rgb.b); *q++ = colToByte(rgb.b);
if (imgData->colorMode == splashModeRGBX8) *q++ = 255; if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
*aq++ = alpha; *aq++ = alpha;
break; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -2186,7 +2216,6 @@ void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref, ...@@ -2186,7 +2216,6 @@ void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
imgData.lookup[i] = colToByte(gray); imgData.lookup[i] = colToByte(gray);
} }
break; break;
case splashModeRGBX8:
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
imgData.lookup = (SplashColorPtr)gmalloc(3 * n); imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
...@@ -2196,7 +2225,17 @@ void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref, ...@@ -2196,7 +2225,17 @@ void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
imgData.lookup[3*i] = colToByte(rgb.r); imgData.lookup[3*i] = colToByte(rgb.r);
imgData.lookup[3*i+1] = colToByte(rgb.g); imgData.lookup[3*i+1] = colToByte(rgb.g);
imgData.lookup[3*i+2] = colToByte(rgb.b); 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; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -2321,7 +2360,6 @@ void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, ...@@ -2321,7 +2360,6 @@ void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref,
} }
break; break;
case splashModeRGB8: case splashModeRGB8:
case splashModeRGBX8:
case splashModeBGR8: case splashModeBGR8:
imgData.lookup = (SplashColorPtr)gmalloc(3 * n); imgData.lookup = (SplashColorPtr)gmalloc(3 * n);
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
...@@ -2330,7 +2368,17 @@ void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, ...@@ -2330,7 +2368,17 @@ void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref,
imgData.lookup[3*i] = colToByte(rgb.r); imgData.lookup[3*i] = colToByte(rgb.r);
imgData.lookup[3*i+1] = colToByte(rgb.g); imgData.lookup[3*i+1] = colToByte(rgb.g);
imgData.lookup[3*i+2] = colToByte(rgb.b); 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; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -2461,7 +2509,7 @@ void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, ...@@ -2461,7 +2509,7 @@ void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
case splashModeMono8: case splashModeMono8:
color[0] = 0; color[0] = 0;
break; break;
case splashModeRGBX8: case splashModeXBGR8:
color[3] = 255; color[3] = 255;
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
...@@ -2559,7 +2607,7 @@ void SplashOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/, ...@@ -2559,7 +2607,7 @@ void SplashOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/,
color[0] = colToByte(gray); color[0] = colToByte(gray);
tSplash->compositeBackground(color); tSplash->compositeBackground(color);
break; break;
case splashModeRGBX8: case splashModeXBGR8:
color[3] = 255; color[3] = 255;
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
...@@ -2601,7 +2649,7 @@ void SplashOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/, ...@@ -2601,7 +2649,7 @@ void SplashOutputDev::setSoftMask(GfxState * /*state*/, double * /*bbox*/,
case splashModeMono8: case splashModeMono8:
lum = color[0] / 255.0; lum = color[0] / 255.0;
break; break;
case splashModeRGBX8: case splashModeXBGR8:
case splashModeRGB8: case splashModeRGB8:
case splashModeBGR8: case splashModeBGR8:
lum = (0.3 / 255.0) * color[0] + lum = (0.3 / 255.0) * color[0] +
......
...@@ -114,7 +114,7 @@ class DocumentData { ...@@ -114,7 +114,7 @@ class DocumentData {
white[0] = 255; white[0] = 255;
white[1] = 255; white[1] = 255;
white[2] = 255; white[2] = 255;
m_outputDev = new SplashOutputDev(splashModeRGBX8, 4, gFalse, white); m_outputDev = new SplashOutputDev(splashModeXBGR8, 4, gFalse, white);
m_outputDev->startDoc(doc.getXRef()); m_outputDev->startDoc(doc.getXRef());
} }
#endif #endif
......
...@@ -163,7 +163,7 @@ namespace Poppler { ...@@ -163,7 +163,7 @@ namespace Poppler {
bgColor[1] = paperColor.green(); bgColor[1] = paperColor.green();
bgColor[2] = paperColor.blue(); bgColor[2] = paperColor.blue();
GBool AA = m_hints & Document::TextAntialiasing ? gTrue : gFalse; GBool AA = m_hints & Document::TextAntialiasing ? gTrue : gFalse;
SplashOutputDev * splashOutputDev = new SplashOutputDev(splashModeRGBX8, 4, gFalse, bgColor, gTrue, AA); SplashOutputDev * splashOutputDev = new SplashOutputDev(splashModeXBGR8, 4, gFalse, bgColor, gTrue, AA);
splashOutputDev->startDoc(doc->getXRef()); splashOutputDev->startDoc(doc->getXRef());
m_outputDev = splashOutputDev; m_outputDev = splashOutputDev;
#endif #endif
......
...@@ -84,6 +84,7 @@ SplashPipeResultColorCtrl Splash::pipeResultColorNoAlphaBlend[] = { ...@@ -84,6 +84,7 @@ SplashPipeResultColorCtrl Splash::pipeResultColorNoAlphaBlend[] = {
splashPipeResultColorNoAlphaBlendMono, splashPipeResultColorNoAlphaBlendMono,
splashPipeResultColorNoAlphaBlendMono, splashPipeResultColorNoAlphaBlendMono,
splashPipeResultColorNoAlphaBlendRGB, splashPipeResultColorNoAlphaBlendRGB,
splashPipeResultColorNoAlphaBlendRGB,
splashPipeResultColorNoAlphaBlendRGB splashPipeResultColorNoAlphaBlendRGB
#if SPLASH_CMYK #if SPLASH_CMYK
, ,
...@@ -95,6 +96,7 @@ SplashPipeResultColorCtrl Splash::pipeResultColorAlphaNoBlend[] = { ...@@ -95,6 +96,7 @@ SplashPipeResultColorCtrl Splash::pipeResultColorAlphaNoBlend[] = {
splashPipeResultColorAlphaNoBlendMono, splashPipeResultColorAlphaNoBlendMono,
splashPipeResultColorAlphaNoBlendMono, splashPipeResultColorAlphaNoBlendMono,
splashPipeResultColorAlphaNoBlendRGB, splashPipeResultColorAlphaNoBlendRGB,
splashPipeResultColorNoAlphaBlendRGB,
splashPipeResultColorAlphaNoBlendRGB splashPipeResultColorAlphaNoBlendRGB
#if SPLASH_CMYK #if SPLASH_CMYK
, ,
...@@ -106,6 +108,7 @@ SplashPipeResultColorCtrl Splash::pipeResultColorAlphaBlend[] = { ...@@ -106,6 +108,7 @@ SplashPipeResultColorCtrl Splash::pipeResultColorAlphaBlend[] = {
splashPipeResultColorAlphaBlendMono, splashPipeResultColorAlphaBlendMono,
splashPipeResultColorAlphaBlendMono, splashPipeResultColorAlphaBlendMono,
splashPipeResultColorAlphaBlendRGB, splashPipeResultColorAlphaBlendRGB,
splashPipeResultColorNoAlphaBlendRGB,
splashPipeResultColorAlphaBlendRGB splashPipeResultColorAlphaBlendRGB
#if SPLASH_CMYK #if SPLASH_CMYK
, ,
...@@ -253,10 +256,10 @@ inline void Splash::pipeRun(SplashPipe *pipe) { ...@@ -253,10 +256,10 @@ inline void Splash::pipeRun(SplashPipe *pipe) {
*pipe->destColorPtr++ = pipe->cSrc[1]; *pipe->destColorPtr++ = pipe->cSrc[1];
*pipe->destColorPtr++ = pipe->cSrc[2]; *pipe->destColorPtr++ = pipe->cSrc[2];
break; break;
case splashModeRGBX8: case splashModeXBGR8:
*pipe->destColorPtr++ = pipe->cSrc[0];
*pipe->destColorPtr++ = pipe->cSrc[1];
*pipe->destColorPtr++ = pipe->cSrc[2]; *pipe->destColorPtr++ = pipe->cSrc[2];
*pipe->destColorPtr++ = pipe->cSrc[1];
*pipe->destColorPtr++ = pipe->cSrc[0];
*pipe->destColorPtr++ = 255; *pipe->destColorPtr++ = 255;
break; break;
case splashModeBGR8: case splashModeBGR8:
...@@ -293,10 +296,10 @@ inline void Splash::pipeRun(SplashPipe *pipe) { ...@@ -293,10 +296,10 @@ inline void Splash::pipeRun(SplashPipe *pipe) {
cDest[1] = pipe->destColorPtr[1]; cDest[1] = pipe->destColorPtr[1];
cDest[2] = pipe->destColorPtr[2]; cDest[2] = pipe->destColorPtr[2];
break; break;
case splashModeRGBX8: case splashModeXBGR8:
cDest[0] = pipe->destColorPtr[0]; cDest[0] = pipe->destColorPtr[2];
cDest[1] = pipe->destColorPtr[1]; cDest[1] = pipe->destColorPtr[1];
cDest[2] = pipe->destColorPtr[2]; cDest[2] = pipe->destColorPtr[0];
cDest[3] = 255; cDest[3] = 255;
break; break;
case splashModeBGR8: case splashModeBGR8:
...@@ -519,10 +522,10 @@ inline void Splash::pipeRun(SplashPipe *pipe) { ...@@ -519,10 +522,10 @@ inline void Splash::pipeRun(SplashPipe *pipe) {
*pipe->destColorPtr++ = cResult1; *pipe->destColorPtr++ = cResult1;
*pipe->destColorPtr++ = cResult2; *pipe->destColorPtr++ = cResult2;
break; break;
case splashModeRGBX8: case splashModeXBGR8:
*pipe->destColorPtr++ = cResult0;
*pipe->destColorPtr++ = cResult1;
*pipe->destColorPtr++ = cResult2; *pipe->destColorPtr++ = cResult2;
*pipe->destColorPtr++ = cResult1;
*pipe->destColorPtr++ = cResult0;
*pipe->destColorPtr++ = 255; *pipe->destColorPtr++ = 255;
break; break;
case splashModeBGR8: case splashModeBGR8:
...@@ -567,7 +570,7 @@ inline void Splash::pipeSetXY(SplashPipe *pipe, int x, int y) { ...@@ -567,7 +570,7 @@ inline void Splash::pipeSetXY(SplashPipe *pipe, int x, int y) {
case splashModeBGR8: case splashModeBGR8:
pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x]; pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x];
break; break;
case splashModeRGBX8: case splashModeXBGR8:
pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 4 * x]; pipe->destColorPtr = &bitmap->data[y * bitmap->rowSize + 4 * x];
break; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -609,7 +612,7 @@ inline void Splash::pipeIncX(SplashPipe *pipe) { ...@@ -609,7 +612,7 @@ inline void Splash::pipeIncX(SplashPipe *pipe) {
case splashModeBGR8: case splashModeBGR8:
pipe->destColorPtr += 3; pipe->destColorPtr += 3;
break; break;
case splashModeRGBX8: case splashModeXBGR8:
pipe->destColorPtr += 4; pipe->destColorPtr += 4;
break; break;
#if SPLASH_CMYK #if SPLASH_CMYK
...@@ -1087,7 +1090,7 @@ void Splash::clear(SplashColorPtr color, Guchar alpha) { ...@@ -1087,7 +1090,7 @@ void Splash::clear(SplashColorPtr color, Guchar alpha) {
} }
} }
break; break;
case splashModeRGBX8: case splashModeXBGR8:
if (color[0] == color[1] && color[1] == color[2]) { if (color[0] == color[1] && color[1] == color[2]) {
if (bitmap->rowSize < 0) { if (bitmap->rowSize < 0) {
memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1), memset(bitmap->data + bitmap->rowSize * (bitmap->height - 1),
...@@ -1100,9 +1103,9 @@ void Splash::clear(SplashColorPtr color, Guchar alpha) { ...@@ -1100,9 +1103,9 @@ void Splash::clear(SplashColorPtr color, Guchar alpha) {
for (y = 0; y < bitmap->height; ++y) { for (y = 0; y < bitmap->height; ++y) {
p = row; p = row;
for (x = 0; x < bitmap->width; ++x) { for (x = 0; x < bitmap->width; ++x) {
*p++ = color[2];
*p++ = color[1];
*p++ = color[0]; *p++ = color[0];
*p++ = color[1];
*p++ = color[2];
*p++ = 255; *p++ = 255;
} }
row += bitmap->rowSize; row += bitmap->rowSize;
...@@ -2144,8 +2147,8 @@ SplashError Splash::drawImage(SplashImageSource src, void *srcData, ...@@ -2144,8 +2147,8 @@ SplashError Splash::drawImage(SplashImageSource src, void *srcData,
ok = srcMode == splashModeRGB8; ok = srcMode == splashModeRGB8;
nComps = 3; nComps = 3;
break; break;
case splashModeRGBX8: case splashModeXBGR8:
ok = srcMode == splashModeRGBX8; ok = srcMode == splashModeXBGR8;
nComps = 4; nComps = 4;
break; break;
case splashModeBGR8: case splashModeBGR8:
...@@ -2486,9 +2489,8 @@ SplashError Splash::drawImage(SplashImageSource src, void *srcData, ...@@ -2486,9 +2489,8 @@ SplashError Splash::drawImage(SplashImageSource src, void *srcData,
} }
break; break;
case splashModeRGBX8: case splashModeXBGR8:
for (x = 0; x < scaledWidth; ++x) { for (x = 0; x < scaledWidth; ++x) {
// x scale Bresenham // x scale Bresenham