[poppler] poppler/SplashOutputDev.cc splash/Splash.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Apr 11 14:50:26 PDT 2012


 poppler/SplashOutputDev.cc |    9 +++++++++
 splash/Splash.cc           |    2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 06591d848e53598973f7d5fddac50785a46e8027
Author: Thomas Freitag <Thomas.Freitag at alfa.de>
Date:   Wed Apr 11 23:49:29 2012 +0200

    Fix Splash CMYK merge error
    
    Mail says
    ******
    Hi,
    
    playing around with the attached PDF to get a better CMYK support for
    the blend mode soft light, I encountered that I made a big mistake
    during merge in the CMYK part of splash. I fixed that. The attached
    patch also includes the small enhancement I made in soft light routine.
    ******

diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 88b53ab..807e23a 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -661,6 +661,11 @@ static void splashOutBlendSoftLight(SplashColorPtr src, SplashColorPtr dest,
     SplashColor rgbSrc;
     SplashColor rgbDest;
     SplashColor rgbBlend;
+    for (i = 0; i < 4; i++) {
+      // convert back to subtractive (s. Splash.cc)
+      src[i] = 0xff - src[i];
+      dest[i] = 0xff - dest[i];
+    }
     cmykToRGB(src, rgbSrc);
     cmykToRGB(dest, rgbDest);
     for (i = 0; i < 3; ++i) {
@@ -676,6 +681,10 @@ static void splashOutBlendSoftLight(SplashColorPtr src, SplashColorPtr dest,
       }
     }
     rgbToCMYK(rgbBlend, blend);
+    for (i = 0; i < 4; i++) {
+      // convert back to additive (s. Splash.cc)
+      blend[i] = 0xff - blend[i];
+    }
   } else
 #endif
   {
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 76a80f7..0e2058c 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -5260,7 +5260,7 @@ SplashError Splash::blitTransparent(SplashBitmap *src, int xSrc, int ySrc,
   case splashModeCMYK8:
     for (y = 0; y < h; ++y) {
       p = &bitmap->data[(yDest + y) * bitmap->rowSize + 4 * xDest];
-      sp = &src->data[(ySrc + y) * bitmap->rowSize + 4 * xSrc];
+      sp = &src->data[(ySrc + y) * src->rowSize + 4 * xSrc];
       for (x = 0; x < w; ++x) {
 	*p++ = *sp++;
 	*p++ = *sp++;


More information about the poppler mailing list