[poppler] 4 commits - .gitlab-ci.yml poppler/SplashOutputDev.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 22 23:09:51 UTC 2019


 .gitlab-ci.yml             |    2 -
 poppler/SplashOutputDev.cc |   62 +++++++--------------------------------------
 2 files changed, 12 insertions(+), 52 deletions(-)

New commits:
commit 62f945272dd9c4d8c8febb13b38fb7c5c331c1f4
Author: William Bader <william at newspapersystems.com>
Date:   Tue Apr 23 00:57:18 2019 +0200

    Handle splashModeDeviceN8 in two switch

diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 2d593e63..846d73eb 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -22,7 +22,7 @@
 // Copyright (C) 2009 Petr Gajdos <pgajdos at novell.com>
 // Copyright (C) 2009-2016 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
-// Copyright (C) 2009, 2014-2016 William Bader <williambader at hotmail.com>
+// Copyright (C) 2009, 2014-2016, 2019 William Bader <williambader at hotmail.com>
 // Copyright (C) 2010 Patrick Spendrin <ps_ml at gmx.de>
 // Copyright (C) 2010 Brian Cameron <brian.cameron at oracle.com>
 // Copyright (C) 2010 Paweł Wiejacha <pawel.wiejacha at gmail.com>
@@ -2954,6 +2954,10 @@ bool SplashOutputDev::useIccImageSrc(void *data) {
       if (colorSpace->getAlt() != nullptr && colorSpace->getAlt()->getMode() == csDeviceCMYK)
         return true;
       break;
+    case splashModeDeviceN8:
+      if (colorSpace->getAlt() != nullptr && colorSpace->getAlt()->getMode() == csDeviceN)
+        return true;
+      break;
 #endif
     }
   }
@@ -3192,6 +3196,10 @@ void SplashOutputDev::iccTransform(void *data, SplashBitmap *bitmap) {
       imgData->colorMap->getCMYKLine(p, colorLine, bitmap->getWidth());
       memcpy(p, colorLine, nComps * bitmap->getWidth());
       break;
+    case splashModeDeviceN8:
+      imgData->colorMap->getDeviceNLine(p, colorLine, bitmap->getWidth());
+      memcpy(p, colorLine, nComps * bitmap->getWidth());
+      break;
 #endif
     case splashModeXBGR8:
       unsigned char *q;
commit 3b40194971cb3fcfc63fc238ebab81a1d54fa1e9
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Apr 22 13:05:08 2019 +0200

    Remove unused functions

diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 99501a0b..2d593e63 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -495,54 +495,6 @@ static inline unsigned char div255(int x) {
   return (unsigned char)((x + (x >> 8) + 0x80) >> 8);
 }
 
-#ifdef SPLASH_CMYK
-
-#include "GfxState_helpers.h"
-
-//-------------------------------------------------------------------------
-// helper for Blend functions (convert CMYK to RGB, do blend, convert back)
-//-------------------------------------------------------------------------
-
-// based in GfxState.cc
-
-static void cmykToRGB(SplashColorPtr cmyk, SplashColor rgb) {
-  double c, m, y, k, c1, m1, y1, k1, r, g, b;
-
-  c = colToDbl(byteToCol(cmyk[0]));
-  m = colToDbl(byteToCol(cmyk[1]));
-  y = colToDbl(byteToCol(cmyk[2]));
-  k = colToDbl(byteToCol(cmyk[3]));
-  c1 = 1 - c;
-  m1 = 1 - m;
-  y1 = 1 - y;
-  k1 = 1 - k;
-  cmykToRGBMatrixMultiplication(c, m, y, k, c1, m1, y1, k1, r, g, b);
-  rgb[0] = colToByte(clip01(dblToCol(r)));
-  rgb[1] = colToByte(clip01(dblToCol(g)));
-  rgb[2] = colToByte(clip01(dblToCol(b)));
-}
-
-static void rgbToCMYK(SplashColor rgb, SplashColorPtr cmyk) {
-  GfxColorComp c, m, y, k;
-
-  c = clip01(gfxColorComp1 - byteToCol(rgb[0]));
-  m = clip01(gfxColorComp1 - byteToCol(rgb[1]));
-  y = clip01(gfxColorComp1 - byteToCol(rgb[2]));
-  k = c;
-  if (m < k) {
-    k = m;
-  }
-  if (y < k) {
-    k = y;
-  }
-  cmyk[0] = colToByte(c - k);
-  cmyk[1] = colToByte(m - k);
-  cmyk[2] = colToByte(y - k);
-  cmyk[3] = colToByte(k);
-}
-
-#endif
-
 //------------------------------------------------------------------------
 // Blend functions
 //------------------------------------------------------------------------
commit 16f34af3cda7f8e5647c50027ed032952d9afe0e
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Apr 22 12:58:35 2019 +0200

    NULL -> nullptr

diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 51d2191d..99501a0b 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -2999,7 +2999,7 @@ bool SplashOutputDev::useIccImageSrc(void *data) {
       break;
 #ifdef SPLASH_CMYK
     case splashModeCMYK8:
-      if (colorSpace->getAlt() != NULL && colorSpace->getAlt()->getMode() == csDeviceCMYK)
+      if (colorSpace->getAlt() != nullptr && colorSpace->getAlt()->getMode() == csDeviceCMYK)
         return true;
       break;
 #endif
@@ -3587,7 +3587,7 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 
 #ifdef SPLASH_CMYK
   setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(),
-		   state->getOverprintMode(), NULL, grayIndexed);
+		   state->getOverprintMode(), nullptr, grayIndexed);
 #else		   
   setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(),
 		   state->getOverprintMode(), nullptr);
commit 310fd7c1465be424126bd8f3d853036178df72b9
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Apr 22 12:28:07 2019 +0200

    Add SPLASH_CMYK=ON to the clazy CI
    
    to have more coverage, this doesn't really reduce the coverage for the
    "normal" case of not having SPLASH_CMYK defined since there's very few
    else for that ifdef and they're just simplifications of the if code

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 575e6628..5cfb2366 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -76,7 +76,7 @@ build_clazy:
     - dnf -y install curl make ninja-build openjpeg2-tools clazy clang redhat-rpm-config
   script:
     - mkdir -p build && cd build
-    - CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -G Ninja ..
+    - CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -DSPLASH_CMYK=ON -G Ninja ..
     - CLAZY_CHECKS="level0,level1,level2,isempty-vs-count,qhash-with-char-pointer-key,tr-non-literal,no-non-pod-global-static" ninja
 
 build_android:


More information about the poppler mailing list