Commit e38ffea6 authored by Adrian Johnson's avatar Adrian Johnson

Fix some -Wundef warnings

parent 9bb84057
......@@ -10,7 +10,7 @@
#include <config.h>
#if USE_FIXEDPOINT
#ifdef USE_FIXEDPOINT
#ifdef USE_GCC_PRAGMAS
#pragma implementation
......
......@@ -127,7 +127,7 @@ extern XpdfPluginVecTable xpdfPluginVecTable;
GlobalParams *globalParams = NULL;
#if ENABLE_RELOCATABLE && defined(_WIN32)
#if defined(ENABLE_RELOCATABLE) && defined(_WIN32)
/* search for data relative to where we are installed */
......
......@@ -67,10 +67,10 @@
#include "Catalog.h"
#include "Page.h"
#include "Stream.h"
#if ENABLE_ZLIB
#ifdef ENABLE_ZLIB
# include "FlateEncoder.h"
#endif
#if ENABLE_ZLIB_UNCOMPRESS
#ifdef ENABLE_ZLIB_UNCOMPRESS
# include "FlateStream.h"
#endif
#include "Annot.h"
......@@ -78,7 +78,7 @@
#include "PreScanOutputDev.h"
#include "FileSpec.h"
#include "CharCodeToUnicode.h"
#if HAVE_SPLASH
#ifdef HAVE_SPLASH
# include "splash/Splash.h"
# include "splash/SplashBitmap.h"
# include "SplashOutputDev.h"
......@@ -3282,7 +3282,7 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
paperColor[0] = 0xff;
splashOut = new SplashOutputDev(splashModeMono8, 1, gFalse,
paperColor, gFalse);
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
} else if (level == psLevel1Sep || level == psLevel2Sep ||
level == psLevel3Sep || globalParams->getOverprintPreview()) {
numComps = 4;
......
......@@ -112,14 +112,14 @@ static inline void convertGfxColor(SplashColorPtr dest,
SplashColor color;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
// make gcc happy
color[0] = color[1] = color[2] = 0;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
color[3] = 0;
#endif
switch (colorMode) {
......@@ -138,7 +138,7 @@ static inline void convertGfxColor(SplashColorPtr dest,
color[1] = colToByte(rgb.g);
color[2] = colToByte(rgb.b);
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
colorSpace->getCMYK(src, &cmyk);
color[0] = colToByte(cmyk.c);
......@@ -189,7 +189,7 @@ static inline void convertGfxShortColor(SplashColorPtr dest,
dest[2] = colToByte(rgb.b);
}
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
{
GfxCMYK cmyk;
......@@ -235,7 +235,7 @@ void SplashGouraudPattern::getParameterizedColor(double colorinterp, SplashColor
GfxColor src;
GfxColorSpace* srcColorSpace = shading->getColorSpace();
int colorComps = 3;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (mode == splashModeCMYK8)
colorComps=4;
else if (mode == splashModeDeviceN8)
......@@ -516,7 +516,7 @@ static inline Guchar div255(int x) {
return (Guchar)((x + (x >> 8) + 0x80) >> 8);
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
#include "GfxState_helpers.h"
......@@ -572,7 +572,7 @@ static void splashOutBlendMultiply(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -585,7 +585,7 @@ static void splashOutBlendMultiply(SplashColorPtr src, SplashColorPtr dest,
blend[i] = (dest[i] * src[i]) / 255;
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -600,7 +600,7 @@ static void splashOutBlendScreen(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -613,7 +613,7 @@ static void splashOutBlendScreen(SplashColorPtr src, SplashColorPtr dest,
blend[i] = dest[i] + src[i] - (dest[i] * src[i]) / 255;
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -628,7 +628,7 @@ static void splashOutBlendOverlay(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -643,7 +643,7 @@ static void splashOutBlendOverlay(SplashColorPtr src, SplashColorPtr dest,
: 255 - 2 * ((255 - src[i]) * (255 - dest[i])) / 255;
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -658,7 +658,7 @@ static void splashOutBlendDarken(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -671,7 +671,7 @@ static void splashOutBlendDarken(SplashColorPtr src, SplashColorPtr dest,
blend[i] = dest[i] < src[i] ? dest[i] : src[i];
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -686,7 +686,7 @@ static void splashOutBlendLighten(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -699,7 +699,7 @@ static void splashOutBlendLighten(SplashColorPtr src, SplashColorPtr dest,
blend[i] = dest[i] > src[i] ? dest[i] : src[i];
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -715,7 +715,7 @@ static void splashOutBlendColorDodge(SplashColorPtr src, SplashColorPtr dest,
SplashColorMode cm) {
int i, x;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -733,7 +733,7 @@ static void splashOutBlendColorDodge(SplashColorPtr src, SplashColorPtr dest,
}
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -748,7 +748,7 @@ static void splashOutBlendColorBurn(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i, x;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -766,7 +766,7 @@ static void splashOutBlendColorBurn(SplashColorPtr src, SplashColorPtr dest,
}
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -781,7 +781,7 @@ static void splashOutBlendHardLight(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -796,7 +796,7 @@ static void splashOutBlendHardLight(SplashColorPtr src, SplashColorPtr dest,
: 255 - 2 * ((255 - dest[i]) * (255 - src[i])) / 255;
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -811,7 +811,7 @@ static void splashOutBlendSoftLight(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i, x;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -833,7 +833,7 @@ static void splashOutBlendSoftLight(SplashColorPtr src, SplashColorPtr dest,
}
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -849,7 +849,7 @@ static void splashOutBlendDifference(SplashColorPtr src, SplashColorPtr dest,
SplashColorMode cm) {
int i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -862,7 +862,7 @@ static void splashOutBlendDifference(SplashColorPtr src, SplashColorPtr dest,
blend[i] = dest[i] < src[i] ? src[i] - dest[i] : dest[i] - src[i];
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -883,7 +883,7 @@ static void splashOutBlendExclusion(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -896,7 +896,7 @@ static void splashOutBlendExclusion(SplashColorPtr src, SplashColorPtr dest,
blend[i] = dest[i] + src[i] - (2 * dest[i] * src[i]) / 255;
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8 || cm == splashModeDeviceN8) {
for (i = 0; i < splashColorModeNComps[cm]; ++i) {
dest[i] = 255 - dest[i];
......@@ -1007,7 +1007,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;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
Guchar r1, g1, b1;
int i;
SplashColor src2, dest2;
......@@ -1028,7 +1028,7 @@ static void splashOutBlendHue(SplashColorPtr src, SplashColorPtr dest,
setLum(r0, g0, b0, getLum(dest[0], dest[1], dest[2]),
&blend[0], &blend[1], &blend[2]);
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
for (i = 0; i < 4; i++) {
......@@ -1058,7 +1058,7 @@ static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend,
SplashColorMode cm) {
Guchar r0, g0, b0;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
Guchar r1, g1, b1;
int i;
SplashColor src2, dest2;
......@@ -1079,7 +1079,7 @@ static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest,
setLum(r0, g0, b0, getLum(dest[0], dest[1], dest[2]),
&blend[0], &blend[1], &blend[2]);
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
for (i = 0; i < 4; i++) {
......@@ -1106,7 +1106,7 @@ static void splashOutBlendSaturation(SplashColorPtr src, SplashColorPtr dest,
static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
Guchar r, g, b;
int i;
SplashColor src2, dest2;
......@@ -1125,7 +1125,7 @@ static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest,
setLum(src[0], src[1], src[2], getLum(dest[0], dest[1], dest[2]),
&blend[0], &blend[1], &blend[2]);
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
for (i = 0; i < 4; i++) {
......@@ -1151,7 +1151,7 @@ static void splashOutBlendColor(SplashColorPtr src, SplashColorPtr dest,
static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend,
SplashColorMode cm) {
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
Guchar r, g, b;
int i;
SplashColor src2, dest2;
......@@ -1170,7 +1170,7 @@ static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
setLum(dest[0], dest[1], dest[2], getLum(src[0], src[1], src[2]),
&blend[0], &blend[1], &blend[2]);
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
for (i = 0; i < 4; i++) {
......@@ -1476,7 +1476,7 @@ void SplashOutputDev::startDoc(PDFDoc *docA) {
delete fontEngine;
}
fontEngine = new SplashFontEngine(
#if HAVE_T1LIB_H
#ifdef HAVE_T1LIB_H
globalParams->getEnableT1lib(),
#endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
......@@ -1557,7 +1557,7 @@ void SplashOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA) {
case splashModeBGR8:
color[0] = color[1] = color[2] = 0;
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
color[0] = color[1] = color[2] = color[3] = 0;
break;
......@@ -1687,14 +1687,14 @@ void SplashOutputDev::updateStrokeAdjust(GfxState * /*state*/) {
}
void SplashOutputDev::updateFillColorSpace(GfxState *state) {
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (colorMode == splashModeDeviceN8)
state->getFillColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
}
void SplashOutputDev::updateStrokeColorSpace(GfxState *state) {
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (colorMode == splashModeDeviceN8)
state->getStrokeColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
......@@ -1703,7 +1703,7 @@ void SplashOutputDev::updateStrokeColorSpace(GfxState *state) {
void SplashOutputDev::updateFillColor(GfxState *state) {
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
......@@ -1720,7 +1720,7 @@ void SplashOutputDev::updateFillColor(GfxState *state) {
state->getFillRGB(&rgb);
splash->setFillPattern(getColor(&rgb));
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
state->getFillCMYK(&cmyk);
splash->setFillPattern(getColor(&cmyk));
......@@ -1736,7 +1736,7 @@ void SplashOutputDev::updateFillColor(GfxState *state) {
void SplashOutputDev::updateStrokeColor(GfxState *state) {
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
......@@ -1753,7 +1753,7 @@ void SplashOutputDev::updateStrokeColor(GfxState *state) {
state->getStrokeRGB(&rgb);
splash->setStrokePattern(getColor(&rgb));
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
state->getStrokeCMYK(&cmyk);
splash->setStrokePattern(getColor(&cmyk));
......@@ -1796,7 +1796,7 @@ SplashPattern *SplashOutputDev::getColor(GfxRGB *rgb) {
return new SplashSolidColor(color);
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
SplashPattern *SplashOutputDev::getColor(GfxCMYK *cmyk) {
SplashColor color;
......@@ -1819,7 +1819,7 @@ SplashPattern *SplashOutputDev::getColor(GfxColor *deviceN) {
void SplashOutputDev::getMatteColor(SplashColorMode colorMode, GfxImageColorMap *colorMap, GfxColor *matteColorIn, SplashColor matteColor) {
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
......@@ -1844,7 +1844,7 @@ void SplashOutputDev::getMatteColor(SplashColorMode colorMode, GfxImageColorMap
matteColor[2] = colToByte(rgb.b);
matteColor[3] = 255;
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
colorMap->getColorSpace()->getCMYK(matteColorIn, &cmyk);
matteColor[0] = colToByte(cmyk.c);
......@@ -1866,7 +1866,7 @@ void SplashOutputDev::setOverprintMask(GfxColorSpace *colorSpace,
int overprintMode,
GfxColor *singleColor,
GBool grayIndexed) {
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
Guint mask;
GfxCMYK cmyk;
GBool additive = gFalse;
......@@ -3038,7 +3038,7 @@ GBool SplashOutputDev::useIccImageSrc(void *data) {
if (colorSpace->getAlt() != NULL && colorSpace->getAlt()->getMode() == csDeviceRGB)
return gTrue;
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
if (colorSpace->getAlt() != NULL && colorSpace->getAlt()->getMode() == csDeviceCMYK)
return gTrue;
......@@ -3063,7 +3063,7 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
SplashColorPtr q, col;
GfxRGB rgb;
GfxGray gray;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
......@@ -3078,7 +3078,7 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
destComps = 3;
else if (imgData->colorMode == splashModeXBGR8)
destComps = 4;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
else if (imgData->colorMode == splashModeCMYK8)
destComps = 4;
else if (imgData->colorMode == splashModeDeviceN8)
......@@ -3116,7 +3116,7 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
*q++ = col[3];
}
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
for (x = 0, q = colorLine; x < imgData->width; ++x, ++p) {
col = &imgData->lookup[4 * *p];
......@@ -3170,7 +3170,7 @@ GBool SplashOutputDev::imageSrc(void *data, SplashColorPtr colorLine,
}
}
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
if (imgData->colorMap->useCMYKLine()) {
imgData->colorMap->getCMYKLine(p, (Guchar *) colorLine, imgData->width);
......@@ -3229,7 +3229,7 @@ GBool SplashOutputDev::iccImageSrc(void *data, SplashColorPtr colorLine,
destComps = 3;
else if (imgData->colorMode == splashModeXBGR8)
destComps = 4;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
else if (imgData->colorMode == splashModeCMYK8)
destComps = 4;
else if (imgData->colorMode == splashModeDeviceN8)
......@@ -3276,7 +3276,7 @@ void SplashOutputDev::iccTransform(void *data, SplashBitmap *bitmap) {
imgData->colorMap->getRGBLine(p, colorLine, bitmap->getWidth());
memcpy(p, colorLine, nComps * bitmap->getWidth());
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
imgData->colorMap->getCMYKLine(p, colorLine, bitmap->getWidth());
memcpy(p, colorLine, nComps * bitmap->getWidth());
......@@ -3314,7 +3314,7 @@ GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
SplashColorPtr q, col;
GfxRGB rgb;
GfxGray gray;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
......@@ -3361,7 +3361,7 @@ GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
*q++ = col[2];
*q++ = 255;
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
col = &imgData->lookup[4 * *p];
*q++ = col[0];
......@@ -3393,7 +3393,7 @@ GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
*q++ = colToByte(rgb.b);
if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
imgData->colorMap->getCMYK(p, &cmyk);
*q++ = colToByte(cmyk.c);
......@@ -3481,7 +3481,7 @@ GBool SplashOutputDev::tilingBitmapSrc(void *data, SplashColorPtr colorLine,
imgData->bitmap->getPixel(x, imgData->y, col);
imgData->pattern->getColor(x, imgData->y, pat);
for (int i = 0; i < splashColorModeNComps[imgData->colorMode]; ++i) {
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
if (imgData->colorMode == splashModeCMYK8 || imgData->colorMode == splashModeDeviceN8)
dest[i] = div255(pat[i] * (255 - col[0]));
else
......@@ -3521,7 +3521,7 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
SplashICCTransform tf;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GBool grayIndexed = gFalse;
GfxColor deviceN;
......@@ -3590,7 +3590,7 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
imgData.lookup[4*i+3] = 255;
}
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
grayIndexed = colorMap->getColorSpace()->getMode() != csDeviceGray;
imgData.lookup = (SplashColorPtr)gmallocn(n, 4);
......@@ -3625,7 +3625,7 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
}
}
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(),
state->getOverprintMode(), NULL, grayIndexed);
#else
......@@ -3675,7 +3675,7 @@ GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine,
SplashColorPtr q, col;
GfxRGB rgb;
GfxGray gray;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
......@@ -3724,7 +3724,7 @@ GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine,
*q++ = col[2];
*q++ = 255;
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
col = &imgData->lookup[4 * *p];
*q++ = col[0];
......@@ -3756,7 +3756,7 @@ GBool SplashOutputDev::maskedImageSrc(void *data, SplashColorPtr colorLine,
*q++ = colToByte(rgb.b);
if (imgData->colorMode == splashModeXBGR8) *q++ = 255;
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
imgData->colorMap->getCMYK(p, &cmyk);
*q++ = colToByte(cmyk.c);
......@@ -3798,14 +3798,14 @@ void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
SplashColor maskColor;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
Guchar pix;
int n, i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
colorMap->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(),
......@@ -3919,7 +3919,7 @@ void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
imgData.lookup[4*i+3] = 255;
}
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 4);
for (i = 0; i < n; ++i) {
......@@ -3976,14 +3976,14 @@ void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref,
SplashColor maskColor;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
Guchar pix;
int n, i;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
colorMap->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
setOverprintMask(colorMap->getColorSpace(), state->getFillOverprint(),
......@@ -4104,7 +4104,7 @@ void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref,
imgData.lookup[4*i+3] = 255;
}
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
imgData.lookup = (SplashColorPtr)gmallocn(n, 4);
for (i = 0; i < n; ++i) {
......@@ -4266,7 +4266,7 @@ void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox,
blendingColorSpace->getNComps() == 3)) {
//~ does this need to use BGR8?
colorMode = splashModeRGB8;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
} else if (blendingColorSpace->getMode() == csDeviceCMYK ||
(blendingColorSpace->getMode() == csICCBased &&
blendingColorSpace->getNComps() == 4)) {
......@@ -4382,7 +4382,7 @@ void SplashOutputDev::setSoftMask(GfxState *state, double *bbox,
SplashColorPtr p;
GfxGray gray;
GfxRGB rgb;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
GfxCMYK cmyk;
GfxColor deviceN;
#endif
......@@ -4420,7 +4420,7 @@ void SplashOutputDev::setSoftMask(GfxState *state, double *bbox,
color[2] = colToByte(rgb.b);
tSplash->compositeBackground(color);
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
transpGroupStack->blendingColorSpace->getCMYK(backdropColor, &cmyk);
color[0] = colToByte(cmyk.c);
......@@ -4479,7 +4479,7 @@ void SplashOutputDev::setSoftMask(GfxState *state, double *bbox,
(0.59 / 255.0) * color[1] +
(0.11 / 255.0) * color[2];
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
lum = (1 - color[3] / 255.0)
......@@ -4697,7 +4697,7 @@ GBool SplashOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *ca
splash = new Splash(bitmap, gTrue);
if (paintType == 2) {
SplashColor clearColor;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
clearColor[0] = (colorMode == splashModeCMYK8 || colorMode == splashModeDeviceN8) ? 0x00 : 0xFF;
#else
clearColor[0] = 0xFF;
......@@ -4773,7 +4773,7 @@ GBool SplashOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTria
case splashModeRGB8:
bDirectColorTranslation = (shadingMode == csDeviceRGB);
break;
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
case splashModeCMYK8:
case splashModeDeviceN8:
bDirectColorTranslation = (shadingMode == csDeviceCMYK);
......@@ -4847,7 +4847,7 @@ GBool SplashOutputDev::univariateShadedFill(GfxState *state, SplashUnivariatePat
state->closePath();
path = convertPath(state, state->getPath(), gTrue);
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
pattern->getShading()->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
setOverprintMask(pattern->getShading()->getColorSpace(), state->getFillOverprint(),
......@@ -4912,7 +4912,7 @@ GBool SplashOutputDev::functionShadedFill(GfxState *state, GfxFunctionShading *s
state->closePath();
path = convertPath(state, state->getPath(), gTrue);
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
pattern->getShading()->getColorSpace()->createMapping(bitmap->getSeparationList(), SPOT_NCOMPS);
#endif
setOverprintMask(pattern->getShading()->getColorSpace(), state->getFillOverprint(),
......
......@@ -404,7 +404,7 @@ private:
void setupScreenParams(double hDPI, double vDPI);
SplashPattern *getColor(GfxGray gray);
SplashPattern *getColor(GfxRGB *rgb);
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
SplashPattern *getColor(GfxCMYK *cmyk);
SplashPattern *getColor(GfxColor *deviceN);
#endif
......
......@@ -839,7 +839,7 @@ namespace Poppler {
}
bool isOverprintPreviewAvailable() {
#if SPLASH_CMYK
#ifdef SPLASH_CMYK
return true;
#else