rgb_to_luminance.cpp 897 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // Copyright 2013 Christian Henning
  3. // Copyright 2013 Davide Anastasia <davideanastasia@users.sourceforge.net>
  4. //
  5. // Distributed under the Boost Software License, Version 1.0
  6. // See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt
  8. //
  9. #include <boost/gil.hpp>
  10. #include <boost/gil/extension/toolbox/color_converters/rgb_to_luminance.hpp>
  11. #include <boost/test/unit_test.hpp>
  12. using namespace boost;
  13. using namespace gil;
  14. struct double_zero { static double apply() { return 0.0; } };
  15. struct double_one { static double apply() { return 1.0; } };
  16. using gray64f_pixel_t = pixel<double, gray_layout_t>;
  17. using rgb64f_pixel_t = pixel<double, rgb_layout_t >;
  18. BOOST_AUTO_TEST_SUITE( toolbox_tests )
  19. BOOST_AUTO_TEST_CASE( rgb_to_luminance_test )
  20. {
  21. rgb64f_pixel_t a( 10, 20, 30 );
  22. gray64f_pixel_t b;
  23. color_convert( a, b );
  24. }
  25. BOOST_AUTO_TEST_SUITE_END()