cmyk.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. Copyright 2005-2007 Adobe Systems Incorporated
  3. Use, modification and distribution are subject to the Boost Software License,
  4. Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. See http://opensource.adobe.com/gil for most recent version including documentation.
  7. */
  8. /*************************************************************************************************/
  9. #ifndef GIL_CMYK_H
  10. #define GIL_CMYK_H
  11. ////////////////////////////////////////////////////////////////////////////////////////
  12. /// \file
  13. /// \brief Support for CMYK color space and variants
  14. /// \author Lubomir Bourdev and Hailin Jin \n
  15. /// Adobe Systems Incorporated
  16. /// \date 2005-2007 \n Last updated on October 10, 2007
  17. ////////////////////////////////////////////////////////////////////////////////////////
  18. #include <cstddef>
  19. #include <boost/config.hpp>
  20. #include <boost/mpl/range_c.hpp>
  21. #include <boost/mpl/vector_c.hpp>
  22. #include "gil_config.hpp"
  23. #include "metafunctions.hpp"
  24. namespace boost { namespace gil {
  25. /// \addtogroup ColorNameModel
  26. /// \{
  27. /// \brief Cyan
  28. struct cyan_t {};
  29. /// \brief Magenta
  30. struct magenta_t {};
  31. /// \brief Yellow
  32. struct yellow_t {};
  33. /// \brief Black
  34. struct black_t {};
  35. /// \}
  36. /// \ingroup ColorSpaceModel
  37. typedef mpl::vector4<cyan_t,magenta_t,yellow_t,black_t> cmyk_t;
  38. /// \ingroup LayoutModel
  39. typedef layout<cmyk_t> cmyk_layout_t;
  40. /// \ingroup ImageViewConstructors
  41. /// \brief from raw CMYK planar data
  42. template <typename IC>
  43. inline typename type_from_x_iterator<planar_pixel_iterator<IC,cmyk_t> >::view_t
  44. 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) {
  45. typedef typename type_from_x_iterator<planar_pixel_iterator<IC,cmyk_t> >::view_t RView;
  46. return RView(width, height, typename RView::locator(planar_pixel_iterator<IC,cmyk_t>(c,m,y,k), rowsize_in_bytes));
  47. }
  48. } } // namespace gil
  49. #endif