2 // Copyright 2012 Christian Henning, Andreas Pokorny, Lubomir Bourdev
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 #ifndef BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_RGB_TO_LUMINANCE_HPP
9 #define BOOST_GIL_EXTENSION_TOOLBOX_COLOR_CONVERTERS_RGB_TO_LUMINANCE_HPP
11 #include <boost/gil/color_convert.hpp>
13 namespace boost{ namespace gil { namespace detail {
15 /// - performance specialization double
16 /// - to eliminate compiler warning 4244
17 template <typename GrayChannelValue>
18 struct rgb_to_luminance_fn< double, double, double, GrayChannelValue >
20 GrayChannelValue operator()( const double& red
22 , const double& blue ) const
24 return channel_convert<GrayChannelValue>( red * 0.30 + green * 0.59 + blue * 0.11 );