From 97e0fd55e291cb52dd5181351ab37b719340fa1d Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 18 Mar 2019 16:03:26 +0100 Subject: [PATCH] Tidy up redundant code --- src/libslic3r/Rasterizer/Rasterizer.cpp | 29 ++----------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/libslic3r/Rasterizer/Rasterizer.cpp b/src/libslic3r/Rasterizer/Rasterizer.cpp index 5ddf760a4..0967c84ae 100644 --- a/src/libslic3r/Rasterizer/Rasterizer.cpp +++ b/src/libslic3r/Rasterizer/Rasterizer.cpp @@ -15,9 +15,6 @@ #include #include -// For png compression -//#include - // Experimental minz image write: #include @@ -181,32 +178,10 @@ void Raster::draw(const ExPolygon &poly) void Raster::save(std::ostream& stream, Compression comp) { assert(m_impl); + if(!stream.good()) return; + switch(comp) { case Compression::PNG: { - -// png::writer wr(stream); - -// wr.set_bit_depth(8); -// wr.set_color_type(png::color_type_gray); -// wr.set_width(resolution().width_px); -// wr.set_height(resolution().height_px); -// wr.set_compression_type(png::compression_type_default); - -// wr.write_info(); - -// auto& b = m_impl->buffer(); -// auto ptr = reinterpret_cast( b.data() ); -// unsigned stride = -// sizeof(Impl::TBuffer::value_type) * resolution().width_px; - -// for(unsigned r = 0; r < resolution().height_px; r++, ptr+=stride) { -// wr.write_row(ptr); -// } - -// wr.write_end_info(); - - if(!stream.good()) break; - auto& b = m_impl->buffer(); size_t out_len = 0; void * rawdata = tdefl_write_image_to_png_file_in_memory(