Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:55

0001 //
0002 // Copyright 2019 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
0003 //
0004 // Use, modification and distribution are subject to the Boost Software License,
0005 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 #ifndef BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP
0009 #define BOOST_GIL_IMAGE_PROCESSING_DETAIL_MATH_HPP
0010 
0011 #include <array>
0012 #include <boost/gil/image_processing/kernel.hpp>
0013 
0014 namespace boost { namespace gil { namespace detail {
0015 
0016 static constexpr double pi = 3.14159265358979323846;
0017 
0018 static constexpr std::array<float, 9> dx_sobel = {{-1, 0, 1, -2, 0, 2, -1, 0, 1}};
0019 static constexpr std::array<float, 9> dx_scharr = {{-1, 0, 1, -1, 0, 1, -1, 0, 1}};
0020 static constexpr std::array<float, 9> dy_sobel = {{1, 2, 1, 0, 0, 0, -1, -2, -1}};
0021 static constexpr std::array<float, 9> dy_scharr = {{1, 1, 1, 0, 0, 0, -1, -1, -1}};
0022 
0023 template <typename T, typename Allocator>
0024 inline auto get_identity_kernel() -> detail::kernel_2d<T, Allocator>
0025 {
0026     detail::kernel_2d<T, Allocator> kernel(1, 0, 0);
0027     kernel[0] = 1;
0028     return kernel;
0029 }
0030 
0031 }}} // namespace boost::gil::detail
0032 
0033 #endif