File indexing completed on 2024-11-15 09:12:34
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_GIL_EXTENSION_TOOLBOX_CHANNEL_VIEW_HPP
0009 #define BOOST_GIL_EXTENSION_TOOLBOX_CHANNEL_VIEW_HPP
0010
0011 #include <boost/gil/image_view_factory.hpp>
0012
0013 namespace boost {
0014 namespace gil {
0015
0016 template <typename Channel, typename View>
0017 struct channel_type_to_index
0018 {
0019 static constexpr int value = detail::type_to_index
0020 <
0021 typename color_space_type<View>::type,
0022 Channel
0023 >::value;
0024 };
0025
0026 template<typename Channel, typename View>
0027 struct channel_view_type : kth_channel_view_type
0028 <
0029 channel_type_to_index<Channel, View>::value,
0030 View
0031 >
0032 {
0033 static constexpr int index = channel_type_to_index
0034 <
0035 Channel,
0036 View
0037 >::value;
0038
0039 using parent_t = kth_channel_view_type<index, View>;
0040 using type = typename parent_t::type;
0041
0042 static type make( const View& src )
0043 {
0044 return parent_t::make( src );
0045 }
0046 };
0047
0048
0049 template<typename Channel, typename View>
0050 auto channel_view(View const& src)
0051 -> typename channel_view_type<Channel, View>::type
0052 {
0053 return channel_view_type<Channel, View>::make(src);
0054 }
0055
0056 }}
0057
0058 #endif