summaryrefslogtreecommitdiff
path: root/poppler/SplashOutputDev.cc
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2013-08-20 00:37:56 +0200
committerAlbert Astals Cid <aacid@kde.org>2013-08-20 00:39:45 +0200
commitfc78330072b9771fa39d21896703adb4836e5398 (patch)
tree7a36d6a6dd03ba81e7a1247193f4b3b10dc42032 /poppler/SplashOutputDev.cc
parent678c767584fa80620cc58a1d8a913cb3473209d4 (diff)
use getRGBLine images if available
Speeds up greatly files from bug #66928 E.g. some file went from 21s to 2s in my computer
Diffstat (limited to 'poppler/SplashOutputDev.cc')
-rw-r--r--poppler/SplashOutputDev.cc30
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