9
3

cmyk.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // Copyright 2005-2007 Adobe Systems Incorporated
  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_CMYK_HPP
  9. #define BOOST_GIL_CMYK_HPP
  10. #include <boost/gil/metafunctions.hpp>
  11. #include <boost/gil/detail/mp11.hpp>
  12. #include <cstddef>
  13. namespace boost { namespace gil {
  14. /// \addtogroup ColorNameModel
  15. /// \{
  16. /// \brief Cyan
  17. struct cyan_t {};
  18. /// \brief Magenta
  19. struct magenta_t {};
  20. /// \brief Yellow
  21. struct yellow_t {};
  22. /// \brief Black
  23. struct black_t {};
  24. /// \}
  25. /// \ingroup ColorSpaceModel
  26. using cmyk_t = mp11::mp_list<cyan_t, magenta_t, yellow_t, black_t>;
  27. /// \ingroup LayoutModel
  28. using cmyk_layout_t = layout<cmyk_t>;
  29. /// \ingroup ImageViewConstructors
  30. /// \brief from raw CMYK planar data
  31. template <typename IC>
  32. inline typename type_from_x_iterator<planar_pixel_iterator<IC,cmyk_t> >::view_t
  33. planar_cmyk_view(std::size_t width, std::size_t height, IC c, IC m, IC y, IC k, std::ptrdiff_t rowsize_in_bytes)
  34. {
  35. using view_t = typename type_from_x_iterator<planar_pixel_iterator<IC,cmyk_t> >::view_t;
  36. return view_t(width, height, typename view_t::locator(planar_pixel_iterator<IC,cmyk_t>(c,m,y,k), rowsize_in_bytes));
  37. }
  38. } } // namespace gil
  39. #endif