2 // Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
4 // Use, modification and distribution are subject to the Boost Software License,
5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP
9 #define BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP
12 #include <boost/gil/extension/numeric/kernel.hpp>
14 namespace boost { namespace gil { namespace detail {
16 static constexpr double pi = 3.14159265358979323846;
18 static constexpr std::array<float, 9> dx_sobel = {{-1, 0, 1, -2, 0, 2, -1, 0, 1}};
19 static constexpr std::array<float, 9> dx_scharr = {{-1, 0, 1, -1, 0, 1, -1, 0, 1}};
20 static constexpr std::array<float, 9> dy_sobel = {{1, 2, 1, 0, 0, 0, -1, -2, -1}};
21 static constexpr std::array<float, 9> dy_scharr = {{1, 1, 1, 0, 0, 0, -1, -1, -1}};
23 template <typename T, typename Allocator>
24 inline detail::kernel_2d<T, Allocator> get_identity_kernel()
26 detail::kernel_2d<T, Allocator> kernel(1, 0, 0);
31 }}} // namespace boost::gil::detail