Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:55

0001 //
0002 // Copyright 2005-2007 Adobe Systems Incorporated
0003 //
0004 // Distributed under the Boost Software License, Version 1.0
0005 // See accompanying file LICENSE_1_0.txt or copy at
0006 // http://www.boost.org/LICENSE_1_0.txt
0007 //
0008 #ifndef BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
0009 #define BOOST_GIL_CONCEPTS_PIXEL_BASED_HPP
0010 
0011 #include <boost/gil/concepts/basic.hpp>
0012 #include <boost/gil/concepts/channel.hpp>
0013 #include <boost/gil/concepts/color.hpp>
0014 #include <boost/gil/concepts/concept_check.hpp>
0015 #include <boost/gil/concepts/fwd.hpp>
0016 
0017 #include <cstddef>
0018 
0019 #if defined(BOOST_CLANG)
0020 #pragma clang diagnostic push
0021 #pragma clang diagnostic ignored "-Wunknown-pragmas"
0022 #pragma clang diagnostic ignored "-Wunused-local-typedefs"
0023 #endif
0024 
0025 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
0026 #pragma GCC diagnostic push
0027 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
0028 #endif
0029 
0030 namespace boost { namespace gil {
0031 
0032 /// \ingroup PixelBasedConcept
0033 /// \brief Concept for all pixel-based GIL constructs.
0034 ///
0035 /// Pixel-based constructs include pixels, iterators, locators, views and
0036 /// images whose value type is a pixel.
0037 ///
0038 /// \code
0039 /// concept PixelBasedConcept<typename T>
0040 /// {
0041 ///     typename color_space_type<T>;
0042 ///         where Metafunction<color_space_type<T> >;
0043 ///         where ColorSpaceConcept<color_space_type<T>::type>;
0044 ///     typename channel_mapping_type<T>;
0045 ///         where Metafunction<channel_mapping_type<T> >;
0046 ///         where ChannelMappingConcept<channel_mapping_type<T>::type>;
0047 ///     typename is_planar<T>;
0048 ///         where Metafunction<is_planar<T> >;
0049 ///         where SameType<is_planar<T>::type, bool>;
0050 /// };
0051 /// \endcode
0052 template <typename P>
0053 struct PixelBasedConcept
0054 {
0055     void constraints()
0056     {
0057         using color_space_t = typename color_space_type<P>::type;
0058         gil_function_requires<ColorSpaceConcept<color_space_t>>();
0059 
0060         using channel_mapping_t = typename channel_mapping_type<P>::type ;
0061         gil_function_requires<ChannelMappingConcept<channel_mapping_t>>();
0062 
0063         static const bool planar = is_planar<P>::value;
0064         ignore_unused_variable_warning(planar);
0065 
0066         // This is not part of the concept, but should still work
0067         static const std::size_t nc = num_channels<P>::value;
0068         ignore_unused_variable_warning(nc);
0069     }
0070 };
0071 
0072 /// \brief Concept for homogeneous pixel-based GIL constructs
0073 /// \ingroup PixelBasedConcept
0074 /// \code
0075 /// concept HomogeneousPixelBasedConcept<PixelBasedConcept T>
0076 /// {
0077 ///     typename channel_type<T>;
0078 ///         where Metafunction<channel_type<T>>;
0079 ///         where ChannelConcept<channel_type<T>::type>;
0080 /// };
0081 /// \endcode
0082 template <typename P>
0083 struct HomogeneousPixelBasedConcept
0084 {
0085     void constraints()
0086     {
0087         gil_function_requires<PixelBasedConcept<P>>();
0088 
0089         using channel_t = typename channel_type<P>::type;
0090         gil_function_requires<ChannelConcept<channel_t>>();
0091     }
0092 };
0093 
0094 }} // namespace boost::gil
0095 
0096 #if defined(BOOST_CLANG)
0097 #pragma clang diagnostic pop
0098 #endif
0099 
0100 #if defined(BOOST_GCC) && (BOOST_GCC >= 40900)
0101 #pragma GCC diagnostic pop
0102 #endif
0103 
0104 #endif