summaryrefslogtreecommitdiff
path: root/goo/PNGWriter.h
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2009-08-08 00:20:52 +0200
committerAlbert Astals Cid <aacid@kde.org>2009-08-08 00:22:31 +0200
commit92744b72df9084fd2d69ba78406898378884aed8 (patch)
tree6bdb7d612ce6f420389ad0b157918eea604858d3 /goo/PNGWriter.h
parente4439ff527bb202d0239f78e647452983b733411 (diff)
Add the -png flag to pdftoppm to output to PNG
Based on a patch by Shen Liang <shenzhuxi@gmail.com> Also factored common PNG code from HtmlOutputDev to PNGWriter
Diffstat (limited to 'goo/PNGWriter.h')
-rw-r--r--goo/PNGWriter.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/goo/PNGWriter.h b/goo/PNGWriter.h
new file mode 100644
index 00000000..0540bd7d
--- /dev/null
+++ b/goo/PNGWriter.h
@@ -0,0 +1,43 @@
+//========================================================================
+//
+// PNGWriter.h
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright (C) 2009 Warren Toomey <wkt@tuhs.org>
+// Copyright (C) 2009 Shen Liang <shenzhuxi@gmail.com>
+// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
+//
+//========================================================================
+
+#ifndef PNGWRITER_H
+#define PNGWRITER_H
+
+#include <config.h>
+
+#ifdef ENABLE_LIBPNG
+
+#include <cstdio>
+#include <png.h>
+
+class PNGWriter
+{
+ public:
+ PNGWriter();
+ ~PNGWriter();
+
+ bool init(FILE *f, int width, int height);
+
+ bool writePointers(png_bytep *rowPointers);
+ bool writeRow(png_bytep *row);
+
+ bool close();
+
+ private:
+ png_structp png_ptr;
+ png_infop info_ptr;
+};
+
+#endif
+
+#endif \ No newline at end of file