threshold_color_spaces_not_compatible_fail.cpp 696 B

12345678910111213141516171819202122232425
  1. //
  2. // Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
  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. #include <boost/gil/image_processing/threshold.hpp>
  9. namespace gil = boost::gil;
  10. int main()
  11. {
  12. // Source and destination views must have pixels with the same (compatible) color space
  13. {
  14. gil::rgb8_image_t src;
  15. gil::gray8_image_t dst;
  16. gil::threshold_binary(const_view(src), view(dst), 0, 255);
  17. }
  18. {
  19. gil::gray8_image_t src;
  20. gil::rgb8_image_t dst;
  21. gil::threshold_binary(const_view(src), view(dst), 0, 255);
  22. }
  23. }