2
0
mirror of https://github.com/boostorg/gil.git synced 2026-02-19 02:22:09 +00:00
Files
gil/toolbox/test/rgb_to_luminance.cpp
Mateusz Loskot ed67f9a571 Replace bitsN[s] aliases with C++11 fixed width integer types
Import the selection of integer types into boost::gil namespace,
  and move from channel.hpp to typedefs.hpp for easier access.
Replace bits32f with float32_t and bits64f with float64_t
  - kept as alias of scoped_channel_value.
Move float64_t (bits64f) to typedefs.hpp.
Replace the four {float|double}_{zero|one} min/max channel values
  with float_point_zero and float_point_one templates.
Replace <boost/cstdint,hpp> with C++11 <cstdint>.

Introduce preference of using declaration instead of typedef.
Reformat typedefs.hpp to take advantage of the using declaration
  - works much better for left-to-right reading, alias name as
    most important detail comes first.
Add some of missing #include typedefs.hpp, sort some headers.
2018-06-27 00:02:27 -04:00

33 lines
864 B
C++

/*
Copyright 2013 Christian Henning
Use, modification and distribution are subject to the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
*/
#include <boost/test/unit_test.hpp>
#include <boost/gil.hpp>
#include <boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp>
using namespace boost;
using namespace gil;
struct double_zero { static double apply() { return 0.0; } };
struct double_one { static double apply() { return 1.0; } };
typedef pixel< double, gray_layout_t > gray64f_pixel_t;
typedef pixel< double, rgb_layout_t > rgb64f_pixel_t;
BOOST_AUTO_TEST_SUITE( toolbox_tests )
BOOST_AUTO_TEST_CASE( rgb_to_luminance_test )
{
rgb64f_pixel_t a( 10, 20, 30 );
gray64f_pixel_t b;
color_convert( a, b );
}
BOOST_AUTO_TEST_SUITE_END()