beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / goo / PNGWriter.h
blob90a298e7ef32f3bf574241c6f56a46b2a8b470e3
1 //========================================================================
2 //
3 // PNGWriter.h
4 //
5 // This file is licensed under the GPLv2 or later
6 //
7 // Copyright (C) 2009 Warren Toomey <wkt@tuhs.org>
8 // Copyright (C) 2009 Shen Liang <shenzhuxi@gmail.com>
9 // Copyright (C) 2009, 2011-2013 Albert Astals Cid <aacid@kde.org>
10 // Copyright (C) 2009 Stefan Thomas <thomas@eload24.com>
11 // Copyright (C) 2010, 2011, 2013 Adrian Johnson <ajohnson@redneon.com>
12 // Copyright (C) 2012 Pino Toscano <pino@kde.org>
14 //========================================================================
16 #ifndef PNGWRITER_H
17 #define PNGWRITER_H
19 #include "poppler-config.h"
21 #ifdef ENABLE_LIBPNG
23 #include "ImgWriter.h"
25 struct PNGWriterPrivate;
27 class PNGWriter : public ImgWriter
29 public:
31 /* RGB - 3 bytes/pixel
32 * RGBA - 4 bytes/pixel
33 * GRAY - 1 byte/pixel
34 * MONOCHROME - 8 pixels/byte
36 enum Format { RGB, RGBA, GRAY, MONOCHROME };
38 PNGWriter(Format format = RGB);
39 ~PNGWriter();
41 void setICCProfile(const char *name, unsigned char *data, int size);
42 void setSRGBProfile();
45 bool init(FILE *f, int width, int height, int hDPI, int vDPI);
47 bool writePointers(unsigned char **rowPointers, int rowCount);
48 bool writeRow(unsigned char **row);
50 bool close();
52 private:
53 PNGWriter(const PNGWriter &other);
54 PNGWriter& operator=(const PNGWriter &other);
56 PNGWriterPrivate *priv;
59 #endif
61 #endif