summaryrefslogtreecommitdiff
path: root/cpp/poppler-image.cpp
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2013-08-28 08:05:23 +0930
committerAdrian Johnson <ajohnson@redneon.com>2013-08-30 21:35:45 +0930
commite116ef32504b589001814f0f579309ecf7ec89d9 (patch)
tree7b6a6ec2897974c004a702ea573871849b633923 /cpp/poppler-image.cpp
parenta87a11ee6bbd0f5707a3ac34ac2b9cc79f4e92d0 (diff)
Make cpp/poppler-image.cc use goo/NetPBMWriter
Diffstat (limited to 'cpp/poppler-image.cpp')
-rw-r--r--cpp/poppler-image.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/cpp/poppler-image.cpp b/cpp/poppler-image.cpp
index 8e9ac63d..18f9c797 100644
--- a/cpp/poppler-image.cpp
+++ b/cpp/poppler-image.cpp
@@ -31,7 +31,7 @@
#if defined(ENABLE_LIBTIFF)
#include "TiffWriter.h"
#endif
-#include "PNMWriter.h"
+#include "NetPBMWriter.h"
#include <cstdlib>
#include <cstring>
@@ -39,8 +39,6 @@
#include <memory>
#include <vector>
-using poppler::PNMWriter;
-
namespace {
struct FileCloser {
@@ -69,17 +67,17 @@ int calc_bytes_per_row(int width, poppler::image::format_enum format)
return 0;
}
-PNMWriter::OutFormat pnm_format(poppler::image::format_enum format)
+NetPBMWriter::Format pnm_format(poppler::image::format_enum format)
{
switch (format) {
case poppler::image::format_invalid: // unused, anyway
case poppler::image::format_mono:
- return PNMWriter::PBM;
+ return NetPBMWriter::MONOCHROME;
case poppler::image::format_rgb24:
case poppler::image::format_argb32:
- return PNMWriter::PPM;
+ return NetPBMWriter::RGB;
}
- return PNMWriter::PPM;
+ return NetPBMWriter::RGB;
}
}
@@ -366,7 +364,7 @@ bool image::save(const std::string &file_name, const std::string &out_format, in
}
#endif
else if (fmt == "pnm") {
- w.reset(new PNMWriter(pnm_format(d->format)));
+ w.reset(new NetPBMWriter(pnm_format(d->format)));
}
if (!w.get()) {
return false;