1 //========================================================================
5 // This file is licensed under the GPLv2 or later
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 //========================================================================
19 #include "poppler-config.h"
23 #include "ImgWriter.h"
25 struct PNGWriterPrivate
;
27 class PNGWriter
: public ImgWriter
31 /* RGB - 3 bytes/pixel
32 * RGBA - 4 bytes/pixel
34 * MONOCHROME - 8 pixels/byte
36 enum Format
{ RGB
, RGBA
, GRAY
, MONOCHROME
};
38 PNGWriter(Format format
= RGB
);
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
);
53 PNGWriter(const PNGWriter
&other
);
54 PNGWriter
& operator=(const PNGWriter
&other
);
56 PNGWriterPrivate
*priv
;