2
0
mirror of https://github.com/boostorg/gil.git synced 2026-02-27 05:02:19 +00:00
Files
gil/toolbox/test/channel_view.cpp
Mateusz Łoskot 45ca507ca3 Replace some uses of boost::is_same with std::is_same (#225)
Those are places boost::is_same can be replaced in non-intrusive way.
Remaining are types derived from boost::is_same, where the replacing
would affect all their uses - effectively switching from boost::true_/false_ types
to std::true_type and std::false_type.
Such change needs to come along with Boost.MPL to MP11 migration.
2019-01-27 10:54:05 +00:00

44 lines
1.1 KiB
C++

//
// Copyright 2013 Christian Henning
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/gil.hpp>
#include <boost/gil/extension/toolbox/metafunctions/channel_view.hpp>
#include <boost/test/unit_test.hpp>
#include <type_traits>
namespace bg = boost::gil;
BOOST_AUTO_TEST_SUITE(toolbox_tests)
BOOST_AUTO_TEST_CASE(channel_view_test)
{
using image_t = bg::rgb8_image_t;
image_t img(100, 100);
using kth_channel_view_t
= bg::kth_channel_view_type<0, bg::rgb8_view_t::const_t>::type;
using channel_view_t
= bg::channel_view_type<bg::red_t, bg::rgb8_view_t::const_t>::type;
static_assert(std::is_same
<
kth_channel_view_t,
channel_view_t
>::value,
"");
kth_channel_view_t const kth0 = bg::kth_channel_view<0>(bg::const_view(img));
BOOST_TEST(kth0.num_channels() == 1);
channel_view_t const red = bg::channel_view<bg::red_t>(bg::const_view(img));
BOOST_TEST(red.num_channels() == 1);
}
BOOST_AUTO_TEST_SUITE_END()