summaryrefslogtreecommitdiff
path: root/splash
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2012-11-17 10:03:22 +1030
committerAdrian Johnson <ajohnson@redneon.com>2012-11-17 10:03:22 +1030
commit6d3fe48cf30b298b4436462904d781ea441c1f3d (patch)
tree6da82ba9c02a430776017acb508f5a9f1cf0890b /splash
parent15f600a5702788f7e5b91cd67bc2438179921939 (diff)
tiff: remove splash dependency and add RGBA support
Bug 57006
Diffstat (limited to 'splash')
-rw-r--r--splash/SplashBitmap.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/splash/SplashBitmap.cc b/splash/SplashBitmap.cc
index 996f0aa9..f514dfa4 100644
--- a/splash/SplashBitmap.cc
+++ b/splash/SplashBitmap.cc
@@ -373,10 +373,29 @@ SplashError SplashBitmap::writeImgFile(SplashImageFileFormat format, FILE *f, in
#ifdef ENABLE_LIBTIFF
case splashFormatTiff:
- writer = new TiffWriter();
+ switch (mode) {
+ case splashModeMono1:
+ writer = new TiffWriter(TiffWriter::MONOCHROME);
+ break;
+ case splashModeMono8:
+ writer = new TiffWriter(TiffWriter::GRAY);
+ break;
+ case splashModeRGB8:
+ case splashModeBGR8:
+ writer = new TiffWriter(TiffWriter::RGB);
+ break;
+#if SPLASH_CMYK
+ case splashModeCMYK8:
+ case splashModeDeviceN8:
+ writer = new TiffWriter(TiffWriter::CMYK);
+ break;
+#endif
+ default:
+ fprintf(stderr, "TiffWriter: Mode %d not supported\n", mode);
+ writer = new TiffWriter();
+ }
if (writer) {
((TiffWriter *)writer)->setCompressionString(compressionString);
- ((TiffWriter *)writer)->setSplashMode(mode);
}
break;
#endif