1 //========================================================================
5 // This file is licensed under the GPLv2 or later
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
31 /* RGB - 3 bytes/pixel
32 * MONOCHROME - 8 pixels/byte
34 enum Format
{ RGB
, MONOCHROME
};
36 NetPBMWriter(Format formatA
= RGB
);
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
);