]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/gil/test/extension/toolbox/channel_view.cpp
2 // Copyright 2013 Christian Henning
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 #include <boost/gil.hpp>
9 #include <boost/gil/extension/toolbox/metafunctions/channel_view.hpp>
11 #include <boost/core/lightweight_test.hpp>
13 #include <type_traits>
15 namespace gil
= boost::gil
;
17 void test_channel_view()
19 using kth_channel_view_t
20 = gil::kth_channel_view_type
<0, gil::rgb8_view_t::const_t
>::type
;
22 = gil::channel_view_type
<gil::red_t
, gil::rgb8_view_t::const_t
>::type
;
24 static_assert(std::is_same
31 gil::rgb8_image_t
img(100, 100);
32 kth_channel_view_t
const kth0
= gil::kth_channel_view
<0>(gil::const_view(img
));
33 BOOST_TEST_EQ(kth0
.num_channels(), 1u);
35 channel_view_t
const red
= gil::channel_view
<gil::red_t
>(gil::const_view(img
));
36 BOOST_TEST_EQ(red
.num_channels(), 1u);
43 return boost::report_errors();