TiffWriter.h 1.58 KB
Newer Older
1
2
3
4
5
6
//========================================================================
//
// TiffWriter.h
//
// This file is licensed under the GPLv2 or later
//
7
// Copyright (C) 2010, 2012 William Bader <williambader@hotmail.com>
8
// Copyright (C) 2011, 2012 Albert Astals Cid <aacid@kde.org>
Albert Astals Cid's avatar
Albert Astals Cid committed
9
// Copyright (C) 2012, 2017 Adrian Johnson <ajohnson@redneon.com>
Albert Astals Cid's avatar
Albert Astals Cid committed
10
// Copyright (C) 2012 Pino Toscano <pino@kde.org>
11
12
13
14
15
16
//
//========================================================================

#ifndef TIFFWRITER_H
#define TIFFWRITER_H

17
#include "poppler-config.h"
18
19
20
21
22
23

#ifdef ENABLE_LIBTIFF

#include <sys/types.h>
#include "ImgWriter.h"

24
struct TiffWriterPrivate;
25
26
27

class TiffWriter : public ImgWriter
{
28
29
30
31
32
33
public:
  /* RGB                 - 3 bytes/pixel
   * RGBA_PREMULTIPLIED  - 4 bytes/pixel premultiplied by alpha
   * GRAY                - 1 byte/pixel
   * MONOCHROME          - 8 pixels/byte
   * CMYK                - 4 bytes/pixel
34
   * RGB48               - 6 bytes/pixel
35
   */
36
  enum Format { RGB, RGBA_PREMULTIPLIED, GRAY, MONOCHROME, CMYK, RGB48 };
37
38

  TiffWriter(Format format = RGB);
39
  ~TiffWriter() override;
40

41
42
43
  TiffWriter(const TiffWriter &other) = delete;
  TiffWriter& operator=(const TiffWriter &other) = delete;

44
45
  void setCompressionString(const char *compressionStringArg);

Albert Astals Cid's avatar
Albert Astals Cid committed
46
  bool init(FILE *openedFile, int width, int height, int hDPI, int vDPI) override;
47

Albert Astals Cid's avatar
Albert Astals Cid committed
48
49
  bool writePointers(unsigned char **rowPointers, int rowCount) override;
  bool writeRow(unsigned char **rowData) override;
50

Albert Astals Cid's avatar
Albert Astals Cid committed
51
  bool supportCMYK() override { return true; }
52

Albert Astals Cid's avatar
Albert Astals Cid committed
53
  bool close() override;
54
55

private:
56
  TiffWriterPrivate *priv;
57
58
59
60
61
};

#endif

#endif