From 4d8796dbd317f352dc4df98d0e6e6cfbb7ef9d87 Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 18 May 2017 15:23:22 +0200 Subject: [PATCH] remove unused code --- src/tiff_reader.cpp | 50 --------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/src/tiff_reader.cpp b/src/tiff_reader.cpp index e6eed4241..5f3142d64 100644 --- a/src/tiff_reader.cpp +++ b/src/tiff_reader.cpp @@ -169,8 +169,6 @@ private: template void read_stripped(std::size_t x,std::size_t y, ImageData & image); - void read_stripped(std::size_t x,std::size_t y, image_rgba8 & image); - template void read_tiled(std::size_t x,std::size_t y, ImageData & image); @@ -714,54 +712,6 @@ void tiff_reader::read_tiled(std::size_t x0,std::size_t y0, ImageData & image } } -template -void tiff_reader::read_stripped(std::size_t x0, std::size_t y0, image_rgba8 & image) -{ - using pixel_type = typename detail::tiff_reader_traits::pixel_type; - TIFF* tif = open(stream_); - if (tif) - { - std::uint32_t strip_size = TIFFStripSize(tif); - std::unique_ptr strip(new pixel_type[strip_size]); - std::size_t width = image.width(); - std::size_t height = image.height(); - - std::size_t start_y = (y0 / rows_per_strip_) * rows_per_strip_; - std::size_t end_y = std::min(y0 + height, height_); - std::size_t tx0, tx1, ty0, ty1, rows_on_strip; - - tx0 = x0; - tx1 = std::min(width + x0, width_); - rows_on_strip = rows_per_strip_; - std::size_t row = 0; - bool pick_first_band = (bands_ > 1) && (strip_size / (width_ * rows_per_strip_ * sizeof(pixel_type)) == bands_); - for (std::size_t y = start_y; y < end_y; y += rows_per_strip_) - { - ty0 = std::max(y0, y) - y; - ty1 = std::min(end_y, y + rows_per_strip_) - y; - rows_on_strip = std::min(end_y - y, static_cast(rows_per_strip_)); - - if (!detail::tiff_reader_traits::read_strip(tif, y, rows_per_strip_, width_, strip.get())) - { - MAPNIK_LOG_DEBUG(tiff_reader) << "TIFFRead(Encoded|RGBA)Strip failed at " << y << " for " << width_ << "/" << height_ << "\n"; - break; - } - if (pick_first_band) - { - std::uint32_t size = width_ * rows_per_strip_ * sizeof(pixel_type); - for (std::uint32_t n = 0; n < size; ++n) - { - strip[n] = strip[bands_ * n]; - } - } - for (std::size_t ty = ty0; ty < ty1; ++ty) - { - image.set_row(row++, tx0 - x0, tx1 - x0, &strip[(rows_on_strip - ty - 1) * width_ + tx0]); - } - } - } -} - template template void tiff_reader::read_stripped(std::size_t x0, std::size_t y0, ImageData & image)