beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / goo / JpegWriter.h
blobd69bbbb8ddab56ea6ed00935c6644929026cbb98
1 //========================================================================
2 //
3 // JpegWriter.h
4 //
5 // This file is licensed under the GPLv2 or later
6 //
7 // Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
8 // Copyright (C) 2010, 2012 Adrian Johnson <ajohnson@redneon.com>
9 // Copyright (C) 2010 Jürg Billeter <j@bitron.ch>
10 // Copyright (C) 2010 Harry Roberts <harry.roberts@midnight-labs.org>
11 // Copyright (C) 2010 Brian Cameron <brian.cameron@oracle.com>
12 // Copyright (C) 2011 Albert Astals Cid <aacid@kde.org>
13 // Copyright (C) 2011 Thomas Freitag <Thomas.Freitag@alfa.de>
15 //========================================================================
17 #ifndef JPEGWRITER_H
18 #define JPEGWRITER_H
20 #include "poppler-config.h"
22 #ifdef ENABLE_LIBJPEG
24 #include <sys/types.h>
25 #include "ImgWriter.h"
27 struct JpegWriterPrivate;
29 class JpegWriter : public ImgWriter
31 public:
32 /* RGB - 3 bytes/pixel
33 * GRAY - 1 byte/pixel
34 * CMYK - 4 bytes/pixel
36 enum Format { RGB, GRAY, CMYK };
38 JpegWriter(int quality, bool progressive, Format format = RGB);
39 JpegWriter(Format format = RGB);
40 ~JpegWriter();
42 bool init(FILE *f, int width, int height, int hDPI, int vDPI);
44 bool writePointers(unsigned char **rowPointers, int rowCount);
45 bool writeRow(unsigned char **row);
47 bool close();
48 bool supportCMYK();
50 private:
51 JpegWriter(const JpegWriter &other);
52 JpegWriter& operator=(const JpegWriter &other);
54 JpegWriterPrivate *priv;
57 #endif
59 #endif