summaryrefslogtreecommitdiff
path: root/boost/gil/extension/io/tiff/detail/scanline_read.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/gil/extension/io/tiff/detail/scanline_read.hpp')
-rw-r--r--boost/gil/extension/io/tiff/detail/scanline_read.hpp62
1 files changed, 28 insertions, 34 deletions
diff --git a/boost/gil/extension/io/tiff/detail/scanline_read.hpp b/boost/gil/extension/io/tiff/detail/scanline_read.hpp
index e07e391801..f3369c4714 100644
--- a/boost/gil/extension/io/tiff/detail/scanline_read.hpp
+++ b/boost/gil/extension/io/tiff/detail/scanline_read.hpp
@@ -20,11 +20,10 @@
#include <boost/gil/io/row_buffer_helper.hpp>
#include <boost/gil/io/scanline_read_iterator.hpp>
-#include <boost/function.hpp>
-#include <boost/static_assert.hpp>
-
#include <algorithm>
+#include <functional>
#include <string>
+#include <type_traits>
#include <vector>
// taken from jpegxx - https://bitbucket.org/edd/jpegxx/src/ea2492a1a4a6/src/ijg_headers.hpp
@@ -54,13 +53,10 @@ class scanline_reader< Device
{
public:
-
- typedef tiff_tag tag_t;
- typedef reader_backend < Device, tag_t > backend_t;
- typedef scanline_reader< Device, tag_t > this_t;
- typedef scanline_read_iterator< this_t > iterator_t;
-
-public:
+ using tag_t = tiff_tag;
+ using backend_t = reader_backend<Device, tag_t>;
+ using this_t = scanline_reader<Device, tag_t>;
+ using iterator_t = scanline_read_iterator<this_t>;
scanline_reader( Device& device
, const image_read_settings< tiff_tag >& settings
@@ -113,7 +109,7 @@ private:
{
case 1:
{
- typedef channel_type< get_pixel_type< gray1_image_t::view_t >::type >::type channel_t;
+ using channel_t = channel_type<get_pixel_type<gray1_image_t::view_t>::type>::type;
int num_colors = channel_traits< channel_t >::max_value() + 1;
@@ -125,14 +121,14 @@ private:
, sizeof(uint16_t) * num_colors
);
- _read_function = boost::mem_fn( &this_t::read_1_bit_index_image );
+ _read_function = std::mem_fn(&this_t::read_1_bit_index_image);
break;
}
case 2:
{
- typedef channel_type< get_pixel_type< gray2_image_t::view_t >::type >::type channel_t;
+ using channel_t = channel_type<get_pixel_type<gray2_image_t::view_t>::type>::type;
int num_colors = channel_traits< channel_t >::max_value() + 1;
@@ -144,13 +140,13 @@ private:
, sizeof(uint16_t) * num_colors
);
- _read_function = boost::mem_fn( &this_t::read_2_bits_index_image );
+ _read_function = std::mem_fn(&this_t::read_2_bits_index_image);
break;
}
case 4:
{
- typedef channel_type< get_pixel_type< gray4_image_t::view_t >::type >::type channel_t;
+ using channel_t = channel_type<get_pixel_type<gray4_image_t::view_t>::type>::type;
int num_colors = channel_traits< channel_t >::max_value() + 1;
@@ -162,14 +158,14 @@ private:
, sizeof(uint16_t) * num_colors
);
- _read_function = boost::mem_fn( &this_t::read_4_bits_index_image );
+ _read_function = std::mem_fn(&this_t::read_4_bits_index_image);
break;
}
case 8:
{
- typedef channel_type< get_pixel_type< gray8_image_t::view_t >::type >::type channel_t;
+ using channel_t = channel_type<get_pixel_type<gray8_image_t::view_t>::type>::type;
int num_colors = channel_traits< channel_t >::max_value() + 1;
@@ -181,14 +177,14 @@ private:
, sizeof(uint16_t) * num_colors
);
- _read_function = boost::mem_fn( &this_t::read_8_bits_index_image );
+ _read_function = std::mem_fn(&this_t::read_8_bits_index_image);
break;
}
case 16:
{
- typedef channel_type< get_pixel_type< gray16_image_t::view_t >::type >::type channel_t;
+ using channel_t = channel_type<get_pixel_type<gray16_image_t::view_t>::type>::type;
int num_colors = channel_traits< channel_t >::max_value() + 1;
@@ -200,14 +196,14 @@ private:
, sizeof(uint16_t) * num_colors
);
- _read_function = boost::mem_fn( &this_t::read_16_bits_index_image );
+ _read_function = std::mem_fn(&this_t::read_16_bits_index_image);
break;
}
case 24:
{
- typedef channel_type< get_pixel_type< gray24_image_t::view_t >::type >::type channel_t;
+ using channel_t = channel_type<get_pixel_type<gray24_image_t::view_t>::type>::type;
int num_colors = channel_traits< channel_t >::max_value() + 1;
@@ -219,14 +215,14 @@ private:
, sizeof(uint16_t) * num_colors
);
- _read_function = boost::mem_fn( &this_t::read_24_bits_index_image );
+ _read_function = std::mem_fn(&this_t::read_24_bits_index_image);
break;
}
case 32:
{
- typedef channel_type< get_pixel_type< gray32_image_t::view_t >::type >::type channel_t;
+ using channel_t = channel_type<get_pixel_type<gray32_image_t::view_t>::type>::type;
int num_colors = channel_traits< channel_t >::max_value() + 1;
@@ -238,7 +234,7 @@ private:
, sizeof(uint16_t) * num_colors
);
- _read_function = boost::mem_fn( &this_t::read_32_bits_index_image );
+ _read_function = std::mem_fn(&this_t::read_32_bits_index_image);
break;
}
@@ -276,7 +272,7 @@ private:
case 14:
case 16:
case 24:
- case 32: { _read_function = boost::mem_fn( &this_t::read_row ); break; }
+ case 32: { _read_function = std::mem_fn(&this_t::read_row); break; }
default: { io_error( "Image type is not supported." ); }
}
@@ -299,7 +295,7 @@ private:
case 14:
case 16:
case 24:
- case 32: { _read_function = boost::mem_fn( &this_t::read_row ); break; }
+ case 32: { _read_function = std::mem_fn(&this_t::read_row); break; }
default: { io_error( "Image type is not supported." ); }
}
@@ -318,7 +314,7 @@ private:
case 14:
case 16:
case 24:
- case 32: { _read_function = boost::mem_fn( &this_t::read_row ); break; }
+ case 32: { _read_function = std::mem_fn(&this_t::read_row); break; }
default: { io_error( "Image type is not supported." ); }
}
@@ -342,7 +338,7 @@ private:
case 14:
case 16:
case 24:
- case 32: { _read_function = boost::mem_fn( &this_t::read_row ); break; }
+ case 32: { _read_function = std::mem_fn(&this_t::read_row); break; }
default: { io_error( "Image type is not supported." ); }
}
@@ -362,7 +358,7 @@ private:
template< typename Src_View >
void read_n_bits_row( byte_t* dst, int pos )
{
- typedef rgb16_view_t dst_view_t;
+ using dst_view_t = rgb16_view_t;
this->_io_dev.read_scanline( _buffer
, pos
@@ -440,11 +436,9 @@ private:
private:
- std::vector< byte_t > _buffer;
-
- detail::mirror_bits< std::vector< byte_t >, mpl::true_ > _mirror_bites;
-
- boost::function< void ( this_t*, byte_t*, int ) > _read_function;
+ std::vector< byte_t> _buffer;
+ detail::mirror_bits<std::vector<byte_t>, std::true_type> _mirror_bites;
+ std::function<void(this_t*, byte_t*, int)> _read_function;
};
} // namespace gil