]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/gil/detail/math.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / gil / detail / math.hpp
CommitLineData
92f5a8d4
TL
1//
2// Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
3//
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)
7//
8#ifndef BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP
9#define BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP
10
11#include <array>
12#include <boost/gil/extension/numeric/kernel.hpp>
13
f67539c2 14namespace boost { namespace gil { namespace detail {
92f5a8d4
TL
15
16static constexpr double pi = 3.14159265358979323846;
17
f67539c2
TL
18static constexpr std::array<float, 9> dx_sobel = {{-1, 0, 1, -2, 0, 2, -1, 0, 1}};
19static constexpr std::array<float, 9> dx_scharr = {{-1, 0, 1, -1, 0, 1, -1, 0, 1}};
20static constexpr std::array<float, 9> dy_sobel = {{1, 2, 1, 0, 0, 0, -1, -2, -1}};
21static constexpr std::array<float, 9> dy_scharr = {{1, 1, 1, 0, 0, 0, -1, -1, -1}};
92f5a8d4
TL
22
23template <typename T, typename Allocator>
24inline detail::kernel_2d<T, Allocator> get_identity_kernel()
25{
26 detail::kernel_2d<T, Allocator> kernel(1, 0, 0);
27 kernel[0] = 1;
28 return kernel;
29}
30
f67539c2 31}}} // namespace boost::gil::detail
92f5a8d4
TL
32
33#endif