8 #ifndef BOOST_GIL_CONCEPTS_PIXEL_HPP
9 #define BOOST_GIL_CONCEPTS_PIXEL_HPP
11 #include <boost/gil/concepts/basic.hpp>
12 #include <boost/gil/concepts/channel.hpp>
13 #include <boost/gil/concepts/color.hpp>
14 #include <boost/gil/concepts/color_base.hpp>
15 #include <boost/gil/concepts/concept_check.hpp>
16 #include <boost/gil/concepts/fwd.hpp>
17 #include <boost/gil/concepts/pixel_based.hpp>
18 #include <boost/gil/concepts/detail/type_traits.hpp>
20 #include <boost/type_traits.hpp>
21 #include <boost/mpl/and.hpp>
22 #include <boost/mpl/bool.hpp>
26 #if defined(BOOST_CLANG)
27 #pragma clang diagnostic push
28 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
31 #if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
32 #pragma GCC diagnostic push
33 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
36 namespace boost {
namespace gil {
68 gil_function_requires<ColorBaseConcept<P>>();
69 gil_function_requires<PixelBasedConcept<P>>();
71 static_assert(is_pixel<P>::value,
"");
72 static const bool is_mutable = P::is_mutable;
73 ignore_unused_variable_warning(is_mutable);
75 using value_type =
typename P::value_type;
79 using reference =
typename P::reference;
82 typename detail::remove_const_and_reference<reference>::type
85 using const_reference =
typename P::const_reference;
88 typename detail::remove_const_and_reference<const_reference>::type
101 template <
typename P>
106 gil_function_requires<PixelConcept<P>>();
107 static_assert(P::is_mutable,
"");
123 template <
typename P>
128 gil_function_requires<PixelConcept<P>>();
129 gil_function_requires<HomogeneousColorBaseConcept<P>>();
130 gil_function_requires<HomogeneousPixelBasedConcept<P>>();
148 template <
typename P>
153 gil_function_requires<HomogeneousPixelConcept<P>>();
154 gil_function_requires<MutableHomogeneousColorBaseConcept<P>>();
170 template <
typename P>
175 gil_function_requires<PixelConcept<P>>();
176 gil_function_requires<Regular<P>>();
188 template <
typename P>
193 gil_function_requires<HomogeneousPixelConcept<P>>();
194 gil_function_requires<Regular<P>>();
195 static_assert(is_same<P, typename P::value_type>::value,
"");
201 template <
typename P1,
typename P2,
int K>
202 struct channels_are_pairwise_compatible
206 channels_are_pairwise_compatible<P1, P2, K - 1>,
207 channels_are_compatible
209 typename kth_semantic_element_reference_type<P1, K>::type,
210 typename kth_semantic_element_reference_type<P2, K>::type
216 template <
typename P1,
typename P2>
217 struct channels_are_pairwise_compatible<P1, P2, -1>
230 template <
typename P1,
typename P2>
235 typename color_spaces_are_compatible
237 typename color_space_type<P1>::type,
238 typename color_space_type<P2>::type
240 detail::channels_are_pairwise_compatible
242 P1, P2, num_channels<P1>::value - 1
261 template <
typename P1,
typename P2>
282 template <
typename SrcP,
typename DstP>
287 gil_function_requires<PixelConcept<SrcP>>();
288 gil_function_requires<MutablePixelConcept<DstP>>();
297 #if defined(BOOST_CLANG)
298 #pragma clang diagnostic pop
301 #if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
302 #pragma GCC diagnostic pop
Homogeneous pixel concept that allows for changing its channels.
Definition: concepts/pixel.hpp:149
Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
Definition: concepts/pixel.hpp:262
Pixel concept that is a Regular type.
Definition: concepts/pixel.hpp:171
Specifies the element type of a homogeneous color base.
Definition: color_base_algorithm.hpp:224
Homogeneous pixel concept that is a Regular type.
Definition: concepts/pixel.hpp:189
Homogeneous pixel concept.
Definition: concepts/pixel.hpp:124
Pixel concept that allows for changing its channels.
Definition: concepts/pixel.hpp:102
Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted...
Definition: concepts/pixel.hpp:283
void color_convert(const SrcP &src, DstP &dst)
helper function for converting one pixel to another using GIL default color-converters where ScrP mod...
Definition: color_convert.hpp:296
Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
Definition: concepts/pixel.hpp:231
Pixel concept - A color base whose elements are channels.
Definition: concepts/pixel.hpp:64