From b45255900c147323b1ac368af85ad08816dc88ba Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 19 Oct 2015 17:08:35 +1100 Subject: [PATCH] netpbm: avoid image w/h/s variables --- netpbm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netpbm.cpp b/netpbm.cpp index d9971635..b105bcf1 100644 --- a/netpbm.cpp +++ b/netpbm.cpp @@ -48,9 +48,9 @@ util::pgm::read (const boost::filesystem::path &path) if (expected != remain) throw std::runtime_error ("expected data size mismatch"); - util::image::buffer out (width, height); + util::image::buffer out ({width, height}); - CHECK_EQ (out.w, out.s); + CHECK (out.is_packed ()); std::copy (raw.begin () + cooked.tellg () - 1, raw.end (), out.begin ()); return out; @@ -88,7 +88,7 @@ void util::pgm::write (const util::image::buffer &src, std::ostream &dst) { - write (src.begin (), src.w, src.h, src.s, dst); + write (src.begin (), src.extent ().w, src.extent ().h, src.stride ().y, dst); } @@ -98,7 +98,7 @@ util::pgm::write (const util::image::buffer &src, const boost::filesystem::path &path) { std::ofstream dst (path.string ()); - write (src.begin (), src.w, src.h, src.s, path); + write (src.begin (), src.extent ().w, src.extent ().h, src.stride ().y, path); }