]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / gil / extension / toolbox / color_converters / rgb_to_luminance.hpp
1 //
2 // Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
3 //
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
7 //
8 #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_RGB_TO_LUMINANCE_HPP
9 #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_RGB_TO_LUMINANCE_HPP
10
11 #include <boost/gil/color_convert.hpp>
12
13 namespace boost{ namespace gil { namespace detail {
14
15 /// - performance specialization double
16 /// - to eliminate compiler warning 4244
17 template <typename GrayChannelValue>
18 struct rgb_to_luminance_fn< double, double, double, GrayChannelValue >
19 {
20 GrayChannelValue operator()( const double& red
21 , const double& green
22 , const double& blue ) const
23 {
24 return channel_convert<GrayChannelValue>( red * 0.30 + green * 0.59 + blue * 0.11 );
25 }
26 };
27
28 } // namespace detail
29 } // namespace gil
30 } // namespace boost
31
32 #endif