2 // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
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/numeric/kernel.hpp>
10 #include <boost/assert.hpp>
12 #include <initializer_list>
13 #include <type_traits>
15 namespace boost { namespace gil {
17 namespace test { namespace fixture {
20 auto create_kernel(std::initializer_list<T> const& values)
23 static_assert(std::is_arithmetic<T>::value,
24 "kernel value type should be integral or floating-point type");
25 BOOST_ASSERT_MSG((values.size() - 1) % 2 == 0, "expected odd number of kernel values");
26 gil::kernel_1d<T> kernel(values.begin(), values.size(), (values.size() - 1) / 2);
30 }}}} // namespace boost::gil::test::fixture