beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / goo / NetPBMWriter.h
blob21a19ee7508b02a34b678037b5d18cd14b8e3b4b
1 //========================================================================
2 //
3 // NetPBMWriter.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) 2009, 2011 Albert Astals Cid <aacid@kde.org>
9 // Copyright (C) 2010, 2013 Adrian Johnson <ajohnson@redneon.com>
10 // Copyright (C) 2010 Brian Cameron <brian.cameron@oracle.com>
11 // Copyright (C) 2011 Thomas Freitag <Thomas.Freitag@alfa.de>
13 //========================================================================
15 #ifndef NETPBMWRITER_H
16 #define NETPBMWRITER_H
18 #include "poppler-config.h"
20 #include "ImgWriter.h"
22 // Writer for the NetPBM formats (PBM and PPM)
23 // This format is documented at:
24 // http://netpbm.sourceforge.net/doc/pbm.html
25 // http://netpbm.sourceforge.net/doc/ppm.html
27 class NetPBMWriter : public ImgWriter
29 public:
31 /* RGB - 3 bytes/pixel
32 * MONOCHROME - 8 pixels/byte
34 enum Format { RGB, MONOCHROME };
36 NetPBMWriter(Format formatA = RGB);
37 ~NetPBMWriter() {};
39 bool init(FILE *f, int width, int height, int hDPI, int vDPI);
41 bool writePointers(unsigned char **rowPointers, int rowCount);
42 bool writeRow(unsigned char **row);
44 bool close();
46 private:
47 FILE *file;
48 Format format;
49 int width;
52 #endif