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> 19 #include <boost/gil/detail/mp11.hpp> 22 #include <type_traits> 24 #if defined(BOOST_CLANG) 25 #pragma clang diagnostic push 26 #pragma clang diagnostic ignored "-Wunused-local-typedefs" 29 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900) 30 #pragma GCC diagnostic push 31 #pragma GCC diagnostic ignored "-Wunused-local-typedefs" 34 namespace boost {
namespace gil {
66 gil_function_requires<ColorBaseConcept<P>>();
67 gil_function_requires<PixelBasedConcept<P>>();
69 static_assert(is_pixel<P>::value,
"");
70 static const bool is_mutable = P::is_mutable;
71 ignore_unused_variable_warning(is_mutable);
73 using value_type =
typename P::value_type;
77 using reference =
typename P::reference;
80 typename detail::remove_const_and_reference<reference>::type
83 using const_reference =
typename P::const_reference;
86 typename detail::remove_const_and_reference<const_reference>::type
104 gil_function_requires<PixelConcept<P>>();
105 static_assert(P::is_mutable,
"");
121 template <
typename P>
126 gil_function_requires<PixelConcept<P>>();
127 gil_function_requires<HomogeneousColorBaseConcept<P>>();
128 gil_function_requires<HomogeneousPixelBasedConcept<P>>();
146 template <
typename P>
151 gil_function_requires<HomogeneousPixelConcept<P>>();
152 gil_function_requires<MutableHomogeneousColorBaseConcept<P>>();
168 template <
typename P>
173 gil_function_requires<PixelConcept<P>>();
174 gil_function_requires<Regular<P>>();
186 template <
typename P>
191 gil_function_requires<HomogeneousPixelConcept<P>>();
192 gil_function_requires<Regular<P>>();
193 static_assert(std::is_same<P, typename P::value_type>::value,
"");
199 template <
typename P1,
typename P2,
int K>
200 struct channels_are_pairwise_compatible
203 channels_are_pairwise_compatible<P1, P2, K - 1>,
204 channels_are_compatible
206 typename kth_semantic_element_reference_type<P1, K>::type,
207 typename kth_semantic_element_reference_type<P2, K>::type
213 template <
typename P1,
typename P2>
214 struct channels_are_pairwise_compatible<P1, P2, -1> : std::true_type {};
224 template <
typename P1,
typename P2>
228 typename color_spaces_are_compatible
230 typename color_space_type<P1>::type,
231 typename color_space_type<P2>::type
233 detail::channels_are_pairwise_compatible
235 P1, P2, num_channels<P1>::value - 1
254 template <
typename P1,
typename P2>
275 template <
typename SrcP,
typename DstP>
280 gil_function_requires<PixelConcept<SrcP>>();
281 gil_function_requires<MutablePixelConcept<DstP>>();
290 #if defined(BOOST_CLANG) 291 #pragma clang diagnostic pop 294 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900) 295 #pragma GCC diagnostic pop Homogeneous pixel concept that allows for changing its channels.
Definition: concepts/pixel.hpp:147
Concept for pixel compatibility Pixels are compatible if their channels and color space types are com...
Definition: concepts/pixel.hpp:255
Pixel concept that is a Regular type.
Definition: concepts/pixel.hpp:169
Specifies the element type of a homogeneous color base.
Definition: color_base_algorithm.hpp:221
Homogeneous pixel concept that is a Regular type.
Definition: concepts/pixel.hpp:187
Homogeneous pixel concept.
Definition: concepts/pixel.hpp:122
Pixel concept that allows for changing its channels.
Definition: concepts/pixel.hpp:100
Pixel convertible concept Convertibility is non-symmetric and implies that one pixel can be converted...
Definition: concepts/pixel.hpp:276
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:304
Returns whether two pixels are compatible Pixels are compatible if their channels and color space typ...
Definition: concepts/pixel.hpp:225
Pixel concept - A color base whose elements are channels.
Definition: concepts/pixel.hpp:62