Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:12:34

0001 //
0002 // Copyright 2010 Fabien Castan, Christian Henning
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
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, // color (Boost.MP11-compatible list)
0022             Channel                                // channel type
0023         >::value;                                  // index of the channel in the color (Boost.MP11-compatible list)
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 /// \ingroup ImageViewTransformationsKthChannel
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 }} // namespace boost::gil
0057 
0058 #endif