diff options
author | Albert Astals Cid <aacid@kde.org> | 2013-08-20 00:41:13 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2013-08-20 00:41:13 +0200 |
commit | 3bb8c2e34039cf473bf72ed9dab55664deab3ab7 (patch) | |
tree | 0139e8e7df5d4d2e2c63ea87e593b4be70f2d033 | |
parent | 71c1d162477a243db07b62ef3c056a2946f8986e (diff) | |
parent | fc78330072b9771fa39d21896703adb4836e5398 (diff) |
Merge remote-tracking branch 'origin/poppler-0.24'
-rw-r--r-- | poppler/SplashOutputDev.cc | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 4d4e945b..d9ea9907 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -2862,20 +2862,28 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine, break; case splashModeRGB8: case splashModeBGR8: - for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) { - imgData->colorMap->getRGB(p, &rgb); - *q++ = colToByte(rgb.r); - *q++ = colToByte(rgb.g); - *q++ = colToByte(rgb.b); + if (imgData->colorMap->useRGBLine()) { + imgData->colorMap->getRGBLine(p, (Guchar *) colorLine, imgData->width); + } else { + for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) { + imgData->colorMap->getRGB(p, &rgb); + *q++ = colToByte(rgb.r); + *q++ = colToByte(rgb.g); + *q++ = colToByte(rgb.b); + } } break; case splashModeXBGR8: - for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) { - imgData->colorMap->getRGB(p, &rgb); - *q++ = colToByte(rgb.r); - *q++ = colToByte(rgb.g); - *q++ = colToByte(rgb.b); - *q++ = 255; + if (imgData->colorMap->useRGBLine()) { + imgData->colorMap->getRGBXLine(p, (Guchar *) colorLine, imgData->width); + } else { + for (x = 0, q = colorLine; x < imgData->width; ++x, p += nComps) { + imgData->colorMap->getRGB(p, &rgb); + *q++ = colToByte(rgb.r); + *q++ = colToByte(rgb.g); + *q++ = colToByte(rgb.b); + *q++ = 255; + } } break; #if SPLASH_CMYK |