CMakeLists.txt | 4 ++++ config.h.cmake | 3 +++ configure.ac | 7 +++++++ poppler/SplashOutputDev.cc | 4 ++-- qt4/src/poppler-document.cc | 2 +- qt4/src/poppler-page.cc | 4 ++-- qt5/src/poppler-document.cc | 2 +- qt5/src/poppler-page.cc | 4 ++-- splash/Splash.cc | 2 +- splash/SplashBitmap.cc | 2 +- 10 files changed, 24 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f77e366..bfa8a3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,7 @@ set(ENABLE_LIBOPENJPEG "auto" CACHE STRING "Use libopenjpeg for JPX streams. Pos set(ENABLE_CMS "auto" CACHE STRING "Use color management system. Possible values: auto, lcms1, lcms2. 'auto' prefers lcms2 over lcms1 if both are available. Unset to disable color management system.") option(ENABLE_LIBCURL "Build libcurl based HTTP support." OFF) option(ENABLE_ZLIB "Build with zlib (not totally safe)." OFF) +option(SPLASH_CMYK "Include support for CMYK rasterization." OFF) option(USE_FIXEDPOINT "Use fixed point arithmetic in the Splash backend" OFF) option(USE_FLOAT "Use single precision arithmetic in the Splash backend" OFF) if(WIN32) @@ -701,6 +702,9 @@ endif(ENABLE_CPP) message("Building Poppler with support for:") show_end_message("font configuration" ${font_configuration}) show_end_message_yesno("splash output" ENABLE_SPLASH) +if(SPLASH_CMYK) + message(" with CMYK support") +endif() show_end_message_yesno("cairo output" CAIRO_FOUND) show_end_message_yesno("qt4 wrapper" QT4_FOUND) show_end_message_yesno("qt5 wrapper" QT5_FOUND) diff --git a/config.h.cmake b/config.h.cmake index 8ed1c92..400b16b 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -174,6 +174,9 @@ /* Support for curl based doc builder is compiled in. */ #cmakedefine POPPLER_HAS_CURL_SUPPORT 1 +/* Include support for CMYK rasterization */ +#cmakedefine SPLASH_CMYK 1 + /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 diff --git a/configure.ac b/configure.ac index 67599c0..c06e8c8 100644 --- a/configure.ac +++ b/configure.ac @@ -79,6 +79,10 @@ AC_ARG_ENABLE(fixedpoint, [ --enable-fixedpoint use fixed point (instead of double precision) arithmetic in the Splash backend], AC_DEFINE(USE_FIXEDPOINT, [1], [Use fixed point arithmetic in the Splash backend])) +AC_ARG_ENABLE(cmyk, +[ --enable-cmyk Include support for CMYK rasterization], +AC_DEFINE(SPLASH_CMYK, [1], [Include support for CMYK rasterization])) + dnl Relocation support AC_ARG_ENABLE(relocatable, AC_HELP_STRING([--disable-relocatable], @@ -938,6 +942,9 @@ echo "" echo "Building poppler with support for:" echo " font configuration: $with_font_configuration" echo " splash output: $enable_splash_output" +if test x$enable_cmyk = xyes;then + echo " with CMYK support" +fi echo " cairo output: $use_cairo" echo " qt4 wrapper: $enable_poppler_qt4" echo " qt5 wrapper: $enable_poppler_qt5" diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 5a9832d..2b381d7 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -886,7 +886,7 @@ static void setSat(Guchar rIn, Guchar gIn, Guchar bIn, int sat, static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { Guchar r0, g0, b0; -#ifdef SPLASH_CMYK +#if SPLASH_CMYK Guchar r1, g1, b1; int i; SplashColor src2, dest2; @@ -936,7 +936,7 @@ static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest, SplashColorPtr blend, SplashColorMode cm) { Guchar r0, g0, b0; -#ifdef SPLASH_CMYK +#if SPLASH_CMYK Guchar r1, g1, b1; int i; SplashColor src2, dest2; diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc index a1b0b11..bf4f0b0 100644 --- a/qt4/src/poppler-document.cc +++ b/qt4/src/poppler-document.cc @@ -691,7 +691,7 @@ namespace Poppler { } bool isOverprintPreviewAvailable() { -#if defined(SPLASH_CMYK) +#if SPLASH_CMYK return true; #else return false; diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc index 49ad871..272e497 100644 --- a/qt4/src/poppler-page.cc +++ b/qt4/src/poppler-page.cc @@ -295,7 +295,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, #if defined(HAVE_SPLASH) SplashColor bgColor; GBool overprint = gFalse; -#if defined(SPLASH_CMYK) +#if SPLASH_CMYK overprint = m_page->parentDoc->m_hints & Document::OverprintPreview ? gTrue : gFalse; if (overprint) { @@ -332,7 +332,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, if (m_page->parentDoc->m_hints & Document::ThinLineSolid) thinLineMode = splashThinLineSolid; SplashOutputDev * splash_output = new SplashOutputDev( -#if defined(SPLASH_CMYK) +#if SPLASH_CMYK (overprint) ? splashModeDeviceN8 : splashModeXBGR8, #else splashModeXBGR8, diff --git a/qt5/src/poppler-document.cc b/qt5/src/poppler-document.cc index 21f0633..dde8173 100644 --- a/qt5/src/poppler-document.cc +++ b/qt5/src/poppler-document.cc @@ -672,7 +672,7 @@ namespace Poppler { } bool isOverprintPreviewAvailable() { -#if defined(SPLASH_CMYK) +#if SPLASH_CMYK return true; #else return false; diff --git a/qt5/src/poppler-page.cc b/qt5/src/poppler-page.cc index 408099c..1129c98 100644 --- a/qt5/src/poppler-page.cc +++ b/qt5/src/poppler-page.cc @@ -295,7 +295,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, #if defined(HAVE_SPLASH) SplashColor bgColor; GBool overprint = gFalse; -#if defined(SPLASH_CMYK) +#if SPLASH_CMYK overprint = m_page->parentDoc->m_hints & Document::OverprintPreview ? gTrue : gFalse; if (overprint) { @@ -332,7 +332,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, if (m_page->parentDoc->m_hints & Document::ThinLineSolid) thinLineMode = splashThinLineSolid; SplashOutputDev * splash_output = new SplashOutputDev( -#if defined(SPLASH_CMYK) +#if SPLASH_CMYK (overprint) ? splashModeDeviceN8 : splashModeXBGR8, #else splashModeXBGR8, diff --git a/splash/Splash.cc b/splash/Splash.cc index 276cc8f..e07fa06 100644 --- a/splash/Splash.cc +++ b/splash/Splash.cc @@ -605,7 +605,7 @@ void Splash::pipeRun(SplashPipe *pipe) { //----- blend function if (state->blendFunc) { -#ifdef SPLASH_CMYK +#if SPLASH_CMYK if (bitmap->mode == splashModeDeviceN8) { for (int k = 4; k < 4 + SPOT_NCOMPS; k++) { cBlend[k] = 0; diff --git a/splash/SplashBitmap.cc b/splash/SplashBitmap.cc index e886683..13dfe58 100644 --- a/splash/SplashBitmap.cc +++ b/splash/SplashBitmap.cc @@ -361,7 +361,7 @@ SplashError SplashBitmap::writeImgFile(SplashImageFileFormat format, FILE *f, in #endif #ifdef ENABLE_LIBJPEG - #ifdef SPLASH_CMYK + #if SPLASH_CMYK case splashFormatJpegCMYK: writer = new JpegWriter(JpegWriter::CMYK); break;