[Poppler-bugs] [Bug 90795] [patch] Allow configuring SPLASH_CMYK support with --enable-cmyk as in xpdf

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Jul 4 23:17:59 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=90795

--- Comment #7 from William Bader <williambader at hotmail.com> ---
Here are more places that use SPLASH_CMYK:

poppler/PSOutputDev.cc
  if (level == psLevel1Sep || level == psLevel2Sep ||
      level == psLevel3Sep || globalParams->getOverprintPreview())
  it sets up numComps = 4 and new SplashOutputDev(splashModeCMYK8)
  When SPLASH_CMYK is not set, it sets up numComps = 3 and splashModeRGB8
instead which breaks pdftops.cc

splash/SplashBitmap.cc SplashBitmap::getRGBLine() and
SplashBitmap::getXBGRLine() add a check for separationList->getLength() > 0

poppler/SplashOutputDev.cc convertGfxColor() adds an initialization for
color[3] = 0.

poppler/SplashOutputDev.cc SplashOutputDev::drawMaskedImage() and
SplashOutputDev::drawSoftMaskedImage() and
SplashOutputDev::univariateShadedFill() call
  colorMap->getColorSpace()->createMapping(bitmap->getSeparationList(),
SPOT_NCOMPS);

poppler/SplashOutputDev.cc SplashOutputDev::beginTransparencyGroup() has
    } else if (blendingColorSpace->getMode() == csDeviceCMYK ||
               (blendingColorSpace->getMode() == csICCBased &&
                blendingColorSpace->getNComps() == 4)) {
      colorMode = splashModeCMYK8;
  This might be another way that poppler can work incorrectly if SPLASH_CMYK is
disabled.

splash/SplashState.cc SplashState::SplashState() (several different versions)
initializes 
  for (i = 0; i < 256; ++i) {
    cmykTransferC[i] = (Guchar)i;
    cmykTransferM[i] = (Guchar)i;
    cmykTransferY[i] = (Guchar)i;
    cmykTransferK[i] = (Guchar)i;
    for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
      deviceNTransfer[cp][i] = (Guchar)i;
  This might be an example of a place that adds a very small performance
penalty when SPLASH_CMYK is enabled.

splash/SplashState.cc SplashState::setTransfer() does more copying when
SPLASH_STATE is enabled, similar to SplashState()

splash/SplashState.h is several times larger
  Guchar cmykTransferC[256],
         cmykTransferM[256],
         cmykTransferY[256],
         cmykTransferK[256];
  Guchar deviceNTransfer[SPOT_NCOMPS+4][256];

splash/SplashTypes.h splashClearColor(), splashColorCopy() and splashColorXor()
copy more fields
  dest[3] = src[3];
  for (int i = SPOT_NCOMPS; i < SPOT_NCOMPS + 4; i++)
    dest[i] = src[i];

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20150705/4394634d/attachment.html>


More information about the Poppler-bugs mailing list