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