1 //========================================================================
2 //
3 // TiffWriter.h
4 //
5 // This file is licensed under the GPLv2 or later
6 //
7 // Copyright (C) 2010, 2012 William Bader <williambader@hotmail.com>
8 // Copyright (C) 2011, 2012 Albert Astals Cid <aacid@kde.org>
9 // Copyright (C) 2012 Adrian Johnson <ajohnson@redneon.com>
10 // Copyright (C) 2012 Pino Toscano <pino@kde.org>
11 //
12 //========================================================================
13 
14 #ifndef TIFFWRITER_H
15 #define TIFFWRITER_H
16 
17 #include "poppler-config.h"
18 
19 #ifdef ENABLE_LIBTIFF
20 
21 #include <sys/types.h>
22 #include "ImgWriter.h"
23 
24 struct TiffWriterPrivate;
25 
26 class TiffWriter : public ImgWriter
27 {
28 public:
29   /* RGB                 - 3 bytes/pixel
30    * RGBA_PREMULTIPLIED  - 4 bytes/pixel premultiplied by alpha
31    * GRAY                - 1 byte/pixel
32    * MONOCHROME          - 8 pixels/byte
33    * CMYK                - 4 bytes/pixel
34    */
35   enum Format { RGB, RGBA_PREMULTIPLIED, GRAY, MONOCHROME, CMYK };
36 
37   TiffWriter(Format format = RGB);
38   ~TiffWriter();
39 
40   void setCompressionString(const char *compressionStringArg);
41 
42   bool init(FILE *openedFile, int width, int height, int hDPI, int vDPI);
43 
44   bool writePointers(unsigned char **rowPointers, int rowCount);
45   bool writeRow(unsigned char **rowData);
46 
supportCMYK()47   bool supportCMYK() { return true; }
48 
49   bool close();
50 
51 private:
52   TiffWriter(const TiffWriter &other);
53   TiffWriter& operator=(const TiffWriter &other);
54 
55   TiffWriterPrivate *priv;
56 };
57 
58 #endif
59 
60 #endif
61