diff options
Diffstat (limited to 'boost/gil/extension/io/png/detail/write.hpp')
-rw-r--r-- | boost/gil/extension/io/png/detail/write.hpp | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/boost/gil/extension/io/png/detail/write.hpp b/boost/gil/extension/io/png/detail/write.hpp index cf1ef2a2a7..9cec03ada5 100644 --- a/boost/gil/extension/io/png/detail/write.hpp +++ b/boost/gil/extension/io/png/detail/write.hpp @@ -11,6 +11,7 @@ #include <boost/gil/extension/io/png/detail/writer_backend.hpp> #include <boost/gil/io/device.hpp> +#include <boost/gil/io/dynamic_io_new.hpp> #include <boost/gil/io/row_buffer_helper.hpp> #include <boost/mpl/and.hpp> @@ -18,6 +19,8 @@ #include <boost/mpl/less.hpp> #include <boost/mpl/not.hpp> +#include <type_traits> + namespace boost { namespace gil { #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) @@ -53,7 +56,7 @@ class writer< Device public: - typedef writer_backend< Device , png_tag > backend_t; + using backend_t = writer_backend<Device, png_tag>; writer( const Device& io_dev , const image_write_info< png_tag >& info @@ -85,11 +88,13 @@ private: , mpl::false_ // is bit aligned ) { - typedef typename get_pixel_type< View >::type pixel_t; + using pixel_t = typename get_pixel_type<View>::type; - typedef detail::png_write_support< typename channel_type < pixel_t >::type - , typename color_space_type< pixel_t >::type - > png_rw_info; + using png_rw_info = detail::png_write_support + < + typename channel_type<pixel_t>::type, + typename color_space_type<pixel_t>::type + >; if( little_endian() ) { @@ -123,11 +128,11 @@ private: , mpl::true_ // is bit aligned ) { - typedef detail::png_write_support< typename kth_semantic_element_type< typename View::value_type - , 0 - >::type - , typename color_space_type<View>::type - > png_rw_info; + using png_rw_info = detail::png_write_support + < + typename kth_semantic_element_type<typename View::value_type, 0>::type, + typename color_space_type<View>::type + >; if (little_endian() ) { @@ -164,25 +169,30 @@ private: template< typename Info > struct is_less_than_eight : mpl::less< mpl::int_< Info::_bit_depth >, mpl::int_< 8 > > {}; template< typename Info > struct is_equal_to_sixteen : mpl::equal_to< mpl::int_< Info::_bit_depth >, mpl::int_< 16 > > {}; - template< typename Info > - void set_swap( typename enable_if< is_less_than_eight< Info > >::type* /* ptr */ = 0 ) + template <typename Info> + void set_swap(typename std::enable_if<is_less_than_eight<Info>::value>::type* /*ptr*/ = 0) { - png_set_packswap( this->get_struct() ); + png_set_packswap(this->get_struct()); } - template< typename Info > - void set_swap( typename enable_if< is_equal_to_sixteen< Info > >::type* /* ptr */ = 0 ) + template <typename Info> + void set_swap(typename std::enable_if<is_equal_to_sixteen<Info>::value>::type* /*ptr*/ = 0) { - png_set_swap( this->get_struct() ); + png_set_swap(this->get_struct()); } - template< typename Info > - void set_swap( typename enable_if< mpl::and_< mpl::not_< is_less_than_eight< Info > > - , mpl::not_< is_equal_to_sixteen< Info > > - > - >::type* /* ptr */ = 0 - ) - {} + template <typename Info> + void set_swap( + typename std::enable_if + < + mpl::and_ + < + mpl::not_<is_less_than_eight<Info>>, + mpl::not_<is_equal_to_sixteen<Info>> + >::value + >::type* /*ptr*/ = nullptr) + { + } }; /// @@ -196,9 +206,7 @@ class dynamic_image_writer< Device , png_tag > { - typedef writer< Device - , png_tag - > parent_t; + using parent_t = writer<Device, png_tag>; public: |