diff options
Diffstat (limited to 'poppler')
-rw-r--r-- | poppler/PSOutputDev.cc | 37 | ||||
-rw-r--r-- | poppler/PSOutputDev.h | 10 | ||||
-rw-r--r-- | poppler/Stream.cc | 6 | ||||
-rw-r--r-- | poppler/Stream.h | 4 | ||||
-rw-r--r-- | poppler/poppler-config.h.cmake | 5 |
5 files changed, 12 insertions, 50 deletions
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc index aeba5fce..75bb1859 100644 --- a/poppler/PSOutputDev.cc +++ b/poppler/PSOutputDev.cc @@ -79,11 +79,9 @@ #include "PreScanOutputDev.h" #include "FileSpec.h" #include "CharCodeToUnicode.h" -#ifdef HAVE_SPLASH -# include "splash/Splash.h" -# include "splash/SplashBitmap.h" -# include "SplashOutputDev.h" -#endif +#include "splash/Splash.h" +#include "splash/SplashBitmap.h" +#include "SplashOutputDev.h" #include "PSOutputDev.h" #include "PDFDoc.h" @@ -1263,9 +1261,7 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA, PSFileType clipLLX0 = clipLLY0 = 0; clipURX0 = clipURY0 = -1; -#ifdef HAVE_SPLASH processColorFormatSpecified = false; -#endif // initialize sequential page number seqPage = 1; @@ -1387,7 +1383,6 @@ void PSOutputDev::postInit() numTilingPatterns = 0; nextFunc = 0; -#ifdef HAVE_SPLASH // set some default process color format if none is set if (!processColorFormatSpecified) { if (level == psLevel1) { @@ -1395,7 +1390,7 @@ void PSOutputDev::postInit() } else if (level == psLevel1Sep || level == psLevel2Sep || level == psLevel3Sep || globalParams->getOverprintPreview()) { processColorFormat = splashModeCMYK8; } -# ifdef USE_CMS +#ifdef USE_CMS else if (getDisplayProfile()) { auto processcolorspace = cmsGetColorSpace(getDisplayProfile().get()); if (processcolorspace == cmsSigCmykData) { @@ -1406,7 +1401,7 @@ void PSOutputDev::postInit() processColorFormat = splashModeRGB8; } } -# endif +#endif else { processColorFormat = splashModeRGB8; } @@ -1424,7 +1419,7 @@ void PSOutputDev::postInit() " Resetting processColorFormat to CMYK8."); processColorFormat = splashModeCMYK8; } -# ifdef USE_CMS +#ifdef USE_CMS if (getDisplayProfile()) { auto processcolorspace = cmsGetColorSpace(getDisplayProfile().get()); if (processColorFormat == splashModeCMYK8) { @@ -1441,7 +1436,6 @@ void PSOutputDev::postInit() } } } -# endif #endif // initialize embedded font resource comment list @@ -3136,7 +3130,6 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, i { PreScanOutputDev *scan; bool rasterize; -#ifdef HAVE_SPLASH bool useFlate, useLZW; SplashOutputDev *splashOut; SplashColor paperColor; @@ -3156,7 +3149,6 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, i bool isOptimizedGray; bool overprint; SplashColorMode internalColorFormat; -#endif if (!postInitDone) { postInit(); @@ -3175,7 +3167,6 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, i return true; } -#ifdef HAVE_SPLASH // get the rasterization parameters useFlate = getEnableFlate() && level >= psLevel3; useLZW = getEnableLZW(); @@ -3223,12 +3214,12 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, i splashOut = new SplashOutputDev(internalColorFormat, 1, false, paperColor, false, splashThinLineDefault, overprint); splashOut->setFontAntialias(rasterAntialias); splashOut->setVectorAntialias(rasterAntialias); -# ifdef USE_CMS +#ifdef USE_CMS splashOut->setDisplayProfile(getDisplayProfile()); splashOut->setDefaultGrayProfile(getDefaultGrayProfile()); splashOut->setDefaultRGBProfile(getDefaultRGBProfile()); splashOut->setDefaultCMYKProfile(getDefaultCMYKProfile()); -# endif +#endif splashOut->startDoc(doc); // break the page into stripes @@ -3504,7 +3495,7 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, i isOptimizedGray = false; } str0->reset(); -# ifdef ENABLE_ZLIB +#ifdef ENABLE_ZLIB if (useFlate) { if (isOptimizedGray && numComps == 4) { str = new FlateEncoder(new CMYKGrayEncoder(str0)); @@ -3516,7 +3507,7 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, i str = new FlateEncoder(str0); } } else -# endif +#endif if (useLZW) { if (isOptimizedGray && numComps == 4) { str = new LZWEncoder(new CMYKGrayEncoder(str0)); @@ -3619,14 +3610,6 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, i endPage(); return false; - -#else // HAVE_SPLASH - - error(errSyntaxWarning, -1, - "PDF page uses transparency and PSOutputDev was built without" - " the Splash rasterizer - output may not be correct"); - return true; -#endif // HAVE_SPLASH } void PSOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) diff --git a/poppler/PSOutputDev.h b/poppler/PSOutputDev.h index 549d778d..4a623bf3 100644 --- a/poppler/PSOutputDev.h +++ b/poppler/PSOutputDev.h @@ -51,9 +51,7 @@ #include <unordered_map> #include <string> -#ifdef HAVE_SPLASH -# include "splash/Splash.h" -#endif +#include "splash/Splash.h" class PDFDoc; class XRef; @@ -309,10 +307,8 @@ public: void setRasterResolution(double r) { rasterResolution = r; } void setRasterMono(bool b) { -#ifdef HAVE_SPLASH processColorFormat = splashModeMono8; processColorFormatSpecified = true; -#endif } void setUncompressPreloadedImages(bool b) { uncompressPreloadedImages = b; } @@ -349,13 +345,11 @@ public: void setEnableLZW(bool b) { enableLZW = b; } void setEnableFlate(bool b) { enableFlate = b; } -#ifdef HAVE_SPLASH void setProcessColorFormat(SplashColorMode format) { processColorFormat = format; processColorFormatSpecified = true; } -#endif private: void init(PSOutputFunc outputFuncA, void *outputStreamA, PSFileType fileTypeA, char *psTitleA, PDFDoc *doc, const std::vector<int> &pages, PSOutMode modeA, int imgLLXA, int imgLLYA, int imgURXA, int imgURYA, bool manualCtrlA, @@ -524,10 +518,8 @@ private: bool enableLZW; // enable LZW compression bool enableFlate; // enable Flate compression -#ifdef HAVE_SPLASH SplashColorMode processColorFormat; bool processColorFormatSpecified; -#endif std::unordered_set<std::string> iccEmitted; // contains ICCBased CSAs that have been emitted diff --git a/poppler/Stream.cc b/poppler/Stream.cc index cf2d1ed4..886601df 100644 --- a/poppler/Stream.cc +++ b/poppler/Stream.cc @@ -69,9 +69,7 @@ #include "Stream-CCITT.h" #include "CachedFile.h" -#ifdef HAVE_SPLASH -# include "splash/SplashBitmap.h" -#endif +#include "splash/SplashBitmap.h" #ifdef ENABLE_LIBJPEG # include "DCTStream.h" @@ -5179,7 +5177,6 @@ bool RGBGrayEncoder::fillBuf() // SplashBitmapCMYKEncoder //------------------------------------------------------------------------ -#ifdef HAVE_SPLASH SplashBitmapCMYKEncoder::SplashBitmapCMYKEncoder(SplashBitmap *bitmapA) : bitmap(bitmapA) { width = (size_t)4 * bitmap->getWidth(); @@ -5251,4 +5248,3 @@ void SplashBitmapCMYKEncoder::setPos(Goffset pos, int dir) bufPtr = pos % width; } } -#endif diff --git a/poppler/Stream.h b/poppler/Stream.h index 97b91dc3..3669d46c 100644 --- a/poppler/Stream.h +++ b/poppler/Stream.h @@ -49,9 +49,7 @@ class GooFile; class BaseStream; class CachedFile; -#ifdef HAVE_SPLASH class SplashBitmap; -#endif //------------------------------------------------------------------------ @@ -1445,7 +1443,6 @@ private: // pure CMYK colors. In particular for a DeviceN8 bitmap it redacts the spot colorants. //------------------------------------------------------------------------ -#ifdef HAVE_SPLASH class SplashBitmapCMYKEncoder : public Stream { public: @@ -1485,6 +1482,5 @@ private: bool fillBuf(); }; -#endif #endif diff --git a/poppler/poppler-config.h.cmake b/poppler/poppler-config.h.cmake index 9cd82b00..a8c2b1d4 100644 --- a/poppler/poppler-config.h.cmake +++ b/poppler/poppler-config.h.cmake @@ -117,11 +117,6 @@ #cmakedefine USE_BOOST_HEADERS 1 #endif -/* Is splash backend available */ -#ifndef HAVE_SPLASH -#cmakedefine HAVE_SPLASH 1 -#endif - //------------------------------------------------------------------------ // version //------------------------------------------------------------------------ |