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

use getRGBLine images if available

Speeds up greatly files from bug #66928

E.g. some file went from 21s to 2s in my computer
parent 678c7675
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment