Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / gil / concepts / color.hpp
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_CONCEPTS_COLOR_HPP
9 #define BOOST_GIL_CONCEPTS_COLOR_HPP
10
11 #include <boost/gil/concepts/concept_check.hpp>
12
13 #include <type_traits>
14
15 #if defined(BOOST_CLANG)
16 #pragma clang diagnostic push
17 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
18 #endif
19
20 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
21 #pragma GCC diagnostic push
22 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
23 #endif
24
25 namespace boost { namespace gil {
26
27 /// \ingroup ColorSpaceAndLayoutConcept
28 /// \brief Color space type concept
29 /// \code
30 /// concept ColorSpaceConcept<MPLRandomAccessSequence CS>
31 /// {
32 ///    // Boost.MP11-compatible list, whose elements are color tags.
33 /// };
34 /// \endcode
35 template <typename CS>
36 struct ColorSpaceConcept
37 {
38     void constraints()
39     {
40         // Boost.MP11-compatible list, whose elements are color tags
41
42         // TODO: Is this incomplete?
43     }
44 };
45
46 // Models ColorSpaceConcept
47 template <typename CS1, typename CS2>
48 struct color_spaces_are_compatible : std::is_same<CS1, CS2> {};
49
50 /// \ingroup ColorSpaceAndLayoutConcept
51 /// \brief Two color spaces are compatible if they are the same
52 /// \code
53 /// concept ColorSpacesCompatibleConcept<ColorSpaceConcept CS1, ColorSpaceConcept CS2>
54 /// {
55 ///     where SameType<CS1, CS2>;
56 /// };
57 /// \endcode
58 template <typename CS1, typename CS2>
59 struct ColorSpacesCompatibleConcept
60 {
61     void constraints()
62     {
63         static_assert(color_spaces_are_compatible<CS1, CS2>::value, "");
64     }
65 };
66
67 /// \ingroup ColorSpaceAndLayoutConcept
68 /// \brief Channel mapping concept
69 /// \code
70 /// concept ChannelMappingConcept<MPLRandomAccessSequence CM>
71 /// {
72 ///     // Boost.MP11-compatible list, whose elements
73 ///     // model MPLIntegralConstant representing a permutation
74 /// };
75 /// \endcode
76 template <typename CM>
77 struct ChannelMappingConcept
78 {
79     void constraints()
80     {
81         // Boost.MP11-compatible list, whose elements model
82         // MPLIntegralConstant representing a permutation.
83
84         // TODO: Is this incomplete?
85     }
86 };
87
88 }} // namespace boost::gil
89
90 #if defined(BOOST_CLANG)
91 #pragma clang diagnostic pop
92 #endif
93
94 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
95 #pragma GCC diagnostic pop
96 #endif
97
98 #endif